@alipay/ams-checkout 0.0.1726734012-dev.15 → 0.0.1726734012-dev.17
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/index.js +2 -3
- package/esm/foundation/core/index.d.ts +1 -1
- package/esm/foundation/core/index.js +2 -2
- package/esm/foundation/product-processor/easysafepay/index.d.ts +2 -2
- package/esm/foundation/product-processor/easysafepay/index.js +15 -17
- package/esm/index.js +5 -2
- package/package.json +1 -1
@@ -530,11 +530,10 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
530
530
|
key: "preload",
|
531
531
|
value: function preload(_options) {
|
532
532
|
try {
|
533
|
-
var
|
533
|
+
var _options$channelType;
|
534
534
|
var currentCompoentApp = new AMSComponent(_objectSpread({}, _options));
|
535
535
|
currentCompoentApp.preloadComponent(_options.channelType, _options.productSceneVersion || '1.0');
|
536
|
-
|
537
|
-
if (currentCompoentApp.channelType && (_currentCompoentApp$c = currentCompoentApp.channelType) !== null && _currentCompoentApp$c !== void 0 && _currentCompoentApp$c.some(function (val) {
|
536
|
+
if (_options.channelType && (_options$channelType = _options.channelType) !== null && _options$channelType !== void 0 && _options$channelType.some(function (val) {
|
538
537
|
return val === ComponentSignEnum.EASY_PAY_WALLET || val === ComponentSignEnum.EASY_PAY_APM;
|
539
538
|
})) return;
|
540
539
|
currentCompoentApp._componentApp.AMSSDK.initSecurity({
|
@@ -16,7 +16,7 @@ export declare class AntomSDKCore {
|
|
16
16
|
constructor();
|
17
17
|
registerProcessor(productScene: string, paymentMethod: string, processor: ProductProcessor): void;
|
18
18
|
init(options: IoptionsParams, productScene: ProductSceneEnum): void;
|
19
|
-
|
19
|
+
transferEasyPaySDKVersion(): {
|
20
20
|
webAppVersion: string;
|
21
21
|
greyscaleId: number;
|
22
22
|
productScene: ProductSceneEnum.EASY_PAY;
|
@@ -60,8 +60,8 @@ export var AntomSDKCore = /*#__PURE__*/function () {
|
|
60
60
|
this.prepare(options, this.sdkMetaData);
|
61
61
|
}
|
62
62
|
}, {
|
63
|
-
key: "
|
64
|
-
value: function
|
63
|
+
key: "transferEasyPaySDKVersion",
|
64
|
+
value: function transferEasyPaySDKVersion() {
|
65
65
|
return this.sdkMetaData = {
|
66
66
|
webAppVersion: '',
|
67
67
|
greyscaleId: getGrayscaleId(),
|
@@ -9,10 +9,10 @@ export declare class EasySafePayProcessor implements ProductProcessor {
|
|
9
9
|
private allowSubmitPayCallAhead;
|
10
10
|
private channelBehavior?;
|
11
11
|
private SECURITY_SDK_INIT_TIMEOUT;
|
12
|
+
static isSuccessfullyPreloaded: boolean;
|
12
13
|
init(config: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
|
13
14
|
startBizFlow(paymentContext: PaymentContext): Promise<BizFlowStartBehavior>;
|
14
|
-
|
15
|
-
static preload(options: IoptionsParams, sdkVersion: SDKMetaData): void;
|
15
|
+
static preloadWebApp(config: IoptionsParams, instanceId: string, sdkMetaData: SDKMetaData): void;
|
16
16
|
private buildWebAppPreloadUrl;
|
17
17
|
private buildWebAppUrl;
|
18
18
|
private buildRedirectResult;
|
@@ -39,7 +39,9 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
39
39
|
this.instanceId = instanceId;
|
40
40
|
this.logger = ServiceProvider.getInstance(this.instanceId).getService('Log');
|
41
41
|
this.securityService = ServiceProvider.getInstance(this.instanceId).getService('Security');
|
42
|
-
|
42
|
+
if (!EasySafePayProcessor.isSuccessfullyPreloaded) {
|
43
|
+
EasySafePayProcessor.preloadWebApp(config, this.instanceId, sdkMetaData);
|
44
|
+
}
|
43
45
|
}
|
44
46
|
}, {
|
45
47
|
key: "startBizFlow",
|
@@ -103,16 +105,6 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
103
105
|
}
|
104
106
|
return startBizFlow;
|
105
107
|
}()
|
106
|
-
}, {
|
107
|
-
key: "preloadWebApp",
|
108
|
-
value: function preloadWebApp(config, instanceId, sdkMetaData) {
|
109
|
-
// trigger preload
|
110
|
-
var containerService = ServiceProvider.getInstance(this.instanceId).getService('Container');
|
111
|
-
var _this$buildWebAppPrel = this.buildWebAppPreloadUrl(config, instanceId, sdkMetaData),
|
112
|
-
taskId = _this$buildWebAppPrel.taskId,
|
113
|
-
webUrl = _this$buildWebAppPrel.webUrl;
|
114
|
-
containerService.preload(taskId, webUrl);
|
115
|
-
}
|
116
108
|
}, {
|
117
109
|
key: "buildWebAppPreloadUrl",
|
118
110
|
value: function buildWebAppPreloadUrl(initConfig, instanceId, sdkMetaData) {
|
@@ -460,12 +452,18 @@ export var EasySafePayProcessor = /*#__PURE__*/function () {
|
|
460
452
|
return initSecuritySDK;
|
461
453
|
}()
|
462
454
|
}], [{
|
463
|
-
key: "
|
464
|
-
value: function
|
465
|
-
|
466
|
-
var
|
467
|
-
|
455
|
+
key: "preloadWebApp",
|
456
|
+
value: function preloadWebApp(config, instanceId, sdkMetaData) {
|
457
|
+
// trigger preload
|
458
|
+
var ClassEasySafePayProcessor = new EasySafePayProcessor();
|
459
|
+
var containerService = ServiceProvider.getInstance(ClassEasySafePayProcessor.instanceId).getService('Container');
|
460
|
+
var _ClassEasySafePayProc = ClassEasySafePayProcessor.buildWebAppPreloadUrl(config, instanceId, sdkMetaData),
|
461
|
+
taskId = _ClassEasySafePayProc.taskId,
|
462
|
+
webUrl = _ClassEasySafePayProc.webUrl;
|
463
|
+
EasySafePayProcessor.isSuccessfullyPreloaded = true;
|
464
|
+
containerService.preload(taskId, webUrl);
|
468
465
|
}
|
469
466
|
}]);
|
470
467
|
return EasySafePayProcessor;
|
471
|
-
}();
|
468
|
+
}();
|
469
|
+
_defineProperty(EasySafePayProcessor, "isSuccessfullyPreloaded", void 0);
|
package/esm/index.js
CHANGED
@@ -33,6 +33,7 @@ export { AMSCheckoutPage } from "./core/component/ckp";
|
|
33
33
|
export * from "./types";
|
34
34
|
import { AntomSDKCore } from "./foundation/core";
|
35
35
|
import { EasySafePayProcessor } from "./foundation/product-processor/easysafepay";
|
36
|
+
import { uuid } from "./foundation/product-processor/easysafepay/deps";
|
36
37
|
export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
37
38
|
_inherits(AMSCheckout, _AMSComponent);
|
38
39
|
var _super = _createSuper(AMSCheckout);
|
@@ -51,6 +52,7 @@ export var AMSCheckout = /*#__PURE__*/function (_AMSComponent) {
|
|
51
52
|
_createClass(AMSCheckout, null, [{
|
52
53
|
key: "preload",
|
53
54
|
value: function preload(_options) {
|
55
|
+
AMSComponent.isSuccessfullyPreloaded = true;
|
54
56
|
AMSComponent.preload(_objectSpread(_objectSpread({}, _options), {}, {
|
55
57
|
appVersion: AMSCheckoutAppVersion
|
56
58
|
}));
|
@@ -200,8 +202,9 @@ export var AMSEasyPay = /*#__PURE__*/function () {
|
|
200
202
|
key: "preload",
|
201
203
|
value: function preload(options) {
|
202
204
|
var core = new AntomSDKCore();
|
203
|
-
var
|
204
|
-
|
205
|
+
var instanceId = uuid();
|
206
|
+
var SDkMetaData = core.transferEasyPaySDKVersion();
|
207
|
+
EasySafePayProcessor.preloadWebApp(options, instanceId, SDkMetaData);
|
205
208
|
}
|
206
209
|
}]);
|
207
210
|
return AMSEasyPay;
|