@cinerino/sdk 3.60.0 → 3.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2886,8 +2886,58 @@ var RoleType;
2886
2886
  })(RoleType = exports.RoleType || (exports.RoleType = {}));
2887
2887
 
2888
2888
  },{}],92:[function(require,module,exports){
2889
- arguments[4][14][0].apply(exports,arguments)
2890
- },{"dup":14}],93:[function(require,module,exports){
2889
+ "use strict";
2890
+ Object.defineProperty(exports, "__esModule", { value: true });
2891
+ /**
2892
+ * ソート条件インターフェース
2893
+ */
2894
+ // export interface ISortOrder {
2895
+ // createdAt?: SortType;
2896
+ // }
2897
+ // export interface ICustomerSearchConditions {
2898
+ // typeOf?: PersonType;
2899
+ // ids?: string[];
2900
+ // identifiers?: PersonFactory.IIdentifier;
2901
+ // /**
2902
+ // * メールアドレス
2903
+ // */
2904
+ // email?: string;
2905
+ // /**
2906
+ // * 電話番号
2907
+ // */
2908
+ // telephone?: string;
2909
+ // memberOf?: {
2910
+ // /**
2911
+ // * 会員番号
2912
+ // */
2913
+ // membershipNumbers?: string[];
2914
+ // };
2915
+ // }
2916
+ // export interface IReferencesOrderSearchConditions {
2917
+ // orderNumbers?: string[];
2918
+ // }
2919
+ /**
2920
+ * インボイス検索条件インターフェース
2921
+ */
2922
+ // export interface ISearchConditions {
2923
+ // limit?: number;
2924
+ // page?: number;
2925
+ // sort?: ISortOrder;
2926
+ // project?: {
2927
+ // id?: { $eq?: string };
2928
+ // };
2929
+ // createdFrom?: Date;
2930
+ // createdThrough?: Date;
2931
+ // accountIds?: string[];
2932
+ // confirmationNumbers?: string[];
2933
+ // customer?: ICustomerSearchConditions;
2934
+ // paymentMethods?: string[];
2935
+ // paymentMethodIds?: string[];
2936
+ // paymentStatuses?: PaymentStatusType[];
2937
+ // referencesOrder?: IReferencesOrderSearchConditions;
2938
+ // }
2939
+
2940
+ },{}],93:[function(require,module,exports){
2891
2941
  "use strict";
2892
2942
  Object.defineProperty(exports, "__esModule", { value: true });
2893
2943
  exports.ItemAvailability = void 0;
@@ -66,7 +66,8 @@ async function main() {
66
66
 
67
67
  // 確定
68
68
  await payService.confirm({
69
- transactionNumber: transactionNumber
69
+ transactionNumber: transactionNumber,
70
+ potentialActions: { pay: { purpose: { typeOf: client.factory.order.OrderType.Order } } }
70
71
  });
71
72
  console.log('transaction confirmed');
72
73
  }
@@ -245,7 +245,8 @@ async function main() {
245
245
  }
246
246
  }
247
247
  }
248
- }
248
+ },
249
+ priceSpecification: { appliesToMovieTicket: { identifier: '12345' } }
249
250
  };
250
251
  })
251
252
  },
@@ -1,8 +1,10 @@
1
1
  // tslint:disable:no-console no-implicit-dependencies no-magic-numbers
2
2
  import * as moment from 'moment';
3
3
  import * as client from '../../../lib/index';
4
- import * as auth from '../auth/auth';
5
- // import * as auth from '../authAsAdmin';
4
+ // import * as auth from '../auth/auth';
5
+ import { auth as authClient } from '../auth/clientCredentials';
6
+
7
+ const project = { id: process.env.PROJECT_ID };
6
8
 
