@chevre/domain 21.7.0-alpha.4 → 21.7.0-alpha.5

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.
@@ -24,6 +24,6 @@ export declare function createReturnOrderMessage(params: {
24
24
  */
25
25
  export declare function createRefundMessage(params: {
26
26
  order: factory.order.IOrder;
27
- paymentMethods: factory.order.IPaymentMethod[];
27
+ paymentMethods: factory.order.IReferencedInvoice[];
28
28
  email?: factory.creativeWork.message.email.ICustomization;
29
29
  }): Promise<factory.creativeWork.message.email.ICreativeWork>;
@@ -104,6 +104,9 @@ function createAuthorizeResult(params) {
104
104
  // }
105
105
  // : undefined
106
106
  };
107
+ const paymentMethodAsObject = {
108
+ typeOf: params.object.paymentMethod
109
+ };
107
110
  return {
108
111
  accountId: (typeof ((_b = payTransactionObject.paymentMethod) === null || _b === void 0 ? void 0 : _b.accountId) === 'string')
109
112
  ? payTransactionObject.paymentMethod.accountId
@@ -112,6 +115,7 @@ function createAuthorizeResult(params) {
112
115
  // amount: params.object.amount,
113
116
  issuedThrough,
114
117
  paymentMethod: params.object.paymentMethod,
118
+ paymentMethodAsObject,
115
119
  paymentStatus: factory.paymentStatusType.PaymentDue,
116
120
  paymentMethodId: (typeof ((_c = payTransactionObject.paymentMethod) === null || _c === void 0 ? void 0 : _c.paymentMethodId) === 'string')
117
121
  ? payTransactionObject.paymentMethod.paymentMethodId
@@ -70,16 +70,13 @@ function createPaymentMethods(params) {
70
70
  });
71
71
  // 決済方法をセット
72
72
  authorizePaymentActions.forEach((a) => {
73
+ var _a, _b;
73
74
  const result = a.result;
74
- paymentMethods.push({
75
- accountId: result.accountId,
76
- additionalProperty: (Array.isArray(result.additionalProperty)) ? result.additionalProperty : [],
77
- issuedThrough: result.issuedThrough,
78
- name: result.name,
79
- paymentMethodId: result.paymentMethodId,
80
- totalPaymentDue: result.totalPaymentDue,
81
- typeOf: result.paymentMethod
82
- });
75
+ const paymentMethodAmountCurrencyByAuthorizeAction = (_b = (_a = result.paymentMethodAsObject) === null || _a === void 0 ? void 0 : _a.amount) === null || _b === void 0 ? void 0 : _b.currency;
76
+ const paymentMethodOfInvoice = (typeof paymentMethodAmountCurrencyByAuthorizeAction === 'string') ?
77
+ { amount: { currency: paymentMethodAmountCurrencyByAuthorizeAction } }
78
+ : undefined;
79
+ paymentMethods.push(Object.assign({ accountId: result.accountId, additionalProperty: (Array.isArray(result.additionalProperty)) ? result.additionalProperty : [], issuedThrough: result.issuedThrough, name: result.name, paymentMethodId: result.paymentMethodId, totalPaymentDue: result.totalPaymentDue, typeOf: result.paymentMethod }, (paymentMethodOfInvoice !== undefined) ? { paymentMethod: paymentMethodOfInvoice } : undefined));
83
80
  });
84
81
  // 決済方法から注文金額の計算
85
82
  // price += authorizePaymentActions
@@ -214,9 +214,9 @@ function validatePaymentMethods(params) {
214
214
  if (typeof settings_1.settings.maxNumCreditCardPaymentMethod === 'number') {
215
215
  // CreditCard IFの決済方法の最大値検証
216
216
  const creditCardPaymentMethodCount = params.order.paymentMethods.filter((p) => {
217
- var _a, _b, _c;
217
+ var _a, _b;
218
218
  // カード通貨区分の存在する決済サービスを考慮(2023-08-09~)
219
- const serviceOutputAmountCurrency = (_c = (_b = (_a = p.issuedThrough.serviceOutput) === null || _a === void 0 ? void 0 : _a.paymentMethod) === null || _b === void 0 ? void 0 : _b.amount) === null || _c === void 0 ? void 0 : _c.currency;
219
+ const serviceOutputAmountCurrency = (_b = (_a = p.paymentMethod) === null || _a === void 0 ? void 0 : _a.amount) === null || _b === void 0 ? void 0 : _b.currency;
220
220
  return p.issuedThrough.typeOf === factory.service.paymentService.PaymentServiceType.CreditCard
221
221
  && typeof serviceOutputAmountCurrency !== 'string';
222
222
  }).length;
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
  ],
11
11
  "dependencies": {
12
- "@chevre/factory": "4.325.0-alpha.2",
12
+ "@chevre/factory": "4.325.0-alpha.3",
13
13
  "@cinerino/sdk": "3.164.0",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.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.7.0-alpha.4"
120
+ "version": "21.7.0-alpha.5"
121
121
  }