@chevre/domain 21.6.0-alpha.6 → 21.6.0-alpha.7

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.
@@ -72,11 +72,17 @@ function createStartParams(params) {
72
72
  : undefined), (Array.isArray((_v = params.object.paymentMethod) === null || _v === void 0 ? void 0 : _v.movieTickets))
73
73
  ? { movieTickets: (_w = params.object.paymentMethod) === null || _w === void 0 ? void 0 : _w.movieTickets }
74
74
  : undefined);
75
+ const serviceOutput = (typeof creditCardAsPaymentServiceOutputCurrency === 'string')
76
+ ? {
77
+ amount: {
78
+ currency: creditCardAsPaymentServiceOutputCurrency,
79
+ value: paymentMethod.amount // 通貨区分としての金額
80
+ }
81
+ }
82
+ : undefined;
75
83
  const object = Object.assign({
76
84
  // パラメータから必要なもののみ取り込む
77
- accountId: (typeof accountId === 'string') ? accountId : '', paymentMethodId: params.transactionNumber, typeOf: params.paymentServiceType, id: paymentServiceId, onPaymentStatusChanged: { informPayment: informPaymentParams }, paymentMethod }, (typeof creditCardAsPaymentServiceOutputCurrency === 'string')
78
- ? { serviceOutput: { amount: { currency: creditCardAsPaymentServiceOutputCurrency } } }
79
- : undefined);
85
+ accountId: (typeof accountId === 'string') ? accountId : '', paymentMethodId: params.transactionNumber, typeOf: params.paymentServiceType, id: paymentServiceId, onPaymentStatusChanged: { informPayment: informPaymentParams }, paymentMethod }, (typeof serviceOutput !== undefined) ? { serviceOutput } : undefined);
80
86
  return Object.assign({ project: { typeOf: factory.organizationType.Project, id: params.project.id }, transactionNumber: params.transactionNumber, typeOf: factory.assetTransactionType.Pay, agent: params.agent, recipient: params.recipient, object, expires: params.expires }, (typeof ((_x = params.location) === null || _x === void 0 ? void 0 : _x.typeOf) === 'string')
81
87
  ? { location: params.location }
82
88
  : undefined);
@@ -42,6 +42,7 @@ function createPayActions(params) {
42
42
  }
43
43
  return payActions;
44
44
  }
45
+ // tslint:disable-next-line:cyclomatic-complexity
45
46
  function createPayObject(params) {
46
47
  var _a;
47
48
  const transaction = params.transaction;
@@ -81,15 +82,11 @@ function createPayObject(params) {
81
82
  };
82
83
  break;
83
84
  case factory.service.paymentService.PaymentServiceType.CreditCard:
84
- payObject = {
85
- typeOf: transaction.object.typeOf,
86
- id: (typeof transaction.object.id === 'string') ? transaction.object.id : '',
87
- paymentMethod: Object.assign({ additionalProperty: (Array.isArray(additionalProperty)) ? additionalProperty : [], name: paymentMethodName, paymentMethodId: paymentMethodId, totalPaymentDue: {
85
+ payObject = Object.assign({ typeOf: transaction.object.typeOf, id: (typeof transaction.object.id === 'string') ? transaction.object.id : '', paymentMethod: Object.assign({ additionalProperty: (Array.isArray(additionalProperty)) ? additionalProperty : [], name: paymentMethodName, paymentMethodId: paymentMethodId, totalPaymentDue: {
88
86
  typeOf: 'MonetaryAmount',
89
87
  currency: factory.priceCurrency.JPY,
90
88
  value: Number(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.amount)
91
- }, typeOf: paymentMethodType }, (typeof (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.accountId) === 'string') ? { accountId: paymentMethod.accountId } : undefined)
92
- };
89
+ }, typeOf: paymentMethodType }, (typeof (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.accountId) === 'string') ? { accountId: paymentMethod.accountId } : undefined) }, (paymentServiceOutput !== undefined) ? { serviceOutput: paymentServiceOutput } : undefined);
93
90
  break;
94
91
  case factory.service.paymentService.PaymentServiceType.MovieTicket:
95
92
  payObject = Object.assign({ typeOf: transaction.object.typeOf, id: (typeof transaction.object.id === 'string') ? transaction.object.id : '', paymentMethod: {
@@ -123,7 +120,12 @@ function createPayObjectServiceOutput(params) {
123
120
  case factory.service.paymentService.PaymentServiceType.CreditCard:
124
121
  // CreditCardIFのカード通貨区分を追加(2023-08-07~)
125
122
  const creditCardAsPaymentServiceOutput = (typeof ((_b = (_a = transaction.object.serviceOutput) === null || _a === void 0 ? void 0 : _a.amount) === null || _b === void 0 ? void 0 : _b.currency) === 'string')
126
- ? { amount: { currency: transaction.object.serviceOutput.amount.currency } }
123
+ ? {
124
+ amount: {
125
+ currency: transaction.object.serviceOutput.amount.currency,
126
+ value: transaction.object.paymentMethod.amount
127
+ }
128
+ }
127
129
  : undefined;
128
130
  if (creditCardAsPaymentServiceOutput !== undefined) {
129
131
  paymentServiceOutput = creditCardAsPaymentServiceOutput;
@@ -86,9 +86,8 @@ function createAuthorizeResult(params) {
86
86
  if (typeof (totalPaymentDue === null || totalPaymentDue === void 0 ? void 0 : totalPaymentDue.typeOf) !== 'string') {
87
87
  throw new factory.errors.ServiceUnavailable('payTransaction.object.paymentMethod.totalPaymentDue undefined');
88
88
  }
89
- const creditCardAsPaymentServiceOutputCurrency = (_c = (_b = payTransactionObject.serviceOutput) === null || _b === void 0 ? void 0 : _b.amount) === null || _c === void 0 ? void 0 : _c.currency;
90
- const issuedThrough = Object.assign({ typeOf: payTransactionObject.typeOf, id: (typeof payTransactionObject.id === 'string') ? payTransactionObject.id : '' }, (typeof creditCardAsPaymentServiceOutputCurrency === 'string')
91
- ? { serviceOutput: { amount: { currency: creditCardAsPaymentServiceOutputCurrency } } }
89
+ const issuedThrough = Object.assign({ typeOf: payTransactionObject.typeOf, id: (typeof payTransactionObject.id === 'string') ? payTransactionObject.id : '' }, (typeof ((_c = (_b = payTransactionObject.serviceOutput) === null || _b === void 0 ? void 0 : _b.amount) === null || _c === void 0 ? void 0 : _c.currency) === 'string')
90
+ ? { serviceOutput: payTransactionObject.serviceOutput }
92
91
  : undefined);
93
92
  return {
94
93
  accountId: (typeof ((_d = payTransactionObject.paymentMethod) === null || _d === void 0 ? void 0 : _d.accountId) === 'string')
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.324.0-alpha.2",
13
- "@cinerino/sdk": "3.162.2",
12
+ "@chevre/factory": "4.324.0-alpha.3",
13
+ "@cinerino/sdk": "3.162.3",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -117,5 +117,5 @@
117
117
  "postversion": "git push origin --tags",
118
118
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
119
119
  },
120
- "version": "21.6.0-alpha.6"
120
+ "version": "21.6.0-alpha.7"
121
121
  }