@chevre/domain 20.4.0-alpha.5 → 20.4.0-alpha.6

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.
@@ -220,20 +220,26 @@ function validateSeller(params) {
220
220
  }
221
221
  function processAuthorizeAccount(params, transaction, paymentServiceId) {
222
222
  return (repos) => __awaiter(this, void 0, void 0, function* () {
223
+ var _a;
224
+ const amount = (_a = params.object.paymentMethod) === null || _a === void 0 ? void 0 : _a.amount;
225
+ if (typeof amount !== 'number') {
226
+ throw new factory.errors.ArgumentNull('object.paymentMethod?.amount');
227
+ }
223
228
  yield (0, validation_1.validateAccount)(params)(repos);
224
- const { pendingTransaction, currency } = yield PaymentCardPayment.authorize(params, paymentServiceId)(repos);
229
+ const { pendingTransaction, currency, accountNumber } = yield PaymentCardPayment.authorize(params, paymentServiceId)(repos);
225
230
  const totalPaymentDue = {
226
231
  typeOf: 'MonetaryAmount',
227
232
  currency,
228
- value: (typeof pendingTransaction.object.amount === 'number')
229
- ? pendingTransaction.object.amount
230
- : pendingTransaction.object.amount.value
233
+ value: amount
234
+ // value: (typeof pendingTransaction.object.amount === 'number')
235
+ // ? pendingTransaction.object.amount
236
+ // : pendingTransaction.object.amount.value
231
237
  };
232
238
  const savingPendingTransaction = {
233
239
  typeOf: pendingTransaction.typeOf,
234
240
  id: pendingTransaction.id,
235
241
  transactionNumber: pendingTransaction.transactionNumber,
236
- object: { fromLocation: { accountNumber: pendingTransaction.object.fromLocation.accountNumber } }
242
+ object: { fromLocation: { accountNumber } }
237
243
  };
238
244
  return saveAuthorizeResult({
239
245
  id: transaction.id,
@@ -6,13 +6,14 @@ import { MongoRepository as ProductRepo } from '../../repo/product';
6
6
  import { MongoRepository as ProjectRepo } from '../../repo/project';
7
7
  import { MongoRepository as TaskRepo } from '../../repo/task';
8
8
  import { RedisRepository as TransactionNumberRepo } from '../../repo/transactionNumber';
9
- declare type IPendingTransaction = Pick<factory.account.transaction.withdraw.ITransaction, 'id' | 'object' | 'transactionNumber' | 'typeOf'>;
9
+ declare type IPendingTransaction = Pick<factory.account.transaction.withdraw.ITransaction, 'id' | 'transactionNumber' | 'typeOf'>;
10
10
  declare function authorize(params: factory.assetTransaction.pay.IStartParamsWithoutDetail, paymentServiceId: string): (repos: {
11
11
  product: ProductRepo;
12
12
  project: ProjectRepo;
13
13
  }) => Promise<{
14
14
  pendingTransaction: IPendingTransaction;
15
15
  currency: string;
16
+ accountNumber: string;
16
17
  }>;
17
18
  declare function voidTransaction(params: factory.task.voidPayment.IData): (repos: {
18
19
  product: ProductRepo;
@@ -55,7 +55,7 @@ function authorize(params, paymentServiceId) {
55
55
  // PecorinoAPIのエラーをハンドリング
56
56
  throw (0, errorHandler_1.handlePecorinoError)(error);
57
57
  }
58
- return { pendingTransaction, currency };
58
+ return { pendingTransaction, currency, accountNumber };
59
59
  });
60
60
  }
61
61
  exports.authorize = authorize;
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "dependencies": {
12
12
  "@chevre/factory": "4.289.0-alpha.6",
13
- "@cinerino/sdk": "3.140.0-alpha.7",
13
+ "@cinerino/sdk": "3.140.0-alpha.8",
14
14
  "@motionpicture/coa-service": "9.2.0",
15
15
  "@motionpicture/gmo-service": "5.2.0",
16
16
  "@sendgrid/mail": "6.4.0",
@@ -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.4.0-alpha.5"
123
+ "version": "20.4.0-alpha.6"
124
124
  }