@chevre/domain 20.2.0-alpha.51 → 20.2.0-alpha.52

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.
@@ -108,5 +108,9 @@ declare function authorize(params: {
108
108
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
109
109
  paymentServiceType: factory.service.paymentService.PaymentServiceType;
110
110
  location?: factory.action.trade.pay.ILocation;
111
+ /**
112
+ * アクション失敗時に即時に決済取引を中止するかどうか
113
+ */
114
+ useCancelPayTransactionOnFailed: boolean;
111
115
  }): IAuthorizeOperation<IAuthorizePaymentAction>;
112
116
  export { onPaymentStatusChanged, authorize, invalidatePaymentUrl, voidPayTransaction, person2username, processVoidPayTransaction, publishPaymentUrl };
@@ -268,6 +268,15 @@ function authorize(params) {
268
268
  catch (__) {
269
269
  // no op
270
270
  }
271
+ // 即時に決済取引を中止するか?(2023-02-03~)
272
+ if (params.useCancelPayTransactionOnFailed) {
273
+ yield processVoidPayTransaction({
274
+ project: action.project,
275
+ agent: { id: action.project.id },
276
+ id: action.id,
277
+ purpose: action.purpose
278
+ })(repos);
279
+ }
271
280
  throw error;
272
281
  }
273
282
  // アクションを完了
@@ -318,8 +318,8 @@ function processAuthorizeCreditCard(params) {
318
318
  issuedThrough: { id: String(creditCardPaymentService.id) }
319
319
  },
320
320
  purpose: params.purpose,
321
- paymentServiceType: factory.service.paymentService.PaymentServiceType.CreditCard
322
- // iss: params.iss
321
+ paymentServiceType: factory.service.paymentService.PaymentServiceType.CreditCard,
322
+ useCancelPayTransactionOnFailed: false
323
323
  })(repos);
324
324
  });
325
325
  }
package/package.json CHANGED
@@ -120,5 +120,5 @@
120
120
  "postversion": "git push origin --tags",
121
121
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
122
122
  },
123
- "version": "20.2.0-alpha.51"
123
+ "version": "20.2.0-alpha.52"
124
124
  }