@cinerino/sdk 7.0.0-alpha.0 → 7.0.0-alpha.10
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/playground/public/lib/bundle.js +938 -379
- package/example/src/chevre/transaction/processPlaceOrderCOA.ts +397 -0
- package/lib/abstract/chevrePay/payment/factory.d.ts +20 -6
- package/lib/abstract/chevrePay/payment.d.ts +107 -4
- package/lib/abstract/chevrePay/payment.js +137 -3
- package/lib/abstract/chevrePay.d.ts +3 -3
- package/lib/abstract/chevrePay.js +6 -1
- package/lib/abstract/chevreTxc/offer.d.ts +104 -0
- package/lib/abstract/chevreTxc/offer.js +190 -0
- package/lib/abstract/chevreTxc.d.ts +20 -0
- package/lib/abstract/chevreTxc.js +83 -0
- package/lib/abstract/cloud/pay/payment.d.ts +30 -3
- package/lib/abstract/cloud/pay/payment.js +102 -36
- package/lib/abstract/cloud/pay.js +7 -0
- package/lib/abstract/index.d.ts +3 -1
- package/lib/abstract/index.js +24 -1
- package/lib/auth/oAuth2client.js +1 -0
- package/lib/bundle.js +946 -387
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -1
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// import { ACCEPTED, CONFLICT, CREATED, GATEWAY_TIMEOUT, NO_CONTENT, OK, TOO_MANY_REQUESTS } from 'http-status';
|
|
3
2
|
var __extends = (this && this.__extends) || (function () {
|
|
4
3
|
var extendStatics = function (d, b) {
|
|
5
4
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -73,8 +72,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
73
72
|
}
|
|
74
73
|
return t;
|
|
75
74
|
};
|
|
75
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
76
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
77
|
+
to[j] = from[i];
|
|
78
|
+
return to;
|
|
79
|
+
};
|
|
76
80
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
81
|
exports.PaymentService = void 0;
|
|
82
|
+
var http_status_1 = require("http-status");
|
|
78
83
|
var factory = require("../../factory");
|
|
79
84
|
var index_1 = require("../../index");
|
|
80
85
|
var service_1 = require("../../service");
|
|
@@ -91,17 +96,21 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
91
96
|
*/
|
|
92
97
|
PaymentService.prototype.authorizeAnyPayment = function (params) {
|
|
93
98
|
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
var _a, auth, endpoint, project, seller, chevrePay, paymentService;
|
|
99
|
+
var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
95
100
|
return __generator(this, function (_b) {
|
|
96
101
|
switch (_b.label) {
|
|
97
102
|
case 0:
|
|
98
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
99
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
103
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
104
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
100
105
|
case 1:
|
|
101
106
|
chevrePay = _b.sent();
|
|
102
107
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
103
108
|
project: project,
|
|
104
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
109
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
110
|
+
retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []), [
|
|
111
|
+
http_status_1.CONFLICT,
|
|
112
|
+
http_status_1.TOO_MANY_REQUESTS
|
|
113
|
+
])
|
|
105
114
|
})];
|
|
106
115
|
case 2:
|
|
107
116
|
paymentService = _b.sent();
|
|
@@ -115,18 +124,22 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
115
124
|
*/
|
|
116
125
|
PaymentService.prototype.authorizeCreditCardAsync = function (params) {
|
|
117
126
|
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
-
var object, purpose, _a, auth, endpoint, project, seller, chevrePay, paymentService;
|
|
127
|
+
var object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
119
128
|
return __generator(this, function (_b) {
|
|
120
129
|
switch (_b.label) {
|
|
121
130
|
case 0:
|
|
122
131
|
object = params.object, purpose = params.purpose;
|
|
123
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
124
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
132
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
133
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
125
134
|
case 1:
|
|
126
135
|
chevrePay = _b.sent();
|
|
127
136
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
128
137
|
project: project,
|
|
129
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
138
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
139
|
+
retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []), [
|
|
140
|
+
http_status_1.CONFLICT,
|
|
141
|
+
http_status_1.TOO_MANY_REQUESTS
|
|
142
|
+
])
|
|
130
143
|
})];
|
|
131
144
|
case 2:
|
|
132
145
|
paymentService = _b.sent();
|
|
@@ -140,18 +153,22 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
140
153
|
*/
|
|
141
154
|
PaymentService.prototype.authorizeMovieTicket = function (params) {
|
|
142
155
|
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
-
var object, purpose, _a, auth, endpoint, project, seller, chevrePay, paymentService;
|
|
156
|
+
var object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
144
157
|
return __generator(this, function (_b) {
|
|
145
158
|
switch (_b.label) {
|
|
146
159
|
case 0:
|
|
147
160
|
object = params.object, purpose = params.purpose;
|
|
148
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
149
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
161
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
162
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
150
163
|
case 1:
|
|
151
164
|
chevrePay = _b.sent();
|
|
152
165
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
153
166
|
project: project,
|
|
154
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
167
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
168
|
+
retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []), [
|
|
169
|
+
http_status_1.CONFLICT,
|
|
170
|
+
http_status_1.TOO_MANY_REQUESTS
|
|
171
|
+
])
|
|
155
172
|
})];
|
|
156
173
|
case 2:
|
|
157
174
|
paymentService = _b.sent();
|
|
@@ -161,25 +178,30 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
161
178
|
});
|
|
162
179
|
};
|
|
163
180
|
/**
|
|
164
|
-
* 決済ロケーション発行
|
|
181
|
+
* 決済採用(決済ロケーション発行)(非同期)
|
|
165
182
|
*/
|
|
166
|
-
PaymentService.prototype.
|
|
183
|
+
PaymentService.prototype.publishCreditCardPaymentUrlAsync = function (params) {
|
|
167
184
|
return __awaiter(this, void 0, void 0, function () {
|
|
168
|
-
var _a, auth, endpoint, project, seller, chevrePay, paymentService;
|
|
185
|
+
var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
169
186
|
return __generator(this, function (_b) {
|
|
170
187
|
switch (_b.label) {
|
|
171
188
|
case 0:
|
|
172
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
173
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
189
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
190
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
174
191
|
case 1:
|
|
175
192
|
chevrePay = _b.sent();
|
|
176
193
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
177
194
|
project: project,
|
|
178
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
195
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
196
|
+
retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []), [
|
|
197
|
+
http_status_1.CONFLICT,
|
|
198
|
+
http_status_1.GATEWAY_TIMEOUT,
|
|
199
|
+
http_status_1.TOO_MANY_REQUESTS
|
|
200
|
+
])
|
|
179
201
|
})];
|
|
180
202
|
case 2:
|
|
181
203
|
paymentService = _b.sent();
|
|
182
|
-
return [2 /*return*/, paymentService.
|
|
204
|
+
return [2 /*return*/, paymentService.publishCreditCardPaymentUrlAsync(params)];
|
|
183
205
|
}
|
|
184
206
|
});
|
|
185
207
|
});
|
|
@@ -190,19 +212,24 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
190
212
|
PaymentService.prototype.checkMovieTicket = function (params) {
|
|
191
213
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
192
214
|
return __awaiter(this, void 0, void 0, function () {
|
|
193
|
-
var paymentServiceId, paymentMethodType, _j, auth, endpoint, project, seller, chevrePay, paymentService, purpose, checkAction;
|
|
215
|
+
var paymentServiceId, paymentMethodType, _j, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, purpose, checkAction;
|
|
194
216
|
return __generator(this, function (_k) {
|
|
195
217
|
switch (_k.label) {
|
|
196
218
|
case 0:
|
|
197
219
|
paymentServiceId = String((_a = params.object) === null || _a === void 0 ? void 0 : _a.id);
|
|
198
220
|
paymentMethodType = String((_c = (_b = params.object) === null || _b === void 0 ? void 0 : _b.paymentMethod) === null || _c === void 0 ? void 0 : _c.typeOf);
|
|
199
|
-
_j = this.options, auth = _j.auth, endpoint = _j.endpoint, project = _j.project, seller = _j.seller;
|
|
200
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
221
|
+
_j = this.options, auth = _j.auth, endpoint = _j.endpoint, project = _j.project, seller = _j.seller, disableAutoRetry = _j.disableAutoRetry, retryableStatusCodes = _j.retryableStatusCodes;
|
|
222
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
201
223
|
case 1:
|
|
202
224
|
chevrePay = _k.sent();
|
|
203
225
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
204
226
|
project: project,
|
|
205
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
227
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
228
|
+
retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []), [
|
|
229
|
+
http_status_1.CONFLICT,
|
|
230
|
+
http_status_1.GATEWAY_TIMEOUT,
|
|
231
|
+
http_status_1.TOO_MANY_REQUESTS
|
|
232
|
+
])
|
|
206
233
|
})];
|
|
207
234
|
case 2:
|
|
208
235
|
paymentService = _k.sent();
|
|
@@ -245,17 +272,21 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
245
272
|
*/
|
|
246
273
|
PaymentService.prototype.voidAnyPayment = function (params) {
|
|
247
274
|
return __awaiter(this, void 0, void 0, function () {
|
|
248
|
-
var _a, auth, endpoint, project, seller, chevrePay, paymentService;
|
|
275
|
+
var _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
249
276
|
return __generator(this, function (_b) {
|
|
250
277
|
switch (_b.label) {
|
|
251
278
|
case 0:
|
|
252
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
253
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
279
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
280
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
254
281
|
case 1:
|
|
255
282
|
chevrePay = _b.sent();
|
|
256
283
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
257
284
|
project: project,
|
|
258
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
285
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
286
|
+
retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []), [
|
|
287
|
+
http_status_1.CONFLICT,
|
|
288
|
+
http_status_1.TOO_MANY_REQUESTS
|
|
289
|
+
])
|
|
259
290
|
})];
|
|
260
291
|
case 2:
|
|
261
292
|
paymentService = _b.sent();
|
|
@@ -275,18 +306,23 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
275
306
|
*/
|
|
276
307
|
PaymentService.prototype.voidTransaction = function (params) {
|
|
277
308
|
return __awaiter(this, void 0, void 0, function () {
|
|
278
|
-
var id, object, body, _a, auth, endpoint, project, seller, chevrePay, paymentService;
|
|
309
|
+
var id, object, body, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
279
310
|
return __generator(this, function (_b) {
|
|
280
311
|
switch (_b.label) {
|
|
281
312
|
case 0:
|
|
282
313
|
id = params.id, object = params.object, body = __rest(params, ["id", "object"]);
|
|
283
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
284
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
314
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
315
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
285
316
|
case 1:
|
|
286
317
|
chevrePay = _b.sent();
|
|
287
318
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
288
319
|
project: project,
|
|
289
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
320
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
321
|
+
retryableStatusCodes: __spreadArray(__spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : []), [
|
|
322
|
+
http_status_1.CONFLICT,
|
|
323
|
+
http_status_1.GATEWAY_TIMEOUT,
|
|
324
|
+
http_status_1.TOO_MANY_REQUESTS
|
|
325
|
+
])
|
|
290
326
|
})];
|
|
291
327
|
case 2:
|
|
292
328
|
paymentService = _b.sent();
|
|
@@ -307,18 +343,19 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
307
343
|
*/
|
|
308
344
|
PaymentService.prototype.findAuthorizeAction = function (params) {
|
|
309
345
|
return __awaiter(this, void 0, void 0, function () {
|
|
310
|
-
var sameAs, object, purpose, _a, auth, endpoint, project, seller, chevrePay, paymentService;
|
|
346
|
+
var sameAs, object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
311
347
|
return __generator(this, function (_b) {
|
|
312
348
|
switch (_b.label) {
|
|
313
349
|
case 0:
|
|
314
350
|
sameAs = params.sameAs, object = params.object, purpose = params.purpose;
|
|
315
|
-
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller;
|
|
316
|
-
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint })];
|
|
351
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
352
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
317
353
|
case 1:
|
|
318
354
|
chevrePay = _b.sent();
|
|
319
355
|
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
320
356
|
project: project,
|
|
321
|
-
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' }
|
|
357
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
358
|
+
retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [])
|
|
322
359
|
})];
|
|
323
360
|
case 2:
|
|
324
361
|
paymentService = _b.sent();
|
|
@@ -331,6 +368,35 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
331
368
|
});
|
|
332
369
|
});
|
|
333
370
|
};
|
|
371
|
+
/**
|
|
372
|
+
* 決済採用アクション検索
|
|
373
|
+
*/
|
|
374
|
+
PaymentService.prototype.findAcceptPayAction = function (params) {
|
|
375
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
376
|
+
var sameAs, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService;
|
|
377
|
+
return __generator(this, function (_b) {
|
|
378
|
+
switch (_b.label) {
|
|
379
|
+
case 0:
|
|
380
|
+
sameAs = params.sameAs, purpose = params.purpose;
|
|
381
|
+
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
382
|
+
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
383
|
+
case 1:
|
|
384
|
+
chevrePay = _b.sent();
|
|
385
|
+
return [4 /*yield*/, chevrePay.createPaymentInstance({
|
|
386
|
+
project: project,
|
|
387
|
+
seller: { id: (typeof (seller === null || seller === void 0 ? void 0 : seller.id) === 'string') ? seller.id : '' },
|
|
388
|
+
retryableStatusCodes: __spreadArray([], (Array.isArray(retryableStatusCodes)) ? retryableStatusCodes : [])
|
|
389
|
+
})];
|
|
390
|
+
case 2:
|
|
391
|
+
paymentService = _b.sent();
|
|
392
|
+
return [2 /*return*/, paymentService.findAcceptPayAction({
|
|
393
|
+
sameAs: { id: String(sameAs.id) },
|
|
394
|
+
purpose: purpose
|
|
395
|
+
})];
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
};
|
|
334
400
|
return PaymentService;
|
|
335
401
|
}(service_1.Service));
|
|
336
402
|
exports.PaymentService = PaymentService;
|
|
@@ -62,6 +62,13 @@ var defaultPath = '/pay';
|
|
|
62
62
|
*/
|
|
63
63
|
var CloudPay = /** @class */ (function () {
|
|
64
64
|
function CloudPay(options) {
|
|
65
|
+
// 廃止済エンドポイント指定を防止(cloud,cinerino...)
|
|
66
|
+
var isDiscontinuedEndpoint = (new RegExp('cloud|cinerino|dot|appspot')).test(options.endpoint);
|
|
67
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
68
|
+
/* istanbul ignore if */
|
|
69
|
+
if (isDiscontinuedEndpoint) {
|
|
70
|
+
throw new Error('endpoint discontinued');
|
|
71
|
+
}
|
|
65
72
|
this.options = options;
|
|
66
73
|
}
|
|
67
74
|
CloudPay.prototype.createPaymentInstance = function (params) {
|
package/lib/abstract/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type * as Chevre from './chevre';
|
|
|
2
2
|
import type * as ChevreAdmin from './chevreAdmin';
|
|
3
3
|
import type * as ChevreAuth from './chevreAuth';
|
|
4
4
|
import type * as ChevrePay from './chevrePay';
|
|
5
|
+
import type * as ChevreTxc from './chevreTxc';
|
|
5
6
|
import type * as ChevreTxn from './chevreTxn';
|
|
6
7
|
import type { service as Service } from './cinerino/default';
|
|
7
8
|
import type * as Pay from './cinerino/pay';
|
|
@@ -16,11 +17,12 @@ export declare function loadChevreAdmin(...params: ConstructorParameters<typeof
|
|
|
16
17
|
export declare function loadChevreAuth(...params: ConstructorParameters<typeof ChevreAuth.ChevreAuth>): Promise<ChevreAuth.ChevreAuth>;
|
|
17
18
|
export declare function loadChevrePay(...params: ConstructorParameters<typeof ChevrePay.ChevrePay>): Promise<ChevrePay.ChevrePay>;
|
|
18
19
|
export declare function loadChevreTxn(...params: ConstructorParameters<typeof ChevreTxn.ChevreTxn>): Promise<ChevreTxn.ChevreTxn>;
|
|
20
|
+
export declare function loadChevreTxc(...params: ConstructorParameters<typeof ChevreTxc.ChevreTxc>): Promise<ChevreTxc.ChevreTxc>;
|
|
19
21
|
export declare function loadPecorino(): Promise<typeof Pecorino>;
|
|
20
22
|
export declare function loadPay(...params: ConstructorParameters<typeof Pay.Pay>): Promise<Pay.Pay>;
|
|
21
23
|
export declare function loadService(): Promise<typeof Service>;
|
|
22
24
|
export declare function loadCloudAdmin(...params: ConstructorParameters<typeof CloudAdmin.CloudAdmin>): Promise<CloudAdmin.CloudAdmin>;
|
|
23
25
|
export declare function loadCloudPay(...params: ConstructorParameters<typeof CloudPay.CloudPay>): Promise<CloudPay.CloudPay>;
|
|
24
26
|
export declare function loadWaiterAdmin(...params: ConstructorParameters<typeof ChevreAdmin.ChevreAdmin>): Promise<WaiterAdmin.WaiterAdmin>;
|
|
25
|
-
export { factory, Chevre as chevre, ChevreAdmin as chevreAdmin, ChevreAuth as chevreAuth, ChevrePay as chevrePay, ChevreTxn as chevreTxn, CloudAdmin as cloudAdmin, CloudPay as cloudPay, Pecorino as pecorino, Pay as pay, Service as service, WaiterAdmin as waiterAdmin };
|
|
27
|
+
export { factory, Chevre as chevre, ChevreAdmin as chevreAdmin, ChevreAuth as chevreAuth, ChevrePay as chevrePay, ChevreTxc as chevreTxc, ChevreTxn as chevreTxn, CloudAdmin as cloudAdmin, CloudPay as cloudPay, Pecorino as pecorino, Pay as pay, Service as service, WaiterAdmin as waiterAdmin };
|
|
26
28
|
export { transporters };
|
package/lib/abstract/index.js
CHANGED
|
@@ -41,7 +41,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
41
41
|
return to;
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.transporters = exports.factory = exports.loadWaiterAdmin = exports.loadCloudPay = exports.loadCloudAdmin = exports.loadService = exports.loadPay = exports.loadPecorino = exports.loadChevreTxn = exports.loadChevrePay = exports.loadChevreAuth = exports.loadChevreAdmin = exports.loadChevre = void 0;
|
|
44
|
+
exports.transporters = exports.factory = exports.loadWaiterAdmin = exports.loadCloudPay = exports.loadCloudAdmin = exports.loadService = exports.loadPay = exports.loadPecorino = exports.loadChevreTxc = exports.loadChevreTxn = exports.loadChevrePay = exports.loadChevreAuth = exports.loadChevreAdmin = exports.loadChevre = void 0;
|
|
45
45
|
var factory = require("./factory");
|
|
46
46
|
exports.factory = factory;
|
|
47
47
|
var transporters = require("./transporters");
|
|
@@ -161,6 +161,29 @@ function loadChevreTxn() {
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
exports.loadChevreTxn = loadChevreTxn;
|
|
164
|
+
var chevreTxc;
|
|
165
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
166
|
+
/* istanbul ignore next */
|
|
167
|
+
function loadChevreTxc() {
|
|
168
|
+
var params = [];
|
|
169
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
170
|
+
params[_i] = arguments[_i];
|
|
171
|
+
}
|
|
172
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
173
|
+
return __generator(this, function (_a) {
|
|
174
|
+
switch (_a.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
if (!(chevreTxc === undefined)) return [3 /*break*/, 2];
|
|
177
|
+
return [4 /*yield*/, Promise.resolve().then(function () { return require('./chevreTxc'); })];
|
|
178
|
+
case 1:
|
|
179
|
+
chevreTxc = (_a.sent()).ChevreTxc;
|
|
180
|
+
_a.label = 2;
|
|
181
|
+
case 2: return [2 /*return*/, new (chevreTxc.bind.apply(chevreTxc, __spreadArray([void 0], params)))()];
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
exports.loadChevreTxc = loadChevreTxc;
|
|
164
187
|
var pecorino;
|
|
165
188
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
166
189
|
/* istanbul ignore next */
|
package/lib/auth/oAuth2client.js
CHANGED
|
@@ -297,6 +297,7 @@ var OAuth2client = /** @class */ (function () {
|
|
|
297
297
|
error_1 = _c.sent();
|
|
298
298
|
if (!(error_1 instanceof Error)) return [3 /*break*/, 9];
|
|
299
299
|
statusCode = error_1.code;
|
|
300
|
+
debug('retry? numberOfTry:', numberOfTry, 'statusCode: ', statusCode, 'retry: ', retry, 'retryableStatusCodes: ', retryableStatusCodes);
|
|
300
301
|
if (!(retry && retryableStatusCodes.includes(statusCode))) return [3 /*break*/, 9];
|
|
301
302
|
if (!(typeof this.credentials.refresh_token === 'string' && this.credentials.refresh_token.length > 0)) return [3 /*break*/, 7];
|
|
302
303
|
return [4 /*yield*/, this.refreshAccessToken()];
|