@alipay/ams-checkout 0.0.1757298389-dev.0 → 0.0.1757298389-dev.2
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/dist/umd/ams-checkout.min.js +1 -1
- package/esm/core/component/element/elementController/index.d.ts +9 -0
- package/esm/core/component/element/elementController/index.js +177 -93
- package/esm/core/component/element/index.d.ts +3 -0
- package/esm/core/component/element/index.js +5 -0
- package/esm/core/component/element/type.d.ts +4 -2
- package/esm/core/component/element/type.js +3 -1
- package/package.json +1 -1
@@ -6,6 +6,7 @@ declare class ElementController {
|
|
6
6
|
private loading;
|
7
7
|
private elementProcessors;
|
8
8
|
private initTimeout;
|
9
|
+
private processingSubmitPay;
|
9
10
|
private elementContainerService;
|
10
11
|
private onStatusChangeCallback;
|
11
12
|
constructor(options: IElementOptions);
|
@@ -14,6 +15,14 @@ declare class ElementController {
|
|
14
15
|
private onEventCallback;
|
15
16
|
mount(renderOptions: LinkAuthMountOptions | AddressMountOptions | PaymentMountOptions, sdkSelector: string): any;
|
16
17
|
private onValidateFunc;
|
18
|
+
private onValidateAndSubmitPay;
|
19
|
+
/**
|
20
|
+
* 25/09/08 新增商户主动校验api
|
21
|
+
* @returns {Promise<{isValid: boolean}>}
|
22
|
+
*/
|
23
|
+
validateFields(): Promise<{
|
24
|
+
isValid: boolean;
|
25
|
+
}>;
|
17
26
|
submitPayment(): void;
|
18
27
|
private changeLoading;
|
19
28
|
private addEventListener;
|
@@ -46,13 +46,29 @@ var ElementController = /*#__PURE__*/function () {
|
|
46
46
|
_defineProperty(this, "loading", void 0);
|
47
47
|
_defineProperty(this, "elementProcessors", void 0);
|
48
48
|
_defineProperty(this, "initTimeout", void 0);
|
49
|
+
_defineProperty(this, "processingSubmitPay", void 0);
|
50
|
+
// 支付中
|
49
51
|
_defineProperty(this, "elementContainerService", void 0);
|
50
52
|
// 新增变量
|
51
53
|
_defineProperty(this, "onStatusChangeCallback", void 0);
|
52
|
-
_defineProperty(this, "onValidateFunc", function (event, target
|
54
|
+
_defineProperty(this, "onValidateFunc", function (event, target) {
|
53
55
|
return new Promise(function (resolve) {
|
54
56
|
event.emitAndListen({
|
55
57
|
event: ElementPaymentEvent.VALIDATE,
|
58
|
+
data: {
|
59
|
+
params: {},
|
60
|
+
target: target,
|
61
|
+
source: ElementPaymentMethod.CONTAINER_ELEMENT
|
62
|
+
}
|
63
|
+
}, function (result) {
|
64
|
+
resolve(result);
|
65
|
+
});
|
66
|
+
});
|
67
|
+
});
|
68
|
+
_defineProperty(this, "onValidateAndSubmitPay", function (event, target, params) {
|
69
|
+
return new Promise(function (resolve) {
|
70
|
+
event.emitAndListen({
|
71
|
+
event: ElementPaymentEvent.SUBMIT_PAY,
|
56
72
|
data: {
|
57
73
|
params: _objectSpread({}, params),
|
58
74
|
target: target,
|
@@ -65,6 +81,7 @@ var ElementController = /*#__PURE__*/function () {
|
|
65
81
|
});
|
66
82
|
this.options = options;
|
67
83
|
var _options = options;
|
84
|
+
this.processingSubmitPay = false;
|
68
85
|
this.onStatusChangeCallback = _options === null || _options === void 0 ? void 0 : _options.onStatusChangeCallback;
|
69
86
|
this.elementContainer = new AntomSDKCore();
|
70
87
|
this.elementContainer.registerProcessor(ProductSceneEnum.ELEMENT_PAYMENT, '', new ElementProcessor());
|
@@ -188,75 +205,139 @@ var ElementController = /*#__PURE__*/function () {
|
|
188
205
|
});
|
189
206
|
}
|
190
207
|
}, {
|
191
|
-
key: "
|
192
|
-
value:
|
208
|
+
key: "validateFields",
|
209
|
+
value:
|
210
|
+
/**
|
211
|
+
* 25/09/08 新增商户主动校验api
|
212
|
+
* @returns {Promise<{isValid: boolean}>}
|
213
|
+
*/
|
214
|
+
function validateFields() {
|
193
215
|
var _this3 = this;
|
194
|
-
|
195
|
-
new Promise( /*#__PURE__*/function () {
|
216
|
+
return new Promise( /*#__PURE__*/function () {
|
196
217
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resolve) {
|
197
|
-
var
|
218
|
+
var _this3$elementProcess;
|
219
|
+
var _this3$elementProcess2, validateResult;
|
198
220
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
199
221
|
while (1) switch (_context.prev = _context.next) {
|
222
|
+
case 0:
|
223
|
+
if (!_this3.processingSubmitPay) {
|
224
|
+
_context.next = 4;
|
225
|
+
break;
|
226
|
+
}
|
227
|
+
return _context.abrupt("return", resolve({
|
228
|
+
isValid: false
|
229
|
+
}));
|
230
|
+
case 4:
|
231
|
+
if (!((_this3$elementProcess = _this3.elementProcessors) !== null && _this3$elementProcess !== void 0 && _this3$elementProcess[ElementType.payment])) {
|
232
|
+
_context.next = 17;
|
233
|
+
break;
|
234
|
+
}
|
235
|
+
_context.prev = 5;
|
236
|
+
_context.next = 8;
|
237
|
+
return _this3.onValidateFunc((_this3$elementProcess2 = _this3.elementProcessors[ElementType.payment]) === null || _this3$elementProcess2 === void 0 ? void 0 : _this3$elementProcess2.eventCenter, ElementPaymentMethod.PAYMENT_ELEMENT);
|
238
|
+
case 8:
|
239
|
+
validateResult = _context.sent;
|
240
|
+
return _context.abrupt("return", resolve({
|
241
|
+
isValid: validateResult.data.success
|
242
|
+
}));
|
243
|
+
case 12:
|
244
|
+
_context.prev = 12;
|
245
|
+
_context.t0 = _context["catch"](5);
|
246
|
+
return _context.abrupt("return", resolve({
|
247
|
+
isValid: false
|
248
|
+
}));
|
249
|
+
case 15:
|
250
|
+
_context.next = 18;
|
251
|
+
break;
|
252
|
+
case 17:
|
253
|
+
return _context.abrupt("return", resolve({
|
254
|
+
isValid: false
|
255
|
+
}));
|
256
|
+
case 18:
|
257
|
+
case "end":
|
258
|
+
return _context.stop();
|
259
|
+
}
|
260
|
+
}, _callee, null, [[5, 12]]);
|
261
|
+
}));
|
262
|
+
return function (_x) {
|
263
|
+
return _ref2.apply(this, arguments);
|
264
|
+
};
|
265
|
+
}());
|
266
|
+
}
|
267
|
+
}, {
|
268
|
+
key: "submitPayment",
|
269
|
+
value: function submitPayment() {
|
270
|
+
var _this4 = this;
|
271
|
+
this.changeLoading(true);
|
272
|
+
new Promise( /*#__PURE__*/function () {
|
273
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve) {
|
274
|
+
var params, _this4$elementProcess, _result$data, _result$data2, result, _this4$elementProcess2, _result$data3, _result$data4, _result, _this4$elementProcess3, _paymentSubmitResult$, paymentSubmitResult;
|
275
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
276
|
+
while (1) switch (_context2.prev = _context2.next) {
|
200
277
|
case 0:
|
201
278
|
params = {};
|
202
|
-
if (!
|
203
|
-
|
279
|
+
if (!_this4.elementProcessors[ElementType.auth]) {
|
280
|
+
_context2.next = 8;
|
204
281
|
break;
|
205
282
|
}
|
206
|
-
|
207
|
-
return
|
283
|
+
_context2.next = 4;
|
284
|
+
return _this4.onValidateAndSubmitPay((_this4$elementProcess = _this4.elementProcessors[ElementType.auth]) === null || _this4$elementProcess === void 0 ? void 0 : _this4$elementProcess.eventCenter, ElementPaymentMethod.AUTH_ELEMENT);
|
208
285
|
case 4:
|
209
|
-
result =
|
286
|
+
result = _context2.sent;
|
210
287
|
params.accountInfo = (_result$data = result.data) === null || _result$data === void 0 || (_result$data = _result$data.data) === null || _result$data === void 0 ? void 0 : _result$data.accountInfo;
|
211
288
|
if (result !== null && result !== void 0 && (_result$data2 = result.data) !== null && _result$data2 !== void 0 && _result$data2.success) {
|
212
|
-
|
289
|
+
_context2.next = 8;
|
213
290
|
break;
|
214
291
|
}
|
215
|
-
return
|
292
|
+
return _context2.abrupt("return", resolve(undefined));
|
216
293
|
case 8:
|
217
|
-
if (!
|
218
|
-
|
294
|
+
if (!_this4.elementProcessors[ElementType.address]) {
|
295
|
+
_context2.next = 15;
|
219
296
|
break;
|
220
297
|
}
|
221
|
-
|
222
|
-
return
|
298
|
+
_context2.next = 11;
|
299
|
+
return _this4.onValidateAndSubmitPay((_this4$elementProcess2 = _this4.elementProcessors[ElementType.address]) === null || _this4$elementProcess2 === void 0 ? void 0 : _this4$elementProcess2.eventCenter, ElementPaymentMethod.ADDRESS_ELEMENT);
|
223
300
|
case 11:
|
224
|
-
_result =
|
301
|
+
_result = _context2.sent;
|
225
302
|
params.shipping = (_result$data3 = _result.data) === null || _result$data3 === void 0 ? void 0 : _result$data3.data;
|
226
303
|
if (_result !== null && _result !== void 0 && (_result$data4 = _result.data) !== null && _result$data4 !== void 0 && _result$data4.success) {
|
227
|
-
|
304
|
+
_context2.next = 15;
|
228
305
|
break;
|
229
306
|
}
|
230
|
-
return
|
307
|
+
return _context2.abrupt("return", resolve(undefined));
|
231
308
|
case 15:
|
232
|
-
if (!
|
233
|
-
|
309
|
+
if (!_this4.elementProcessors[ElementType.payment]) {
|
310
|
+
_context2.next = 29;
|
234
311
|
break;
|
235
312
|
}
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
return _context.abrupt("return", resolve(undefined));
|
313
|
+
_context2.prev = 16;
|
314
|
+
_this4.processingSubmitPay = true;
|
315
|
+
_context2.next = 20;
|
316
|
+
return _this4.onValidateAndSubmitPay((_this4$elementProcess3 = _this4.elementProcessors[ElementType.payment]) === null || _this4$elementProcess3 === void 0 ? void 0 : _this4$elementProcess3.eventCenter, ElementPaymentMethod.PAYMENT_ELEMENT, params);
|
317
|
+
case 20:
|
318
|
+
paymentSubmitResult = _context2.sent;
|
319
|
+
_this4.processingSubmitPay = paymentSubmitResult === null || paymentSubmitResult === void 0 || (_paymentSubmitResult$ = paymentSubmitResult.data) === null || _paymentSubmitResult$ === void 0 ? void 0 : _paymentSubmitResult$.success;
|
320
|
+
return _context2.abrupt("return", resolve(undefined));
|
245
321
|
case 25:
|
322
|
+
_context2.prev = 25;
|
323
|
+
_context2.t0 = _context2["catch"](16);
|
324
|
+
_this4.processingSubmitPay = false;
|
325
|
+
return _context2.abrupt("return", resolve(undefined));
|
326
|
+
case 29:
|
246
327
|
resolve(params);
|
247
|
-
case
|
328
|
+
case 30:
|
248
329
|
case "end":
|
249
|
-
return
|
330
|
+
return _context2.stop();
|
250
331
|
}
|
251
|
-
},
|
332
|
+
}, _callee2, null, [[16, 25]]);
|
252
333
|
}));
|
253
|
-
return function (
|
254
|
-
return
|
334
|
+
return function (_x2) {
|
335
|
+
return _ref3.apply(this, arguments);
|
255
336
|
};
|
256
337
|
}()).then(function () {
|
257
|
-
|
338
|
+
_this4.changeLoading(false);
|
258
339
|
}, function () {
|
259
|
-
|
340
|
+
_this4.changeLoading(false);
|
260
341
|
});
|
261
342
|
}
|
262
343
|
}, {
|
@@ -281,21 +362,24 @@ var ElementController = /*#__PURE__*/function () {
|
|
281
362
|
}, {
|
282
363
|
key: "addEventListener",
|
283
364
|
value: function addEventListener(renderCallback) {
|
284
|
-
var
|
365
|
+
var _this5 = this;
|
285
366
|
this.serviceMap.EventCenter.listen(ElementPaymentEvent.ON_EVENT_CALLBACK, function (data) {
|
286
|
-
var
|
287
|
-
(
|
367
|
+
var _this5$onEventCallbac;
|
368
|
+
(_this5$onEventCallbac = _this5.onEventCallback) === null || _this5$onEventCallbac === void 0 || _this5$onEventCallbac.call(_this5, data);
|
369
|
+
});
|
370
|
+
this.serviceMap.EventCenter.listen(ElementPaymentEvent.ON_PAY_STATUS_CHANGE, function (data) {
|
371
|
+
_this5.processingSubmitPay = data.isProcessingPay;
|
288
372
|
});
|
289
373
|
this.serviceMap.EventCenter.listen(EVENT.sizeChanged.name, function (data) {
|
290
|
-
clearTimeout(
|
291
|
-
|
292
|
-
if (
|
374
|
+
clearTimeout(_this5.initTimeout);
|
375
|
+
_this5.initTimeout = null;
|
376
|
+
if (_this5.elementContainerService.getContainerService(data.source)) {
|
293
377
|
renderCallback({
|
294
378
|
success: true
|
295
379
|
});
|
296
|
-
|
380
|
+
_this5.elementContainerService.getContainerService(data.source).switchContainerStatus(IContainerStatus.IN_BIZ_FLOW);
|
297
381
|
}
|
298
|
-
|
382
|
+
_this5.changeLoading(false);
|
299
383
|
// 遍历containerService中的所有container查看是否所有状态都是IN_BIZ_FLOW
|
300
384
|
// const allContainersInBizFlow = Object.values(this.elementContainerService.getContainerServices()).every(
|
301
385
|
// (containerService) => containerService.getContainerStatus() === IContainerStatus.IN_BIZ_FLOW,
|
@@ -305,22 +389,22 @@ var ElementController = /*#__PURE__*/function () {
|
|
305
389
|
// }
|
306
390
|
});
|
307
391
|
this.serviceMap.EventCenter.listen(EVENT.redirect.name, function (data) {
|
308
|
-
var onEventCallback =
|
392
|
+
var onEventCallback = _this5.onEventCallback.bind(_this5);
|
309
393
|
handleRedirect(data, false, onEventCallback);
|
310
394
|
});
|
311
395
|
this.serviceMap.EventCenter.listen(EVENT.destroy.name, function () {
|
312
|
-
|
313
|
-
|
396
|
+
_this5.setControllerStatusOrView(IElementStatus.READY);
|
397
|
+
_this5.destroyHandle();
|
314
398
|
});
|
315
399
|
this.serviceMap.EventCenter.listen(EVENT.webAppReady.name, function (data) {
|
316
|
-
clearTimeout(
|
317
|
-
if (
|
400
|
+
clearTimeout(_this5.initTimeout);
|
401
|
+
if (_this5.elementContainerService.getContainerService(data.source)) {
|
318
402
|
renderCallback({
|
319
403
|
success: true
|
320
404
|
});
|
321
|
-
|
405
|
+
_this5.elementContainerService.getContainerService(data.source).switchContainerStatus(IContainerStatus.IN_BIZ_FLOW);
|
322
406
|
}
|
323
|
-
|
407
|
+
_this5.changeLoading(false);
|
324
408
|
});
|
325
409
|
this.serviceMap.EventCenter.listen(EVENT.showToast.name, function (data) {
|
326
410
|
showToast(data);
|
@@ -328,8 +412,8 @@ var ElementController = /*#__PURE__*/function () {
|
|
328
412
|
this.serviceMap.EventCenter.listen(EVENT.messageForward.name, function (data) {
|
329
413
|
var source = MountElementType[data.source];
|
330
414
|
var target = MountElementType[data.target];
|
331
|
-
if (
|
332
|
-
|
415
|
+
if (_this5.elementProcessors[source] && _this5.elementProcessors[target]) {
|
416
|
+
_this5.elementProcessors[target].eventCenter.dispatchToApp({
|
333
417
|
event: data.event,
|
334
418
|
data: data
|
335
419
|
});
|
@@ -339,24 +423,24 @@ var ElementController = /*#__PURE__*/function () {
|
|
339
423
|
}, {
|
340
424
|
key: "sendRequestAndWaitWebLaunch",
|
341
425
|
value: function sendRequestAndWaitWebLaunch(renderOptions) {
|
342
|
-
var
|
426
|
+
var _this6 = this;
|
343
427
|
var type = renderOptions.type,
|
344
428
|
options = _objectWithoutProperties(renderOptions, _excluded);
|
345
429
|
var webLaunchPromise = this.elementContainerService.getContainerService(type).createWebLaunchPromise();
|
346
|
-
Promise.all([webLaunchPromise, this.elementProcessors[type].obtainData()]).then(function (
|
347
|
-
var
|
348
|
-
var
|
349
|
-
_webLaunchRes =
|
350
|
-
_obtainDataRes =
|
351
|
-
(
|
430
|
+
Promise.all([webLaunchPromise, this.elementProcessors[type].obtainData()]).then(function (_ref4) {
|
431
|
+
var _this6$elementContain;
|
432
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
433
|
+
_webLaunchRes = _ref5[0],
|
434
|
+
_obtainDataRes = _ref5[1];
|
435
|
+
(_this6$elementContain = _this6.elementContainerService.getContainerService(type)) === null || _this6$elementContain === void 0 || _this6$elementContain.switchContainerStatus(IContainerStatus.READY);
|
352
436
|
var allReady = true;
|
353
|
-
|
437
|
+
_this6.elementContainerService.getContainerServices().forEach(function (item) {
|
354
438
|
if (!allReady) return;
|
355
439
|
allReady = item.getContainerStatus() === IContainerStatus.READY;
|
356
440
|
});
|
357
441
|
if (allReady) {
|
358
|
-
|
359
|
-
|
442
|
+
_this6.elementContainerService.getContainerServices().forEach(function (value, key) {
|
443
|
+
_this6.sendReady(key, options);
|
360
444
|
});
|
361
445
|
}
|
362
446
|
});
|
@@ -392,37 +476,37 @@ var ElementController = /*#__PURE__*/function () {
|
|
392
476
|
}, {
|
393
477
|
key: "updatePayment",
|
394
478
|
value: function () {
|
395
|
-
var _updatePayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
396
|
-
var
|
397
|
-
return _regeneratorRuntime().wrap(function
|
398
|
-
while (1) switch (
|
479
|
+
var _updatePayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(paymentSessionData) {
|
480
|
+
var _this7 = this;
|
481
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
482
|
+
while (1) switch (_context4.prev = _context4.next) {
|
399
483
|
case 0:
|
400
|
-
return
|
401
|
-
var
|
484
|
+
return _context4.abrupt("return", new Promise( /*#__PURE__*/function () {
|
485
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
|
402
486
|
var prePaymentSessionData, data, LOCAL_MOCK;
|
403
|
-
return _regeneratorRuntime().wrap(function
|
404
|
-
while (1) switch (
|
487
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
488
|
+
while (1) switch (_context3.prev = _context3.next) {
|
405
489
|
case 0:
|
406
490
|
if (checkCanUpdate({
|
407
|
-
status:
|
408
|
-
paymentContainerService:
|
491
|
+
status: _this7.elementContainer.getStatus(),
|
492
|
+
paymentContainerService: _this7.elementContainerService.getContainerService(ElementType.payment),
|
409
493
|
newPaymentSessionData: paymentSessionData,
|
410
|
-
oldPaymentSessionData:
|
494
|
+
oldPaymentSessionData: _this7.options.sessionData
|
411
495
|
})) {
|
412
|
-
|
496
|
+
_context3.next = 2;
|
413
497
|
break;
|
414
498
|
}
|
415
|
-
return
|
499
|
+
return _context3.abrupt("return", resolve(false));
|
416
500
|
case 2:
|
417
|
-
prePaymentSessionData =
|
418
|
-
|
501
|
+
prePaymentSessionData = _this7.elementContainer.getPaymentContext().paymentSession;
|
502
|
+
_this7.elementContainer.updatePaymentSessionData(paymentSessionData);
|
419
503
|
// 1、数据获取
|
420
|
-
|
421
|
-
return
|
504
|
+
_context3.next = 6;
|
505
|
+
return _this7.elementProcessors[ElementType.payment].obtainData();
|
422
506
|
case 6:
|
423
|
-
data =
|
507
|
+
data = _context3.sent;
|
424
508
|
LOCAL_MOCK = window.location.href.indexOf('LOCAL_MOCK=1') !== -1; // 2、发送update消息
|
425
|
-
Object.values(
|
509
|
+
Object.values(_this7.elementProcessors).forEach(function (processor) {
|
426
510
|
processor.update({
|
427
511
|
data: {
|
428
512
|
originActionQueryResult: LOCAL_MOCK ? sdkActionUpdate : data.originActionQueryResult,
|
@@ -432,30 +516,30 @@ var ElementController = /*#__PURE__*/function () {
|
|
432
516
|
});
|
433
517
|
});
|
434
518
|
// 3、返回更新结果
|
435
|
-
|
519
|
+
_this7.serviceMap.EventCenter.listen(EVENT.updated.name, function (data) {
|
436
520
|
// 若更新不成功,还原core.paymentContext信息
|
437
521
|
if (!data.success) {
|
438
|
-
|
522
|
+
_this7.elementContainer.updatePaymentSessionData(prePaymentSessionData);
|
439
523
|
}
|
440
524
|
return resolve(data.success || false);
|
441
525
|
});
|
442
526
|
case 10:
|
443
527
|
case "end":
|
444
|
-
return
|
528
|
+
return _context3.stop();
|
445
529
|
}
|
446
|
-
},
|
530
|
+
}, _callee3);
|
447
531
|
}));
|
448
|
-
return function (
|
449
|
-
return
|
532
|
+
return function (_x4) {
|
533
|
+
return _ref6.apply(this, arguments);
|
450
534
|
};
|
451
535
|
}()));
|
452
536
|
case 1:
|
453
537
|
case "end":
|
454
|
-
return
|
538
|
+
return _context4.stop();
|
455
539
|
}
|
456
|
-
},
|
540
|
+
}, _callee4);
|
457
541
|
}));
|
458
|
-
function updatePayment(
|
542
|
+
function updatePayment(_x3) {
|
459
543
|
return _updatePayment.apply(this, arguments);
|
460
544
|
}
|
461
545
|
return updatePayment;
|
@@ -7,6 +7,9 @@ export declare class ElementComponent {
|
|
7
7
|
mount(renderOptions: LinkAuthMountOptions, sdkSelector: string): LinkAuthMountResult;
|
8
8
|
mount(renderOptions: AddressMountOptions, sdkSelector: string): AddressMountResult;
|
9
9
|
mount(renderOptions: PaymentMountOptions, sdkSelector: string): PaymentMountResult;
|
10
|
+
validateFields(): Promise<{
|
11
|
+
isValid: boolean;
|
12
|
+
}>;
|
10
13
|
submitPayment(): void;
|
11
14
|
destroy(): void;
|
12
15
|
}
|
@@ -49,6 +49,11 @@ export var ElementComponent = /*#__PURE__*/function () {
|
|
49
49
|
appearance: this === null || this === void 0 || (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.appearance
|
50
50
|
}, renderOptions), sdkSelector);
|
51
51
|
}
|
52
|
+
}, {
|
53
|
+
key: "validateFields",
|
54
|
+
value: function validateFields() {
|
55
|
+
return this.controller.validateFields();
|
56
|
+
}
|
52
57
|
}, {
|
53
58
|
key: "submitPayment",
|
54
59
|
value: function submitPayment() {
|
@@ -10,7 +10,8 @@ export declare enum ElementPaymentEvent {
|
|
10
10
|
CAPTURE_ASSET = "onCaptureAsset",
|
11
11
|
SIGN_OUT = "onSignout",
|
12
12
|
BLUR = "onBlur",
|
13
|
-
|
13
|
+
SUBMIT_PAY = "submitPay",
|
14
|
+
VALIDATE = "onValidate",
|
14
15
|
SUBMIT_RISK = "onSubmitRisk",
|
15
16
|
AFTER_SUBMIT = "onAfterSubmit",
|
16
17
|
SIZE_CHANGE = "onSizeChange",
|
@@ -22,7 +23,8 @@ export declare enum ElementPaymentEvent {
|
|
22
23
|
SEND_MUITI_APP_EVENT_TO_SDK = "sendMuitiAppEventToSdk",
|
23
24
|
LOG = "log",
|
24
25
|
HANDLE_PAYMENT = "handlePayment",
|
25
|
-
ON_EVENT_CALLBACK = "onEventCallback"
|
26
|
+
ON_EVENT_CALLBACK = "onEventCallback",
|
27
|
+
ON_PAY_STATUS_CHANGE = "onPayStatusChange"
|
26
28
|
}
|
27
29
|
export declare enum ElementPaymentMethod {
|
28
30
|
CONTAINER_ELEMENT = "CONTAINER_ELEMENT",
|
@@ -10,7 +10,8 @@ export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
|
|
10
10
|
ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
|
11
11
|
ElementPaymentEvent["SIGN_OUT"] = "onSignout";
|
12
12
|
ElementPaymentEvent["BLUR"] = "onBlur";
|
13
|
-
ElementPaymentEvent["
|
13
|
+
ElementPaymentEvent["SUBMIT_PAY"] = "submitPay";
|
14
|
+
ElementPaymentEvent["VALIDATE"] = "onValidate";
|
14
15
|
ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
|
15
16
|
ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
|
16
17
|
ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
|
@@ -20,6 +21,7 @@ export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
|
|
20
21
|
ElementPaymentEvent["LOG"] = "log";
|
21
22
|
ElementPaymentEvent["HANDLE_PAYMENT"] = "handlePayment";
|
22
23
|
ElementPaymentEvent["ON_EVENT_CALLBACK"] = "onEventCallback";
|
24
|
+
ElementPaymentEvent["ON_PAY_STATUS_CHANGE"] = "onPayStatusChange";
|
23
25
|
return ElementPaymentEvent;
|
24
26
|
}({});
|
25
27
|
export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
|