@chevre/domain 21.33.0-alpha.24 → 21.33.0-alpha.25
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.
- package/example/src/chevre/transaction/processPlaceOrder.ts +1 -0
- package/lib/chevre/service/payment/any/handlePrePublishedPaymentMethodIdOnAuthorizing.js +6 -6
- package/lib/chevre/service/payment/any.js +11 -10
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +4 -3
- package/package.json +2 -2
|
@@ -146,6 +146,7 @@ async function main() {
|
|
|
146
146
|
})({
|
|
147
147
|
accountingReport: await chevre.repository.AccountingReport.createInstance(mongoose.connection),
|
|
148
148
|
action: await chevre.repository.Action.createInstance(mongoose.connection),
|
|
149
|
+
actionRecipe: await chevre.repository.ActionRecipe.createInstance(mongoose.connection),
|
|
149
150
|
assetTransaction: await chevre.repository.AssetTransaction.createInstance(mongoose.connection),
|
|
150
151
|
paymentAccepted: await chevre.repository.SellerPaymentAccepted.createInstance(mongoose.connection),
|
|
151
152
|
paymentService: await chevre.repository.PaymentService.createInstance(mongoose.connection),
|
|
@@ -86,14 +86,14 @@ function handlePrePublishedPaymentMethodIdOnAuthorizing(params) {
|
|
|
86
86
|
// use actionRecipe(2024-06-02~)
|
|
87
87
|
if (typeof (actionRecipe === null || actionRecipe === void 0 ? void 0 : actionRecipe.recipeCategory) === 'string') {
|
|
88
88
|
pendingPaymentAgencyTransaction = recipe2paymentAgencyTransaction(actionRecipe);
|
|
89
|
-
debug('handlePrePublishedPaymentMethodIdOnAuthorizing: pendingPaymentAgencyTransaction from recipe:', JSON.stringify(pendingPaymentAgencyTransaction));
|
|
90
89
|
}
|
|
91
90
|
else {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
91
|
+
// discontinue(2024-06-05~)
|
|
92
|
+
// const { entryTranArgs, entryTranResult, execTranArgs, execTranResult } = paymentMethodByTransaction;
|
|
93
|
+
// if (entryTranArgs !== undefined && entryTranResult !== undefined
|
|
94
|
+
// && execTranArgs !== undefined && execTranResult !== undefined) {
|
|
95
|
+
// pendingPaymentAgencyTransaction = { entryTranArgs, entryTranResult, execTranArgs, execTranResult };
|
|
96
|
+
// }
|
|
97
97
|
}
|
|
98
98
|
if (pendingPaymentAgencyTransaction === undefined) {
|
|
99
99
|
throw new factory.errors.Argument('paymentMethodId', 'pendingPaymentAgencyTransaction not found');
|
|
@@ -57,7 +57,7 @@ function voidPayTransaction(params) {
|
|
|
57
57
|
exports.voidPayTransaction = voidPayTransaction;
|
|
58
58
|
function invalidatePaymentUrl(params) {
|
|
59
59
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
var _a, _b, _c, _d, _e;
|
|
60
|
+
var _a, _b, _c, _d, _e, _f;
|
|
61
61
|
if (params.purpose.typeOf !== factory.transactionType.PlaceOrder) {
|
|
62
62
|
throw new factory.errors.Argument('purpose.typeOf', `must be ${factory.transactionType.PlaceOrder}`);
|
|
63
63
|
}
|
|
@@ -71,7 +71,8 @@ function invalidatePaymentUrl(params) {
|
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
const paymentMethodIdByPaymentUrl = (_a = transaction.object.paymentMethods) === null || _a === void 0 ? void 0 : _a.paymentMethodId;
|
|
74
|
-
const paymentMethodType =
|
|
74
|
+
// const paymentMethodType = transaction.object.paymentMethods?.typeOf;
|
|
75
|
+
const paymentMethodType = (_c = (_b = transaction.object.paymentMethods) === null || _b === void 0 ? void 0 : _b.paymentMethod) === null || _c === void 0 ? void 0 : _c.identifier;
|
|
75
76
|
if (typeof paymentMethodIdByPaymentUrl === 'string' && paymentMethodIdByPaymentUrl.length > 0
|
|
76
77
|
&& typeof paymentMethodType === 'string' && paymentMethodType.length > 0) {
|
|
77
78
|
// chevreで決済URL無効化
|
|
@@ -82,7 +83,7 @@ function invalidatePaymentUrl(params) {
|
|
|
82
83
|
typeOf: transaction.seller.typeOf,
|
|
83
84
|
name: (typeof transaction.seller.name === 'string')
|
|
84
85
|
? transaction.seller.name
|
|
85
|
-
: String((
|
|
86
|
+
: String((_d = transaction.seller.name) === null || _d === void 0 ? void 0 : _d.ja),
|
|
86
87
|
id: transaction.seller.id
|
|
87
88
|
},
|
|
88
89
|
recipient: {
|
|
@@ -92,7 +93,7 @@ function invalidatePaymentUrl(params) {
|
|
|
92
93
|
},
|
|
93
94
|
object: [{
|
|
94
95
|
typeOf: factory.service.paymentService.PaymentServiceType.CreditCard,
|
|
95
|
-
id: (
|
|
96
|
+
id: (_f = (_e = transaction.object.paymentMethods) === null || _e === void 0 ? void 0 : _e.issuedThrough) === null || _f === void 0 ? void 0 : _f.id,
|
|
96
97
|
paymentMethod: {
|
|
97
98
|
additionalProperty: [],
|
|
98
99
|
name: paymentMethodType,
|
|
@@ -252,15 +253,15 @@ function publishPaymentUrl(params) {
|
|
|
252
253
|
})(repos);
|
|
253
254
|
// 取引に保管
|
|
254
255
|
const paymentMethodByPaymentUrl = {
|
|
255
|
-
typeOf: params.object.paymentMethod,
|
|
256
|
+
// typeOf: params.object.paymentMethod, // discontinue(2024-06-05~)
|
|
256
257
|
paymentMethodId: result.paymentMethodId,
|
|
257
|
-
paymentUrl: result.paymentUrl,
|
|
258
|
+
// paymentUrl: result.paymentUrl, // migrate to recipe(2024-06-05~)
|
|
258
259
|
issuedThrough: { id: (typeof startParams.object.id === 'string') ? startParams.object.id : '' },
|
|
259
260
|
// GMO IFを保管(2024-01-01~)
|
|
260
|
-
entryTranArgs: result.entryTranArgs,
|
|
261
|
-
entryTranResult: result.entryTranResult,
|
|
262
|
-
execTranArgs: result.execTranArgs,
|
|
263
|
-
execTranResult: result.execTranResult,
|
|
261
|
+
// entryTranArgs: result.entryTranArgs, // migrate to recipe(2024-06-05~)
|
|
262
|
+
// entryTranResult: result.entryTranResult, // migrate to recipe(2024-06-05~)
|
|
263
|
+
// execTranArgs: result.execTranArgs, // migrate to recipe(2024-06-05~)
|
|
264
|
+
// execTranResult: result.execTranResult, // migrate to recipe(2024-06-05~)
|
|
264
265
|
paymentMethod: startParams.object.paymentMethod // 拡張(2024-01-04~)
|
|
265
266
|
};
|
|
266
267
|
yield repos.transaction.findByIdAndUpdateInProgress({
|
|
@@ -127,12 +127,13 @@ function validatePrice(authorizePaymentActions, authorizeEventServiceOfferAction
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
function validatePaymentUrl(transaction, authorizePaymentActions) {
|
|
130
|
-
var _a
|
|
130
|
+
var _a;
|
|
131
131
|
// 決済URLが発行されている場合、検証
|
|
132
132
|
const paymentMethodId = (_a = transaction.object.paymentMethods) === null || _a === void 0 ? void 0 : _a.paymentMethodId;
|
|
133
|
-
const paymentUrl =
|
|
133
|
+
// const paymentUrl = transaction.object.paymentMethods?.paymentUrl;
|
|
134
134
|
if (typeof paymentMethodId === 'string' && paymentMethodId.length > 0
|
|
135
|
-
|
|
135
|
+
// && typeof paymentUrl === 'string' && paymentUrl.length > 0
|
|
136
|
+
) {
|
|
136
137
|
// 発行された決済URLに対する決済承認を確認する
|
|
137
138
|
const authorizePaymentAction4paymentUrlExists = authorizePaymentActions.some(({ result }) => {
|
|
138
139
|
const resultAsInvoice = (Array.isArray(result))
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/credential-providers": "3.433.0",
|
|
13
|
-
"@chevre/factory": "4.374.0-alpha.
|
|
13
|
+
"@chevre/factory": "4.374.0-alpha.4",
|
|
14
14
|
"@cinerino/sdk": "7.1.0",
|
|
15
15
|
"@motionpicture/coa-service": "9.4.0",
|
|
16
16
|
"@motionpicture/gmo-service": "5.3.0",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"postversion": "git push origin --tags",
|
|
111
111
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
112
112
|
},
|
|
113
|
-
"version": "21.33.0-alpha.
|
|
113
|
+
"version": "21.33.0-alpha.25"
|
|
114
114
|
}
|