@alipay/ams-checkout 0.0.1710748686-dev.2 → 0.0.1711691167-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/constant/index.d.ts +2 -2
- package/esm/constant/index.js +4 -4
- package/esm/core/bus/ability/callback.d.ts +9 -0
- package/esm/core/bus/ability/callback.js +55 -0
- package/esm/core/bus/ability/security.d.ts +10 -0
- package/esm/core/bus/ability/security.js +104 -0
- package/esm/core/bus/ability/tracker.d.ts +9 -0
- package/esm/core/bus/ability/tracker.js +77 -0
- package/esm/core/bus/index.d.ts +125 -0
- package/esm/core/bus/index.js +366 -0
- package/esm/core/bus/interface.d.ts +36 -0
- package/esm/core/bus/interface.js +40 -0
- package/esm/core/component/index.d.ts +15 -1
- package/esm/core/component/index.js +189 -26
- package/esm/core/instance/index.d.ts +12 -1
- package/esm/core/instance/index.js +54 -11
- package/esm/index.d.ts +0 -3
- package/esm/index.js +8 -18
- package/esm/{core/applepay/index.d.ts → plugin/applepay/component.d.ts} +27 -8
- package/esm/{core/applepay/index.js → plugin/applepay/component.js} +150 -180
- package/esm/plugin/applepay/index.d.ts +17 -0
- package/esm/plugin/applepay/index.js +117 -0
- package/esm/{common → plugin}/applepay/interface.d.ts +62 -3
- package/esm/plugin/applepay/interface.js +69 -0
- package/esm/{common/applepay/index.d.ts → plugin/applepay/service.d.ts} +13 -7
- package/esm/{common/applepay/index.js → plugin/applepay/service.js} +159 -41
- package/esm/plugin/component/index.d.ts +2 -2
- package/esm/plugin/component/index.js +68 -46
- package/esm/plugin/const.d.ts +2 -0
- package/esm/plugin/const.js +33 -0
- package/esm/plugin/paypal/index.d.ts +20 -0
- package/esm/plugin/paypal/index.js +377 -0
- package/esm/plugin/type.d.ts +33 -0
- package/esm/plugin/utils.d.ts +6 -0
- package/esm/plugin/utils.js +21 -0
- package/esm/request/index.d.ts +1 -1
- package/esm/service/index.d.ts +1 -1
- package/esm/types/index.d.ts +108 -6
- package/esm/types/index.js +26 -1
- package/esm/util/index.d.ts +2 -1
- package/esm/util/index.js +4 -2
- package/esm/util/logger.d.ts +4 -0
- package/esm/util/logger.js +23 -3
- package/esm/util/versionCompare.d.ts +1 -1
- package/package.json +1 -1
- /package/esm/{common/applepay/interface.js → plugin/type.js} +0 -0
@@ -54,7 +54,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
54
54
|
_defineProperty(this, "_merchantAppointParam", void 0);
|
55
55
|
_defineProperty(this, "_webAppHeartBeatTimeoutId", void 0);
|
56
56
|
_defineProperty(this, "_webAppHeartBeatTimeoutFn", void 0);
|
57
|
-
this._appVersion = '1.13.0
|
57
|
+
this._appVersion = '1.13.0';
|
58
58
|
this._isInitComponent = false;
|
59
59
|
this._selector = "#".concat(COMPONENT_SECTION_ID);
|
60
60
|
this.createIframeNode = function () {
|
@@ -94,7 +94,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
94
94
|
}, {
|
95
95
|
key: "initLoggerMeta",
|
96
96
|
value: function initLoggerMeta() {
|
97
|
-
var _this$_renderParams, _paymentSessionMetaDa, _this$_renderParams2;
|
97
|
+
var _this$_renderParams, _paymentSessionMetaDa, _this$_renderParams2, _this$_renderParams3;
|
98
98
|
var paymentSessionMetaData = (_this$_renderParams = this._renderParams) === null || _this$_renderParams === void 0 ? void 0 : _this$_renderParams.paymentSessionMetaData;
|
99
99
|
var paymentSessionConfig = paymentSessionMetaData.paymentSessionConfig;
|
100
100
|
this.AMSSDK.logger.setMedta({
|
@@ -110,9 +110,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
110
110
|
productSceneVersion: paymentSessionConfig === null || paymentSessionConfig === void 0 ? void 0 : paymentSessionConfig.productSceneVersion,
|
111
111
|
paymentMethodType: paymentSessionMetaData === null || paymentSessionMetaData === void 0 || (_paymentSessionMetaDa = paymentSessionMetaData.paymentMethodInfoView) === null || _paymentSessionMetaDa === void 0 ? void 0 : _paymentSessionMetaDa.paymentMethodType,
|
112
112
|
paymentMethodCategoryType: paymentSessionConfig === null || paymentSessionConfig === void 0 ? void 0 : paymentSessionConfig.paymentMethodCategoryType,
|
113
|
-
requestSeq: (_this$_renderParams2 = this._renderParams) === null || _this$_renderParams2 === void 0 ? void 0 : _this$_renderParams2.paymentSessionData
|
113
|
+
requestSeq: (_this$_renderParams2 = this._renderParams) === null || _this$_renderParams2 === void 0 ? void 0 : _this$_renderParams2.paymentSessionData,
|
114
|
+
trackId: (_this$_renderParams3 = this._renderParams) === null || _this$_renderParams3 === void 0 ? void 0 : _this$_renderParams3.sessionData
|
114
115
|
});
|
115
|
-
this.AMSSDK.logger.setComponentStartTime(Date.now());
|
116
116
|
}
|
117
117
|
|
118
118
|
/**
|
@@ -131,9 +131,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
131
131
|
}, {
|
132
132
|
key: "initSecurity",
|
133
133
|
value: function initSecurity() {
|
134
|
-
var _this$
|
134
|
+
var _this$_renderParams4,
|
135
135
|
_this = this;
|
136
|
-
var product = (_this$
|
136
|
+
var product = (_this$_renderParams4 = this._renderParams) === null || _this$_renderParams4 === void 0 || (_this$_renderParams4 = _this$_renderParams4.paymentSessionMetaData) === null || _this$_renderParams4 === void 0 || (_this$_renderParams4 = _this$_renderParams4.paymentSessionConfig) === null || _this$_renderParams4 === void 0 ? void 0 : _this$_renderParams4.productScene;
|
137
137
|
if (componentSignEnum.CASHIER_PAYMENT_APM === this._componentSign) return;
|
138
138
|
if (componentSignEnum.CASHIER_PAYMENT_BANK === this._componentSign) {
|
139
139
|
this.AMSSDK.logger.logInfo({
|
@@ -364,7 +364,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
364
364
|
this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
|
365
365
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
366
366
|
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3, _this5$_renderParams4, _this5$_renderParams5;
|
367
|
-
var envInfo, params,
|
367
|
+
var envInfo, params, _ref3, extendInfo, enableVaultingApiOptimize, enableEasypayApiOptimize, extendInfoData, _this5$_renderParams6, _this5$_renderParams7, _ref4, _ref4$productSceneVer, productSceneVersion, _ref4$productScene, productScene, _ref5, _ref5$action, _ref5$action2, _ref5$action2$autoDeb, autoDebitWithToken, _this5$_renderParams8, _action$web, _action$wap, action, signType;
|
368
368
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
369
369
|
while (1) switch (_context2.prev = _context2.next) {
|
370
370
|
case 0:
|
@@ -380,7 +380,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
380
380
|
/**
|
381
381
|
* @description Simulated or unnecessary scenarios
|
382
382
|
*/
|
383
|
-
|
383
|
+
_ref3 = ((_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.paymentSessionMetaData) || {}, extendInfo = _ref3.extendInfo;
|
384
384
|
enableVaultingApiOptimize = false;
|
385
385
|
enableEasypayApiOptimize = false;
|
386
386
|
try {
|
@@ -427,8 +427,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
427
427
|
_context2.next = 26;
|
428
428
|
break;
|
429
429
|
}
|
430
|
-
|
431
|
-
|
430
|
+
_ref4 = params.paymentSessionConfig || {}, _ref4$productSceneVer = _ref4.productSceneVersion, productSceneVersion = _ref4$productSceneVer === void 0 ? '' : _ref4$productSceneVer, _ref4$productScene = _ref4.productScene, productScene = _ref4$productScene === void 0 ? '' : _ref4$productScene;
|
431
|
+
_ref5 = ((_this5$_renderParams6 = _this5._renderParams) === null || _this5$_renderParams6 === void 0 ? void 0 : _this5$_renderParams6.paymentSessionMetaData) || {}, _ref5$action = _ref5.action, _ref5$action2 = _ref5$action === void 0 ? {} : _ref5$action, _ref5$action2$autoDeb = _ref5$action2.autoDebitWithToken, autoDebitWithToken = _ref5$action2$autoDeb === void 0 ? false : _ref5$action2$autoDeb;
|
432
432
|
if (!((_this5$_renderParams7 = _this5._renderParams) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.paymentSessionMetaData) !== null && _this5$_renderParams7 !== void 0 && (_this5$_renderParams7 = _this5$_renderParams7.action) !== null && _this5$_renderParams7 !== void 0 && _this5$_renderParams7.skipSdkQuery && enableEasypayApiOptimize)) {
|
433
433
|
_context2.next = 21;
|
434
434
|
break;
|
@@ -483,7 +483,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
483
483
|
_this5.AMSSDK.logger.logInfo({
|
484
484
|
title: 'sdk_event_sdkQuery'
|
485
485
|
}, {
|
486
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
486
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig),
|
487
|
+
requestBody: params
|
487
488
|
}).send();
|
488
489
|
queryPaymentInfo(params, {
|
489
490
|
env: _this5.AMSSDK.options.env.environment,
|
@@ -494,6 +495,12 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
494
495
|
value: Date.now()
|
495
496
|
});
|
496
497
|
resolve(res);
|
498
|
+
_this5.AMSSDK.logger.logInfo({
|
499
|
+
title: 'sdk_event_sdkQueryEnd'
|
500
|
+
}, {
|
501
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig),
|
502
|
+
responseBody: res
|
503
|
+
}).send();
|
497
504
|
}).catch(function (err) {
|
498
505
|
if ([componentSignEnum.CASHIER_PAYMENT_CARD, componentSignEnum.VAULTING_CARD, componentSignEnum.CASHIER_PAYMENT_APM].includes(_this5._componentSign)) {
|
499
506
|
return resolve({
|
@@ -503,13 +510,13 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
503
510
|
_this5.dispatchToSDK(EVENT.error.name, {
|
504
511
|
code: ERRORMESSAGE.CREATECOMPONENT_ERROR.code
|
505
512
|
});
|
506
|
-
|
507
|
-
|
508
|
-
_this5.AMSSDK.logger.logInfo({
|
509
|
-
title: 'sdk_event_sdkQueryEnd'
|
513
|
+
_this5.AMSSDK.logger.logError({
|
514
|
+
title: 'sdk_event_sdkQuery_failed'
|
510
515
|
}, {
|
511
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
516
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig),
|
517
|
+
errorReason: err
|
512
518
|
}).send();
|
519
|
+
reject(err);
|
513
520
|
});
|
514
521
|
case 38:
|
515
522
|
case "end":
|
@@ -528,21 +535,21 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
528
535
|
}, {
|
529
536
|
key: "createSubmitPromise",
|
530
537
|
value: function createSubmitPromise() {
|
531
|
-
var _this$
|
532
|
-
_this$
|
538
|
+
var _this$_renderParams5,
|
539
|
+
_this$_renderParams6,
|
533
540
|
_this6 = this;
|
534
541
|
this._performanceData.push({
|
535
542
|
key: 'sdk_submit_start',
|
536
543
|
value: Date.now()
|
537
544
|
});
|
538
545
|
var params = {
|
539
|
-
paymentSessionData: this._renderParams && ((_this$
|
540
|
-
paymentSessionConfig: (_this$
|
546
|
+
paymentSessionData: this._renderParams && ((_this$_renderParams5 = this._renderParams) === null || _this$_renderParams5 === void 0 ? void 0 : _this$_renderParams5.sessionData) || '',
|
547
|
+
paymentSessionConfig: (_this$_renderParams6 = this._renderParams) === null || _this$_renderParams6 === void 0 || (_this$_renderParams6 = _this$_renderParams6.paymentSessionMetaData) === null || _this$_renderParams6 === void 0 ? void 0 : _this$_renderParams6.paymentSessionConfig
|
541
548
|
};
|
542
549
|
|
543
550
|
// eslint-disable-next-line no-async-promise-executor
|
544
551
|
this._actionSubmitPromise = new Promise( /*#__PURE__*/function () {
|
545
|
-
var
|
552
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resolve) {
|
546
553
|
var _this6$_renderParams;
|
547
554
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
548
555
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -559,7 +566,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
559
566
|
_this6.AMSSDK.logger.logInfo({
|
560
567
|
title: 'sdk_event_submitPay'
|
561
568
|
}, {
|
562
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
569
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig),
|
570
|
+
requestBody: params
|
563
571
|
}).send();
|
564
572
|
_context3.t0 = submitPayInfo;
|
565
573
|
_context3.t1 = params;
|
@@ -582,21 +590,23 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
582
590
|
key: 'sdk_submit_end',
|
583
591
|
value: Date.now()
|
584
592
|
});
|
585
|
-
if (res !== null && res !== void 0 && res.success) {
|
586
|
-
resolve(res);
|
587
|
-
} else {
|
588
|
-
resolve(res);
|
589
|
-
}
|
590
|
-
}).catch(function () {
|
591
|
-
resolve({
|
592
|
-
success: false
|
593
|
-
});
|
594
|
-
}).finally(function () {
|
595
593
|
_this6.AMSSDK.logger.logInfo({
|
596
594
|
title: 'sdk_event_submitPayEnd'
|
597
595
|
}, {
|
598
|
-
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig)
|
596
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig),
|
597
|
+
responseBody: res
|
599
598
|
}).send();
|
599
|
+
resolve(res);
|
600
|
+
}).catch(function (err) {
|
601
|
+
_this6.AMSSDK.logger.logError({
|
602
|
+
title: 'sdk_event_submitPay_failed'
|
603
|
+
}, {
|
604
|
+
paymentSessionConfig: JSON.stringify(params.paymentSessionConfig),
|
605
|
+
responseBody: err
|
606
|
+
}).send();
|
607
|
+
resolve({
|
608
|
+
success: false
|
609
|
+
});
|
600
610
|
});
|
601
611
|
case 13:
|
602
612
|
case "end":
|
@@ -605,7 +615,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
605
615
|
}, _callee3);
|
606
616
|
}));
|
607
617
|
return function (_x3) {
|
608
|
-
return
|
618
|
+
return _ref6.apply(this, arguments);
|
609
619
|
};
|
610
620
|
}());
|
611
621
|
}
|
@@ -975,10 +985,10 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
975
985
|
this.createDialog((_data$context = data.context) === null || _data$context === void 0 ? void 0 : _data$context.data);
|
976
986
|
return;
|
977
987
|
}
|
978
|
-
if (data.context.event === EVENT.
|
988
|
+
if (data.context.event === EVENT.sendMuitiAppEventToSdk.name) {
|
979
989
|
this.dispatchToApp({
|
980
990
|
context: {
|
981
|
-
event: '
|
991
|
+
event: 'receiveMuitiAppFromSdk',
|
982
992
|
data: data.context.data
|
983
993
|
}
|
984
994
|
});
|
@@ -1196,9 +1206,9 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1196
1206
|
}
|
1197
1207
|
}, {
|
1198
1208
|
key: "handleDeclareInfo",
|
1199
|
-
value: function handleDeclareInfo(
|
1200
|
-
var
|
1201
|
-
closeDialogData =
|
1209
|
+
value: function handleDeclareInfo(_ref7) {
|
1210
|
+
var _ref7$closeDialogData = _ref7.closeDialogData,
|
1211
|
+
closeDialogData = _ref7$closeDialogData === void 0 ? {} : _ref7$closeDialogData;
|
1202
1212
|
_handleDeclareInfo({
|
1203
1213
|
closeDialogData: closeDialogData
|
1204
1214
|
});
|
@@ -1344,7 +1354,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1344
1354
|
key: "sendRenderEvent",
|
1345
1355
|
value: (function () {
|
1346
1356
|
var _sendRenderEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
1347
|
-
var _this$
|
1357
|
+
var _this$_renderParams7, _this$_renderParams8, _this$_renderParams9, _this$_renderParams10, _this$_renderParams11, _this$_renderParams12, _this$AMSSDK$logger, _this$_renderParams13, _this$_renderParams14, _this$_renderParams15, _this$AMSSDK, _this$_renderParams16, res, submitRes;
|
1348
1358
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1349
1359
|
while (1) switch (_context8.prev = _context8.next) {
|
1350
1360
|
case 0:
|
@@ -1373,17 +1383,29 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
1373
1383
|
data: {
|
1374
1384
|
queryResult: res,
|
1375
1385
|
submitResult: submitRes,
|
1376
|
-
sessionResult: (_this$
|
1377
|
-
paymentSessionData: (_this$
|
1386
|
+
sessionResult: (_this$_renderParams7 = this._renderParams) === null || _this$_renderParams7 === void 0 ? void 0 : _this$_renderParams7.paymentSessionMetaData,
|
1387
|
+
paymentSessionData: (_this$_renderParams8 = this._renderParams) === null || _this$_renderParams8 === void 0 ? void 0 : _this$_renderParams8.sessionData,
|
1378
1388
|
heightOfVisible: Math.max(window.changingPageHeight, window.innerHeight),
|
1379
|
-
renderDisplayType: (_this$
|
1380
|
-
appearance: (_this$
|
1381
|
-
notRedirectAfterComplete: ((_this$
|
1389
|
+
renderDisplayType: (_this$_renderParams9 = this._renderParams) === null || _this$_renderParams9 === void 0 ? void 0 : _this$_renderParams9.renderDisplayType,
|
1390
|
+
appearance: (_this$_renderParams10 = this._renderParams) === null || _this$_renderParams10 === void 0 ? void 0 : _this$_renderParams10.appearance,
|
1391
|
+
notRedirectAfterComplete: ((_this$_renderParams11 = this._renderParams) === null || _this$_renderParams11 === void 0 ? void 0 : _this$_renderParams11.notRedirectAfterComplete) === true,
|
1382
1392
|
merchantAppointParam: this._merchantAppointParam,
|
1383
1393
|
envInfo: {
|
1384
1394
|
screenHeight: screen.height,
|
1385
1395
|
screenWidth: screen.width
|
1386
|
-
}
|
1396
|
+
},
|
1397
|
+
logMetaData: _objectSpread(_objectSpread({
|
1398
|
+
trackId: (_this$_renderParams12 = this._renderParams) === null || _this$_renderParams12 === void 0 ? void 0 : _this$_renderParams12.sessionData,
|
1399
|
+
platform: this.platform,
|
1400
|
+
firstLogTime: (_this$AMSSDK$logger = this.AMSSDK.logger) === null || _this$AMSSDK$logger === void 0 ? void 0 : _this$AMSSDK$logger.getComponentStartTime()
|
1401
|
+
}, ((_this$_renderParams13 = this._renderParams) === null || _this$_renderParams13 === void 0 || (_this$_renderParams13 = _this$_renderParams13.paymentSessionMetaData) === null || _this$_renderParams13 === void 0 ? void 0 : _this$_renderParams13.paymentSessionConfig) || {}), {}, {
|
1402
|
+
renderDisplayType: (_this$_renderParams14 = this._renderParams) === null || _this$_renderParams14 === void 0 ? void 0 : _this$_renderParams14.renderDisplayType,
|
1403
|
+
sdkVersion: this._appVersion,
|
1404
|
+
merchantId: (_this$_renderParams15 = this._renderParams) === null || _this$_renderParams15 === void 0 || (_this$_renderParams15 = _this$_renderParams15.paymentSessionMetaData) === null || _this$_renderParams15 === void 0 ? void 0 : _this$_renderParams15.clientId,
|
1405
|
+
instanceId: (_this$AMSSDK = this.AMSSDK) === null || _this$AMSSDK === void 0 ? void 0 : _this$AMSSDK._instanceId,
|
1406
|
+
performanceData: this._performanceData,
|
1407
|
+
paymentMethodType: (_this$_renderParams16 = this._renderParams) === null || _this$_renderParams16 === void 0 || (_this$_renderParams16 = _this$_renderParams16.paymentSessionMetaData) === null || _this$_renderParams16 === void 0 || (_this$_renderParams16 = _this$_renderParams16.paymentMethodInfoView) === null || _this$_renderParams16 === void 0 ? void 0 : _this$_renderParams16.paymentMethodType
|
1408
|
+
})
|
1387
1409
|
}
|
1388
1410
|
}
|
1389
1411
|
});
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { ApplePayActionEnum, PaymentActionEnum, PaypalActionEnum } from "../core/bus/interface";
|
2
|
+
import { paymentMethodCategoryTypeEnum, PaypalMethodEnum, productSceneEnum, ProductSceneVersion } from "../types/index";
|
3
|
+
export var ExtendPlugin = [{
|
4
|
+
sessionMatcher: {
|
5
|
+
productScene: productSceneEnum.CASHIER_PAYMENT,
|
6
|
+
productSceneVersion: ProductSceneVersion.V1,
|
7
|
+
paymentMethodCategoryType: paymentMethodCategoryTypeEnum.CARD,
|
8
|
+
paymentMethodTypes: ['CARD_APPLE_PAY']
|
9
|
+
},
|
10
|
+
paymentChannelMatcher: {
|
11
|
+
paymentMethod: 'ApplePay'
|
12
|
+
},
|
13
|
+
busActionNames: {
|
14
|
+
canMakePayments: ApplePayActionEnum.canMakePayments,
|
15
|
+
optional_init: PaymentActionEnum.optional_init,
|
16
|
+
createComponent: ApplePayActionEnum.createComponent,
|
17
|
+
destroyComponent: ApplePayActionEnum.destroyComponent
|
18
|
+
}
|
19
|
+
}, {
|
20
|
+
sessionMatcher: {
|
21
|
+
productScene: productSceneEnum.CASHIER_PAYMENT,
|
22
|
+
productSceneVersion: ProductSceneVersion.V1,
|
23
|
+
paymentMethodCategoryType: paymentMethodCategoryTypeEnum.APM,
|
24
|
+
paymentMethodTypes: [PaypalMethodEnum.PAYPAL_CHECKOUT, PaypalMethodEnum.PAYPAL_PAYLATER, PaypalMethodEnum.PAYPAL_VAULT]
|
25
|
+
},
|
26
|
+
paymentChannelMatcher: {
|
27
|
+
paymentMethod: 'Paypal'
|
28
|
+
},
|
29
|
+
busActionNames: {
|
30
|
+
mountComponent: PaypalActionEnum.mountComponent,
|
31
|
+
destroyComponent: PaypalActionEnum.destroyComponent
|
32
|
+
}
|
33
|
+
}];
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { BusContext, BusMessage, BusSubscriber } from '../../core/bus';
|
2
|
+
import { Logger } from '../../util/logger';
|
3
|
+
export declare class PaypalBusSubscriber extends BusSubscriber {
|
4
|
+
logger: Logger;
|
5
|
+
constructor(logger: Logger);
|
6
|
+
actionNames(): string[];
|
7
|
+
private onEventCallback;
|
8
|
+
protected renderPaypalButton(context: BusContext, message: BusMessage): Promise<never>;
|
9
|
+
private appendPaypalLoading;
|
10
|
+
private removePaypalLoading;
|
11
|
+
private preCheck;
|
12
|
+
private loadPaypalResource;
|
13
|
+
private createPaypalScript;
|
14
|
+
private onShippingChange;
|
15
|
+
private createOrder;
|
16
|
+
private onApprove;
|
17
|
+
private onCancel;
|
18
|
+
private destroyComponent;
|
19
|
+
onMessage(context: BusContext, message: BusMessage): void;
|
20
|
+
}
|