7
9
  const creditCard = {
8
10
  cardNo: '4111111111111111',
@@ -21,14 +23,9 @@ const profile = {
21
23
  const movieTickets = [
22
24
  {
23
25
  typeOf: 'MovieTicket',
24
- identifier: '2343314517',
25
- accessCode: '1234'
26
+ identifier: '2127021398',
27
+ accessCode: '3896'
26
28
  }
27
- // {
28
- // typeOf: client.factory.paymentMethodType.MGTicket,
29
- // identifier: "AA5919737",
30
- // accessCode: "49256768349",
31
- // }
32
29
  ];
33
30
 
34
31
  export type IAuthorizeReservationAction
@@ -36,36 +33,32 @@ export type IAuthorizeReservationAction
36
33
 
37
34
  // tslint:disable-next-line:max-func-body-length
38
35
  async function main() {
39
- const authClient = await auth.login();
40
- await authClient.refreshAccessToken();
41
- const loginTicket = authClient.verifyIdToken({});
42
- console.log('username is', loginTicket.getUsername());
36
+ // const authClient = await auth.login();
37
+ // await authClient.refreshAccessToken();
38
+ // const loginTicket = authClient.verifyIdToken({});
39
+ // console.log('username is', loginTicket.getUsername());
43
40
 
44
41
  const eventService = new client.service.Event({
45
42
  endpoint: <string>process.env.API_ENDPOINT,
46
- auth: authClient
43
+ auth: authClient,
44
+ project
47
45
  });
48
46
  const sellerService = new client.service.Seller({
49
47
  endpoint: <string>process.env.API_ENDPOINT,
50
- auth: authClient
48
+ auth: authClient,
49
+ project
51
50
  });
52
51
  const placeOrderService = new client.service.txn.PlaceOrder({
53
52
  endpoint: <string>process.env.API_ENDPOINT,
54
- auth: authClient
53
+ auth: authClient,
54
+ project
55
55
  });
56
- // const personService = new client.service.Person({
57
- // endpoint: <string>process.env.API_ENDPOINT,
58
- // auth: authClient
59
- // });
60
56
  const paymentService = new client.service.Payment({
61
57
  endpoint: <string>process.env.API_ENDPOINT,
62
- auth: authClient
58
+ auth: authClient,
59
+ project
63
60
  });
64
61
 
65
- // console.log('finding profile...');
66
- // const profile = await personService.getProfile({ personId: 'me' });
67
- // console.log('profile found');
68
-
69
62
  // 販売劇場検索
70
63
  const searchSellersResult = await sellerService.search({});
71
64
  // tslint:disable-next-line:insecure-random
@@ -120,7 +113,7 @@ async function main() {
120
113
  console.log('starting transaction...');
121
114
  const transaction = await placeOrderService.start({
122
115
  expires: moment()
123
- .add(10, 'minutes')
116
+ .add(1, 'minutes')
124
117
  .toDate(),
125
118
  agent: {
126
119
  identifier: [
@@ -201,9 +194,13 @@ async function main() {
201
194
  const selectedScreeningRoomSection = String(availableSeatOffers[0].containedInPlace?.branchCode);
202
195
  console.log('screening room section selected', selectedScreeningRoomSection);
203
196
  console.log(selectedScreeningRoomSection);
204
- const selectedSeatOffers = availableSeatOffers.slice(0, 1);
197
+ const selectedSeatOffers = availableSeatOffers
198
+ .filter((o) => !Array.isArray(o.seatingType) || o.seatingType.length === 0)
199
+ .slice(0, 1);
205
200
  console.log('seat selected', selectedSeatOffers.map((o) => o.branchCode)
206
201
  .join(','));
202
+ // console.log(selectedSeatOffers);
203
+ // return;
207
204
 
208
205
  await wait(5000);
209
206
  console.log('authorizing seat reservation...');
@@ -215,22 +212,11 @@ async function main() {
215
212
  acceptedOffer: selectedSeatOffers.map((selectedSeatOffer) => {
216
213
  return {
217
214
  id: String(selectedTicketOffer.id),
218
- ticketedSeat: {
219
- seatNumber: selectedSeatOffer.branchCode,
220
- seatSection: selectedScreeningRoomSection
221
- },
222
- paymentMethod: {
223
- project: transaction.project,
224
- typeOf: movieTickets[0].typeOf,
225
- identifier: movieTickets[0].identifier,
226
- accessCode: movieTickets[0].accessCode,
227
- serviceType: '',
215
+ itemOffered: {
228
216
  serviceOutput: {
229
- reservationFor: {
230
- typeOf: client.factory.eventType.ScreeningEvent,
231
- id: screeningEvent.id
232
- },
217
+ typeOf: client.factory.reservationType.EventReservation,
233
218
  reservedTicket: {
219
+ typeOf: 'Ticket',
234
220
  ticketedSeat: {
235
221
  typeOf: client.factory.placeType.Seat,
236
222
  seatNumber: selectedSeatOffer.branchCode,
@@ -239,7 +225,29 @@ async function main() {
239
225
  }
240
226
  }
241
227
  }
242
- }
228
+ },
229
+ priceSpecification: { appliesToMovieTicket: { identifier: movieTickets[0].identifier } }
230
+ // paymentMethod: {
231
+ // project: transaction.project,
232
+ // typeOf: movieTickets[0].typeOf,
233
+ // identifier: movieTickets[0].identifier,
234
+ // accessCode: movieTickets[0].accessCode,
235
+ // serviceType: '',
236
+ // serviceOutput: {
237
+ // reservationFor: {
238
+ // typeOf: client.factory.eventType.ScreeningEvent,
239
+ // id: screeningEvent.id
240
+ // },
241
+ // reservedTicket: {
242
+ // ticketedSeat: {
243
+ // typeOf: client.factory.placeType.Seat,
244
+ // seatNumber: selectedSeatOffer.branchCode,
245
+ // seatSection: selectedScreeningRoomSection,
246
+ // seatRow: ''
247
+ // }
248
+ // }
249
+ // }
250
+ // }
243
251
  };
244
252
  })
245
253
  },
@@ -260,7 +268,7 @@ async function main() {
260
268
  // ムビチケ認証
261
269
  const checkMovieTicketAction = await paymentService.checkMovieTicket({
262
270
  object: {
263
- id: 'xxx',
271
+ id: '5f9a52994f3709000abe6417',
264
272
  paymentMethod: {
265
273
  typeOf: movieTickets[0].typeOf
266
274
  },
@@ -318,7 +326,7 @@ async function main() {
318
326
 
319
327
  // ムビチケ承認アクション
320
328
  console.log('authorizing mvtk payment...');
321
- let movieTicketPaymentAuths = await Promise.all(selectedMovieTickets.map(async (movieTicket, index) => {
329
+ const movieTicketPaymentAuths = await Promise.all(selectedMovieTickets.map(async (movieTicket, index) => {
322
330
  // const reservation = pendingReservations[index];
323
331
  const selectedSeatOffer = selectedSeatOffers[index];
324
332
 
@@ -344,58 +352,57 @@ async function main() {
344
352
  }
345
353
  }
346
354
  }],
347
- issuedThrough: { id: 'xxx' }
355
+ issuedThrough: { id: '5f9a52994f3709000abe6417' }
348
356
  },
349
357
  purpose: transaction
350
358
  });
351
359
  }));
352
360
  console.log(movieTicketPaymentAuths.length, 'mvtk payment authorized');
353
361
 
354
- await wait(5000);
355
-
356
- console.log('voiding mvtk auth...');
357
- await Promise.all(movieTicketPaymentAuths.map(async (movieTicketPaymentAuth) => {
358
- await paymentService.voidTransaction({
359
- id: movieTicketPaymentAuth.id,
360
- object: { typeOf: client.factory.chevre.service.paymentService.PaymentServiceType.MovieTicket },
361
- purpose: movieTicketPaymentAuth.purpose
362
- });
363
- }));
364
- console.log('mvtk auth voided');
365
-
366
- console.log('authorizing mvtk payment...');
367
- movieTicketPaymentAuths = await Promise.all(selectedMovieTickets.map(async (movieTicket, index) => {
368
- // const reservation = pendingReservations[index];
369
- const selectedSeatOffer = selectedSeatOffers[index];
370
-
371
- return paymentService.authorizeMovieTicket({
372
- object: {
373
- typeOf: client.factory.action.authorize.paymentMethod.any.ResultType.Payment,
374
- paymentMethod: movieTickets[0].typeOf,
375
- amount: 0,
376
- movieTickets: [{
377
- ...movieTicket,
378
- serviceOutput: {
379
- reservationFor: {
380
- typeOf: screeningEvent.typeOf,
381
- id: screeningEvent.id
382
- },
383
- reservedTicket: {
384
- ticketedSeat: {
385
- typeOf: client.factory.placeType.Seat,
386
- seatNumber: selectedSeatOffer.branchCode,
387
- seatSection: selectedScreeningRoomSection,
388
- seatRow: ''
389
- }
390
- }
391
- }
392
- }],
393
- issuedThrough: { id: 'xxx' }
394
- },
395
- purpose: transaction
396
- });
397
- }));
398
- console.log(movieTicketPaymentAuths.length, 'mvtk payment authorized');
362
+ // await wait(5000);
363
+
364
+ // console.log('voiding mvtk auth...');
365
+ // await Promise.all(movieTicketPaymentAuths.map(async (movieTicketPaymentAuth) => {
366
+ // await paymentService.voidTransaction({
367
+ // id: movieTicketPaymentAuth.id,
368
+ // object: { typeOf: client.factory.chevre.service.paymentService.PaymentServiceType.MovieTicket },
369
+ // purpose: movieTicketPaymentAuth.purpose
370
+ // });
371
+ // }));
372
+ // console.log('mvtk auth voided');
373
+
374
+ // console.log('authorizing mvtk payment...');
375
+ // movieTicketPaymentAuths = await Promise.all(selectedMovieTickets.map(async (movieTicket, index) => {
376
+ // const selectedSeatOffer = selectedSeatOffers[index];
377
+
378
+ // return paymentService.authorizeMovieTicket({
379
+ // object: {
380
+ // typeOf: client.factory.action.authorize.paymentMethod.any.ResultType.Payment,
381
+ // paymentMethod: movieTickets[0].typeOf,
382
+ // amount: 0,
383
+ // movieTickets: [{
384
+ // ...movieTicket,
385
+ // serviceOutput: {
386
+ // reservationFor: {
387
+ // typeOf: screeningEvent.typeOf,
388
+ // id: screeningEvent.id
389
+ // },
390
+ // reservedTicket: {
391
+ // ticketedSeat: {
392
+ // typeOf: client.factory.placeType.Seat,
393
+ // seatNumber: selectedSeatOffer.branchCode,
394
+ // seatSection: selectedScreeningRoomSection,
395
+ // seatRow: ''
396
+ // }
397
+ // }
398
+ // }
399
+ // }],
400
+ // issuedThrough: { id: '5f9a52994f3709000abe6417' }
401
+ // },
402
+ // purpose: transaction
403
+ // });
404
+ // }));
405
+ // console.log(movieTicketPaymentAuths.length, 'mvtk payment authorized');
399
406
 
400
407
  // 購入者情報入力時間
401
408
  // tslint:disable-next-line:no-magic-numbers
@@ -411,7 +418,7 @@ async function main() {
411
418
  paymentMethod: 'CreditCard',
412
419
  method: '1',
413
420
  creditCard: creditCard,
414
- issuedThrough: { id: 'xxx' }
421
+ issuedThrough: { id: '5f9a4fed4f3709000abe6415' }
415
422
  },
416
423
  purpose: transaction
417
424
  });
package/lib/bundle.js CHANGED
@@ -2886,8 +2886,58 @@ var RoleType;
2886
2886
  })(RoleType = exports.RoleType || (exports.RoleType = {}));
2887
2887
 
2888
2888
  },{}],92:[function(require,module,exports){
2889
- arguments[4][14][0].apply(exports,arguments)
2890
- },{"dup":14}],93:[function(require,module,exports){
2889
+ "use strict";
2890
+ Object.defineProperty(exports, "__esModule", { value: true });
2891
+ /**
2892
+ * ソート条件インターフェース
2893
+ */
2894
+ // export interface ISortOrder {
2895
+ // createdAt?: SortType;
2896
+ // }
2897
+ // export interface ICustomerSearchConditions {
2898
+ // typeOf?: PersonType;
2899
+ // ids?: string[];
2900
+ // identifiers?: PersonFactory.IIdentifier;
2901
+ // /**
2902
+ // * メールアドレス
2903
+ // */
2904
+ // email?: string;
2905
+ // /**
2906
+ // * 電話番号
2907
+ // */
2908
+ // telephone?: string;
2909
+ // memberOf?: {
2910
+ // /**
2911
+ // * 会員番号
2912
+ // */
2913
+ // membershipNumbers?: string[];
2914
+ // };
2915
+ // }
2916
+ // export interface IReferencesOrderSearchConditions {
2917
+ // orderNumbers?: string[];
2918
+ // }
2919
+ /**
2920
+ * インボイス検索条件インターフェース
2921
+ */
2922
+ // export interface ISearchConditions {
2923
+ // limit?: number;
2924
+ // page?: number;
2925
+ // sort?: ISortOrder;
2926
+ // project?: {
2927
+ // id?: { $eq?: string };
2928
+ // };
2929
+ // createdFrom?: Date;
2930
+ // createdThrough?: Date;
2931
+ // accountIds?: string[];
2932
+ // confirmationNumbers?: string[];
2933
+ // customer?: ICustomerSearchConditions;
2934
+ // paymentMethods?: string[];
2935
+ // paymentMethodIds?: string[];
2936
+ // paymentStatuses?: PaymentStatusType[];
2937
+ // referencesOrder?: IReferencesOrderSearchConditions;
2938
+ // }
2939
+
2940
+ },{}],93:[function(require,module,exports){
2891
2941
  "use strict";
2892
2942
  Object.defineProperty(exports, "__esModule", { value: true });
2893
2943
  exports.ItemAvailability = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinerino/sdk",
3
- "version": "3.60.0",
3
+ "version": "3.63.0",
4
4
  "description": "Cinerino SDK",
5
5
  "main": "./lib/index.js",
6
6
  "browser": {
@@ -97,7 +97,7 @@
97
97
  "watchify": "^3.11.1"
98
98
  },
99
99
  "dependencies": {
100
- "@cinerino/api-abstract-client": "3.60.0",
100
+ "@cinerino/api-abstract-client": "3.63.0",
101
101
  "debug": "^3.2.6",
102
102
  "http-status": "^1.4.2",
103
103
  "idtoken-verifier": "^2.0.3",