@cinerino/sdk 12.7.0-alpha.2 → 12.7.0-alpha.3
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.
|
@@ -37,9 +37,7 @@ export declare class PaymentService extends Service {
|
|
|
37
37
|
authorizeCreditCard(params: {
|
|
38
38
|
object: IAuthorizeCreditCardObject;
|
|
39
39
|
purpose: IPurpose;
|
|
40
|
-
},
|
|
41
|
-
async?: boolean;
|
|
42
|
-
}): Promise<IAuthorizeResult>;
|
|
40
|
+
}, __?: {}): Promise<IAuthorizeResult>;
|
|
43
41
|
/**
|
|
44
42
|
* 決済カード決済承認
|
|
45
43
|
*/
|
|
@@ -48,8 +46,7 @@ export declare class PaymentService extends Service {
|
|
|
48
46
|
ticketToken: string;
|
|
49
47
|
};
|
|
50
48
|
purpose: IPurpose;
|
|
51
|
-
}, options
|
|
52
|
-
async?: boolean;
|
|
49
|
+
}, options: {
|
|
53
50
|
/**
|
|
54
51
|
* 決済カード認証アクションID
|
|
55
52
|
*/
|
|
@@ -154,7 +154,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
154
154
|
/**
|
|
155
155
|
* クレジットカード決済承認
|
|
156
156
|
*/
|
|
157
|
-
PaymentService.prototype.authorizeCreditCard = function (params,
|
|
157
|
+
PaymentService.prototype.authorizeCreditCard = function (params, __) {
|
|
158
158
|
return __awaiter(this, void 0, void 0, function () {
|
|
159
159
|
var object, purpose, amount, issuedThrough, paymentMethod, creditCard, method, paymentMethodId, name, additionalProperty, ticketToken;
|
|
160
160
|
var _this = this;
|
|
@@ -169,8 +169,10 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
169
169
|
object: __assign(__assign(__assign(__assign(__assign(__assign({ amount: amount, issuedThrough: issuedThrough, paymentMethod: paymentMethod }, (creditCard !== undefined && creditCard !== null) ? { creditCard: creditCard } : undefined), (typeof name === 'string') ? { name: name } : undefined), (typeof method === 'string') ? { method: method } : undefined), (typeof paymentMethodId === 'string') ? { paymentMethodId: paymentMethodId } : undefined), (typeof ticketToken === 'string') ? { ticketToken: ticketToken } : undefined), (Array.isArray(additionalProperty)) ? { additionalProperty: additionalProperty } : undefined),
|
|
170
170
|
purpose: purpose
|
|
171
171
|
},
|
|
172
|
-
qs:
|
|
173
|
-
|
|
172
|
+
qs: {
|
|
173
|
+
async: true,
|
|
174
|
+
purpose: { id: purpose.id } // 追加(2024-04-01~)
|
|
175
|
+
}
|
|
174
176
|
})
|
|
175
177
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
176
178
|
return [2 /*return*/, response.json()];
|
|
@@ -183,11 +185,12 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
183
185
|
*/
|
|
184
186
|
PaymentService.prototype.authorizeMovieTicket = function (params, options) {
|
|
185
187
|
return __awaiter(this, void 0, void 0, function () {
|
|
186
|
-
var object, purpose, issuedThrough, paymentMethod, movieTickets, name, additionalProperty, ticketToken;
|
|
188
|
+
var object, purpose, issuedThrough, paymentMethod, movieTickets, name, additionalProperty, ticketToken, checkedActionId;
|
|
187
189
|
var _this = this;
|
|
188
190
|
return __generator(this, function (_a) {
|
|
189
191
|
object = params.object, purpose = params.purpose;
|
|
190
192
|
issuedThrough = object.issuedThrough, paymentMethod = object.paymentMethod, movieTickets = object.movieTickets, name = object.name, additionalProperty = object.additionalProperty, ticketToken = object.ticketToken;
|
|
193
|
+
checkedActionId = options.checkedActionId;
|
|
191
194
|
return [2 /*return*/, this.fetch({
|
|
192
195
|
uri: "/payment/" + factory.service.paymentService.PaymentServiceType.MovieTicket + "/authorize",
|
|
193
196
|
method: 'POST',
|
|
@@ -196,8 +199,11 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
196
199
|
object: __assign(__assign(__assign(__assign({ issuedThrough: issuedThrough, paymentMethod: paymentMethod }, (Array.isArray(movieTickets)) ? { movieTickets: movieTickets } : undefined), (typeof name === 'string') ? { name: name } : undefined), (typeof ticketToken === 'string') ? { ticketToken: ticketToken } : undefined), (Array.isArray(additionalProperty)) ? { additionalProperty: additionalProperty } : undefined),
|
|
197
200
|
purpose: purpose
|
|
198
201
|
},
|
|
199
|
-
qs:
|
|
200
|
-
|
|
202
|
+
qs: {
|
|
203
|
+
checkedActionId: checkedActionId,
|
|
204
|
+
async: true,
|
|
205
|
+
purpose: { id: purpose.id } // 追加(2024-04-01~)
|
|
206
|
+
}
|
|
201
207
|
})
|
|
202
208
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
203
209
|
return [2 /*return*/, response.json()];
|
|
@@ -18,6 +18,11 @@ export declare class PaymentService extends Service {
|
|
|
18
18
|
authorizeCreditCardAsync(params: {
|
|
19
19
|
object: IAuthorizeCreditCardObject;
|
|
20
20
|
purpose: IPurpose;
|
|
21
|
+
}, options?: {
|
|
22
|
+
/**
|
|
23
|
+
* min: 1000 ms
|
|
24
|
+
*/
|
|
25
|
+
intervalAfterIssueTicketInMS?: number;
|
|
21
26
|
}): Promise<{
|
|
22
27
|
/**
|
|
23
28
|
* task ID
|
|
@@ -52,6 +57,11 @@ export declare class PaymentService extends Service {
|
|
|
52
57
|
publishCreditCardPaymentUrlAsync(params: {
|
|
53
58
|
object: IPublishPaymentUrlObject;
|
|
54
59
|
purpose: IPurpose;
|
|
60
|
+
}, options?: {
|
|
61
|
+
/**
|
|
62
|
+
* min: 1000 ms
|
|
63
|
+
*/
|
|
64
|
+
intervalAfterIssueTicketInMS?: number;
|
|
55
65
|
}): Promise<{
|
|
56
66
|
/**
|
|
57
67
|
* task ID
|
|
@@ -83,7 +83,7 @@ var http_status_1 = require("http-status");
|
|
|
83
83
|
var factory = require("../../factory");
|
|
84
84
|
var index_1 = require("../../index");
|
|
85
85
|
var service_1 = require("../../service");
|
|
86
|
-
var
|
|
86
|
+
var MIN_INTERVAL_AFTER_ISSUE_TICKET_MS = 1000;
|
|
87
87
|
var RETRY_ISSUE_TICKET_INTERVAL_MS = 5000;
|
|
88
88
|
function wait(waitInMilliseconds) {
|
|
89
89
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -133,13 +133,14 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
133
133
|
/**
|
|
134
134
|
* クレジットカード決済承認(非同期)
|
|
135
135
|
*/
|
|
136
|
-
PaymentService.prototype.authorizeCreditCardAsync = function (params) {
|
|
136
|
+
PaymentService.prototype.authorizeCreditCardAsync = function (params, options) {
|
|
137
137
|
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
-
var object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
138
|
+
var object, purpose, intervalAfterIssueTicketInMS, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
139
139
|
return __generator(this, function (_b) {
|
|
140
140
|
switch (_b.label) {
|
|
141
141
|
case 0:
|
|
142
142
|
object = params.object, purpose = params.purpose;
|
|
143
|
+
intervalAfterIssueTicketInMS = options === null || options === void 0 ? void 0 : options.intervalAfterIssueTicketInMS;
|
|
143
144
|
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
144
145
|
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
145
146
|
case 1:
|
|
@@ -154,7 +155,10 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
154
155
|
})];
|
|
155
156
|
case 2:
|
|
156
157
|
paymentService = _b.sent();
|
|
157
|
-
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
158
|
+
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
159
|
+
checkPaymentMethodId: true,
|
|
160
|
+
intervalAfterIssueTicketInMS: intervalAfterIssueTicketInMS
|
|
161
|
+
})];
|
|
158
162
|
case 3:
|
|
159
163
|
ticketToken = (_b.sent()).ticketToken;
|
|
160
164
|
return [2 /*return*/, paymentService.authorizeCreditCard({
|
|
@@ -196,7 +200,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
196
200
|
return [2 /*return*/, paymentService.authorizeMovieTicket({
|
|
197
201
|
object: __assign(__assign({}, object), { ticketToken: ticketToken }),
|
|
198
202
|
purpose: purpose
|
|
199
|
-
}, {
|
|
203
|
+
}, { checkedActionId: checkedActionId })];
|
|
200
204
|
}
|
|
201
205
|
});
|
|
202
206
|
});
|
|
@@ -204,13 +208,14 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
204
208
|
/**
|
|
205
209
|
* 決済採用(決済ロケーション発行)(非同期)
|
|
206
210
|
*/
|
|
207
|
-
PaymentService.prototype.publishCreditCardPaymentUrlAsync = function (params) {
|
|
211
|
+
PaymentService.prototype.publishCreditCardPaymentUrlAsync = function (params, options) {
|
|
208
212
|
return __awaiter(this, void 0, void 0, function () {
|
|
209
|
-
var object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
213
|
+
var object, purpose, intervalAfterIssueTicketInMS, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
210
214
|
return __generator(this, function (_b) {
|
|
211
215
|
switch (_b.label) {
|
|
212
216
|
case 0:
|
|
213
217
|
object = params.object, purpose = params.purpose;
|
|
218
|
+
intervalAfterIssueTicketInMS = options === null || options === void 0 ? void 0 : options.intervalAfterIssueTicketInMS;
|
|
214
219
|
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
215
220
|
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
216
221
|
case 1:
|
|
@@ -226,7 +231,10 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
226
231
|
})];
|
|
227
232
|
case 2:
|
|
228
233
|
paymentService = _b.sent();
|
|
229
|
-
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
234
|
+
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
235
|
+
checkPaymentMethodId: false,
|
|
236
|
+
intervalAfterIssueTicketInMS: intervalAfterIssueTicketInMS
|
|
237
|
+
})];
|
|
230
238
|
case 3:
|
|
231
239
|
ticketToken = (_b.sent()).ticketToken;
|
|
232
240
|
return [2 /*return*/, paymentService.publishCreditCardPaymentUrlAsync({
|
|
@@ -654,12 +662,16 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
654
662
|
};
|
|
655
663
|
PaymentService.prototype.issueTicketThroughCreditCardIfNotExists = function (params, options) {
|
|
656
664
|
return __awaiter(this, void 0, void 0, function () {
|
|
657
|
-
var object, purpose, checkPaymentMethodId, issueForcibly, ticketToken, paymentMethodId, automaticallyIssuedTicket;
|
|
665
|
+
var object, purpose, checkPaymentMethodId, intervalAfterIssueTicketInMS, issueForcibly, ticketToken, paymentMethodId, automaticallyIssuedTicket;
|
|
658
666
|
return __generator(this, function (_a) {
|
|
659
667
|
switch (_a.label) {
|
|
660
668
|
case 0:
|
|
661
669
|
object = params.object, purpose = params.purpose;
|
|
662
670
|
checkPaymentMethodId = options.checkPaymentMethodId;
|
|
671
|
+
intervalAfterIssueTicketInMS = (typeof options.intervalAfterIssueTicketInMS === 'number'
|
|
672
|
+
&& options.intervalAfterIssueTicketInMS > MIN_INTERVAL_AFTER_ISSUE_TICKET_MS)
|
|
673
|
+
? options.intervalAfterIssueTicketInMS
|
|
674
|
+
: MIN_INTERVAL_AFTER_ISSUE_TICKET_MS;
|
|
663
675
|
issueForcibly = false;
|
|
664
676
|
ticketToken = object.ticketToken;
|
|
665
677
|
paymentMethodId = object.paymentMethodId;
|
|
@@ -686,7 +698,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
686
698
|
case 1:
|
|
687
699
|
automaticallyIssuedTicket = _a.sent();
|
|
688
700
|
// n秒待機
|
|
689
|
-
return [4 /*yield*/, wait(
|
|
701
|
+
return [4 /*yield*/, wait(intervalAfterIssueTicketInMS)];
|
|
690
702
|
case 2:
|
|
691
703
|
// n秒待機
|
|
692
704
|
_a.sent();
|
package/lib/bundle.js
CHANGED
|
@@ -18136,7 +18136,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
18136
18136
|
/**
|
|
18137
18137
|
* クレジットカード決済承認
|
|
18138
18138
|
*/
|
|
18139
|
-
PaymentService.prototype.authorizeCreditCard = function (params,
|
|
18139
|
+
PaymentService.prototype.authorizeCreditCard = function (params, __) {
|
|
18140
18140
|
return __awaiter(this, void 0, void 0, function () {
|
|
18141
18141
|
var object, purpose, amount, issuedThrough, paymentMethod, creditCard, method, paymentMethodId, name, additionalProperty, ticketToken;
|
|
18142
18142
|
var _this = this;
|
|
@@ -18151,8 +18151,10 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
18151
18151
|
object: __assign(__assign(__assign(__assign(__assign(__assign({ amount: amount, issuedThrough: issuedThrough, paymentMethod: paymentMethod }, (creditCard !== undefined && creditCard !== null) ? { creditCard: creditCard } : undefined), (typeof name === 'string') ? { name: name } : undefined), (typeof method === 'string') ? { method: method } : undefined), (typeof paymentMethodId === 'string') ? { paymentMethodId: paymentMethodId } : undefined), (typeof ticketToken === 'string') ? { ticketToken: ticketToken } : undefined), (Array.isArray(additionalProperty)) ? { additionalProperty: additionalProperty } : undefined),
|
|
18152
18152
|
purpose: purpose
|
|
18153
18153
|
},
|
|
18154
|
-
qs:
|
|
18155
|
-
|
|
18154
|
+
qs: {
|
|
18155
|
+
async: true,
|
|
18156
|
+
purpose: { id: purpose.id } // 追加(2024-04-01~)
|
|
18157
|
+
}
|
|
18156
18158
|
})
|
|
18157
18159
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
18158
18160
|
return [2 /*return*/, response.json()];
|
|
@@ -18165,11 +18167,12 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
18165
18167
|
*/
|
|
18166
18168
|
PaymentService.prototype.authorizeMovieTicket = function (params, options) {
|
|
18167
18169
|
return __awaiter(this, void 0, void 0, function () {
|
|
18168
|
-
var object, purpose, issuedThrough, paymentMethod, movieTickets, name, additionalProperty, ticketToken;
|
|
18170
|
+
var object, purpose, issuedThrough, paymentMethod, movieTickets, name, additionalProperty, ticketToken, checkedActionId;
|
|
18169
18171
|
var _this = this;
|
|
18170
18172
|
return __generator(this, function (_a) {
|
|
18171
18173
|
object = params.object, purpose = params.purpose;
|
|
18172
18174
|
issuedThrough = object.issuedThrough, paymentMethod = object.paymentMethod, movieTickets = object.movieTickets, name = object.name, additionalProperty = object.additionalProperty, ticketToken = object.ticketToken;
|
|
18175
|
+
checkedActionId = options.checkedActionId;
|
|
18173
18176
|
return [2 /*return*/, this.fetch({
|
|
18174
18177
|
uri: "/payment/" + factory.service.paymentService.PaymentServiceType.MovieTicket + "/authorize",
|
|
18175
18178
|
method: 'POST',
|
|
@@ -18178,8 +18181,11 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
18178
18181
|
object: __assign(__assign(__assign(__assign({ issuedThrough: issuedThrough, paymentMethod: paymentMethod }, (Array.isArray(movieTickets)) ? { movieTickets: movieTickets } : undefined), (typeof name === 'string') ? { name: name } : undefined), (typeof ticketToken === 'string') ? { ticketToken: ticketToken } : undefined), (Array.isArray(additionalProperty)) ? { additionalProperty: additionalProperty } : undefined),
|
|
18179
18182
|
purpose: purpose
|
|
18180
18183
|
},
|
|
18181
|
-
qs:
|
|
18182
|
-
|
|
18184
|
+
qs: {
|
|
18185
|
+
checkedActionId: checkedActionId,
|
|
18186
|
+
async: true,
|
|
18187
|
+
purpose: { id: purpose.id } // 追加(2024-04-01~)
|
|
18188
|
+
}
|
|
18183
18189
|
})
|
|
18184
18190
|
.then(function (response) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
18185
18191
|
return [2 /*return*/, response.json()];
|
|
@@ -24069,7 +24075,7 @@ var http_status_1 = require("http-status");
|
|
|
24069
24075
|
var factory = require("../../factory");
|
|
24070
24076
|
var index_1 = require("../../index");
|
|
24071
24077
|
var service_1 = require("../../service");
|
|
24072
|
-
var
|
|
24078
|
+
var MIN_INTERVAL_AFTER_ISSUE_TICKET_MS = 1000;
|
|
24073
24079
|
var RETRY_ISSUE_TICKET_INTERVAL_MS = 5000;
|
|
24074
24080
|
function wait(waitInMilliseconds) {
|
|
24075
24081
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -24119,13 +24125,14 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
24119
24125
|
/**
|
|
24120
24126
|
* クレジットカード決済承認(非同期)
|
|
24121
24127
|
*/
|
|
24122
|
-
PaymentService.prototype.authorizeCreditCardAsync = function (params) {
|
|
24128
|
+
PaymentService.prototype.authorizeCreditCardAsync = function (params, options) {
|
|
24123
24129
|
return __awaiter(this, void 0, void 0, function () {
|
|
24124
|
-
var object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
24130
|
+
var object, purpose, intervalAfterIssueTicketInMS, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
24125
24131
|
return __generator(this, function (_b) {
|
|
24126
24132
|
switch (_b.label) {
|
|
24127
24133
|
case 0:
|
|
24128
24134
|
object = params.object, purpose = params.purpose;
|
|
24135
|
+
intervalAfterIssueTicketInMS = options === null || options === void 0 ? void 0 : options.intervalAfterIssueTicketInMS;
|
|
24129
24136
|
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
24130
24137
|
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
24131
24138
|
case 1:
|
|
@@ -24140,7 +24147,10 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
24140
24147
|
})];
|
|
24141
24148
|
case 2:
|
|
24142
24149
|
paymentService = _b.sent();
|
|
24143
|
-
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
24150
|
+
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
24151
|
+
checkPaymentMethodId: true,
|
|
24152
|
+
intervalAfterIssueTicketInMS: intervalAfterIssueTicketInMS
|
|
24153
|
+
})];
|
|
24144
24154
|
case 3:
|
|
24145
24155
|
ticketToken = (_b.sent()).ticketToken;
|
|
24146
24156
|
return [2 /*return*/, paymentService.authorizeCreditCard({
|
|
@@ -24182,7 +24192,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
24182
24192
|
return [2 /*return*/, paymentService.authorizeMovieTicket({
|
|
24183
24193
|
object: __assign(__assign({}, object), { ticketToken: ticketToken }),
|
|
24184
24194
|
purpose: purpose
|
|
24185
|
-
}, {
|
|
24195
|
+
}, { checkedActionId: checkedActionId })];
|
|
24186
24196
|
}
|
|
24187
24197
|
});
|
|
24188
24198
|
});
|
|
@@ -24190,13 +24200,14 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
24190
24200
|
/**
|
|
24191
24201
|
* 決済採用(決済ロケーション発行)(非同期)
|
|
24192
24202
|
*/
|
|
24193
|
-
PaymentService.prototype.publishCreditCardPaymentUrlAsync = function (params) {
|
|
24203
|
+
PaymentService.prototype.publishCreditCardPaymentUrlAsync = function (params, options) {
|
|
24194
24204
|
return __awaiter(this, void 0, void 0, function () {
|
|
24195
|
-
var object, purpose, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
24205
|
+
var object, purpose, intervalAfterIssueTicketInMS, _a, auth, endpoint, project, seller, disableAutoRetry, retryableStatusCodes, chevrePay, paymentService, ticketToken;
|
|
24196
24206
|
return __generator(this, function (_b) {
|
|
24197
24207
|
switch (_b.label) {
|
|
24198
24208
|
case 0:
|
|
24199
24209
|
object = params.object, purpose = params.purpose;
|
|
24210
|
+
intervalAfterIssueTicketInMS = options === null || options === void 0 ? void 0 : options.intervalAfterIssueTicketInMS;
|
|
24200
24211
|
_a = this.options, auth = _a.auth, endpoint = _a.endpoint, project = _a.project, seller = _a.seller, disableAutoRetry = _a.disableAutoRetry, retryableStatusCodes = _a.retryableStatusCodes;
|
|
24201
24212
|
return [4 /*yield*/, index_1.loadChevrePay({ auth: auth, endpoint: endpoint, disableAutoRetry: disableAutoRetry })];
|
|
24202
24213
|
case 1:
|
|
@@ -24212,7 +24223,10 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
24212
24223
|
})];
|
|
24213
24224
|
case 2:
|
|
24214
24225
|
paymentService = _b.sent();
|
|
24215
|
-
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
24226
|
+
return [4 /*yield*/, this.issueTicketThroughCreditCardIfNotExists({ object: object, purpose: purpose }, {
|
|
24227
|
+
checkPaymentMethodId: false,
|
|
24228
|
+
intervalAfterIssueTicketInMS: intervalAfterIssueTicketInMS
|
|
24229
|
+
})];
|
|
24216
24230
|
case 3:
|
|
24217
24231
|
ticketToken = (_b.sent()).ticketToken;
|
|
24218
24232
|
return [2 /*return*/, paymentService.publishCreditCardPaymentUrlAsync({
|
|
@@ -24640,12 +24654,16 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
24640
24654
|
};
|
|
24641
24655
|
PaymentService.prototype.issueTicketThroughCreditCardIfNotExists = function (params, options) {
|
|
24642
24656
|
return __awaiter(this, void 0, void 0, function () {
|
|
24643
|
-
var object, purpose, checkPaymentMethodId, issueForcibly, ticketToken, paymentMethodId, automaticallyIssuedTicket;
|
|
24657
|
+
var object, purpose, checkPaymentMethodId, intervalAfterIssueTicketInMS, issueForcibly, ticketToken, paymentMethodId, automaticallyIssuedTicket;
|
|
24644
24658
|
return __generator(this, function (_a) {
|
|
24645
24659
|
switch (_a.label) {
|
|
24646
24660
|
case 0:
|
|
24647
24661
|
object = params.object, purpose = params.purpose;
|
|
24648
24662
|
checkPaymentMethodId = options.checkPaymentMethodId;
|
|
24663
|
+
intervalAfterIssueTicketInMS = (typeof options.intervalAfterIssueTicketInMS === 'number'
|
|
24664
|
+
&& options.intervalAfterIssueTicketInMS > MIN_INTERVAL_AFTER_ISSUE_TICKET_MS)
|
|
24665
|
+
? options.intervalAfterIssueTicketInMS
|
|
24666
|
+
: MIN_INTERVAL_AFTER_ISSUE_TICKET_MS;
|
|
24649
24667
|
issueForcibly = false;
|
|
24650
24668
|
ticketToken = object.ticketToken;
|
|
24651
24669
|
paymentMethodId = object.paymentMethodId;
|
|
@@ -24672,7 +24690,7 @@ var PaymentService = /** @class */ (function (_super) {
|
|
|
24672
24690
|
case 1:
|
|
24673
24691
|
automaticallyIssuedTicket = _a.sent();
|
|
24674
24692
|
// n秒待機
|
|
24675
|
-
return [4 /*yield*/, wait(
|
|
24693
|
+
return [4 /*yield*/, wait(intervalAfterIssueTicketInMS)];
|
|
24676
24694
|
case 2:
|
|
24677
24695
|
// n秒待機
|
|
24678
24696
|
_a.sent();
|