@alipay/ams-checkout 0.0.1726734012-dev.7 → 0.0.1726734012-dev.9
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.d.ts +3 -1
- package/esm/core/component/index.js +3 -2
- package/esm/core/instance/index.d.ts +1 -1
- package/esm/core/instance/index.js +5 -3
- package/esm/foundation/product-processor/easysafepay/index.d.ts +1 -1
- package/esm/foundation/service/container/index.js +1 -0
- package/esm/index.d.ts +2 -0
- package/esm/index.js +7 -0
- package/esm/types/index.d.ts +2 -0
- package/package.json +1 -1
@@ -49,5 +49,7 @@ export declare class AMSComponent extends CoreInstance {
|
|
49
49
|
* @param data - Transfer information in the submission interface according to your requirements (optional)
|
50
50
|
*/
|
51
51
|
submit(data?: Isubmit): Promise<unknown>;
|
52
|
-
preload(_options:
|
52
|
+
preload(_options: {
|
53
|
+
securityRegion?: 'US' | 'SG' | 'DE';
|
54
|
+
}): void;
|
53
55
|
}
|
@@ -413,7 +413,7 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
413
413
|
key: "preloadComponent",
|
414
414
|
value: function preloadComponent() {
|
415
415
|
var _this6 = this;
|
416
|
-
console.log('web-
|
416
|
+
console.log('web-preloadpreloadComponent', this.channelType, this.productSceneVersion);
|
417
417
|
var MAX_CLEAR_TIME = 10000;
|
418
418
|
if (Array.isArray(this.channelType)) {
|
419
419
|
for (var i = 0; i < this.channelType.length; i++) {
|
@@ -563,7 +563,8 @@ export var AMSComponent = /*#__PURE__*/function (_CoreInstance) {
|
|
563
563
|
return val === ComponentSignEnum.EASY_PAY_WALLET || val === ComponentSignEnum.EASY_PAY_APM;
|
564
564
|
})) return;
|
565
565
|
this._componentApp.AMSSDK.initSecurity({
|
566
|
-
product: this.options.product
|
566
|
+
product: this.options.product,
|
567
|
+
securityRegion: _options.securityRegion
|
567
568
|
});
|
568
569
|
} catch (err) {
|
569
570
|
console.log('web-sdk error', err);
|
@@ -33,7 +33,7 @@ export default class AMSSDK {
|
|
33
33
|
* @param product Product Scenarios
|
34
34
|
* @param scene Scenario of the product (compatible with old version parameters, about to be deleted)
|
35
35
|
*/
|
36
|
-
initSecurity({ product, scene, }: InitSecurityConfig & {
|
36
|
+
initSecurity({ product, scene, securityRegion, }: InitSecurityConfig & {
|
37
37
|
scene?: string;
|
38
38
|
}): void;
|
39
39
|
/**
|
@@ -79,7 +79,7 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
79
79
|
key: "preInitSecurity",
|
80
80
|
value: function preInitSecurity(options) {
|
81
81
|
var _this$options;
|
82
|
-
console.log('web-preloadsdk preInitSecurity-success');
|
82
|
+
console.log('web-preloadsdk preInitSecurity-success', options);
|
83
83
|
var antomSDKConfigKey = 'antomSDKConfigKey';
|
84
84
|
var config = safeJson(getOrSetStorageId(antomSDKConfigKey), {});
|
85
85
|
if (![EnvironmentEnum.prod, EnvironmentEnum.sandbox].includes(options === null || options === void 0 ? void 0 : options.environment)) return;
|
@@ -160,7 +160,9 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
160
160
|
var _ref$product = _ref.product,
|
161
161
|
product = _ref$product === void 0 ? ProductSceneEnum.EASY_PAY : _ref$product,
|
162
162
|
_ref$scene = _ref.scene,
|
163
|
-
scene = _ref$scene === void 0 ? ProductSceneEnum.EASY_PAY : _ref$scene
|
163
|
+
scene = _ref$scene === void 0 ? ProductSceneEnum.EASY_PAY : _ref$scene,
|
164
|
+
_ref$securityRegion = _ref.securityRegion,
|
165
|
+
securityRegion = _ref$securityRegion === void 0 ? 'SG' : _ref$securityRegion;
|
164
166
|
this.logger.logInfo({
|
165
167
|
title: 'sdk_event_securitySdkPreInit'
|
166
168
|
}, {
|
@@ -172,7 +174,7 @@ var AMSSDK = /*#__PURE__*/function () {
|
|
172
174
|
if (sdk) return;
|
173
175
|
this._newSecuritySDKByScene({
|
174
176
|
product: product || scene,
|
175
|
-
region: SecurityRegionEnum.SG
|
177
|
+
region: securityRegion || SecurityRegionEnum.SG
|
176
178
|
}, function () {
|
177
179
|
_this.logger.logInfo({
|
178
180
|
title: 'sdk_event_securitySdkPreInitSuccess'
|
@@ -92,6 +92,7 @@ export var ContainerService = /*#__PURE__*/function () {
|
|
92
92
|
key: "preload",
|
93
93
|
value: function preload(taskId, url) {
|
94
94
|
var _this = this;
|
95
|
+
console.log('web-preloadsdk EasyPay');
|
95
96
|
var preloadIframe = createPreloadIframe(taskId);
|
96
97
|
preloadIframe.src = url;
|
97
98
|
var body = document.body || null;
|
package/esm/index.d.ts
CHANGED
@@ -31,7 +31,9 @@ export declare class Element extends ElementComponent {
|
|
31
31
|
export default AMSCheckout;
|
32
32
|
export declare class AMSEasyPay {
|
33
33
|
private core;
|
34
|
+
private easySafePayProcessor;
|
34
35
|
constructor(options: IoptionsParams);
|
35
36
|
createComponent(params: IcreateComponent): void;
|
37
|
+
preload(): void;
|
36
38
|
unmount(): void;
|
37
39
|
}
|
package/esm/index.js
CHANGED
@@ -164,6 +164,7 @@ export var AMSEasyPay = /*#__PURE__*/function () {
|
|
164
164
|
function AMSEasyPay(options) {
|
165
165
|
_classCallCheck(this, AMSEasyPay);
|
166
166
|
_defineProperty(this, "core", void 0);
|
167
|
+
_defineProperty(this, "easySafePayProcessor", void 0);
|
167
168
|
this.core = new AntomSDKCore();
|
168
169
|
this.core.registerProcessor(ProductSceneEnum.EASY_PAY, '', new EasySafePayProcessor());
|
169
170
|
this.core.init(options, ProductSceneEnum.EASY_PAY);
|
@@ -183,6 +184,12 @@ export var AMSEasyPay = /*#__PURE__*/function () {
|
|
183
184
|
isAppWebview: params.isAppWebview
|
184
185
|
});
|
185
186
|
}
|
187
|
+
}, {
|
188
|
+
key: "preload",
|
189
|
+
value: function preload() {
|
190
|
+
this.core.init({}, ProductSceneEnum.EASY_PAY);
|
191
|
+
this.easySafePayProcessor.initSecuritySDK();
|
192
|
+
}
|
186
193
|
}, {
|
187
194
|
key: "unmount",
|
188
195
|
value: function unmount() {
|
package/esm/types/index.d.ts
CHANGED
@@ -37,6 +37,7 @@ export interface IoptionsParams {
|
|
37
37
|
product?: string;
|
38
38
|
networkMode?: string;
|
39
39
|
mode?: string;
|
40
|
+
securityRegion?: 'US' | 'SG' | 'DE';
|
40
41
|
}
|
41
42
|
export interface IApplePayOptionsParams extends Pick<IoptionsParams, 'locale' | 'environment' | 'onEventCallback' | 'analytics'> {
|
42
43
|
}
|
@@ -223,6 +224,7 @@ export interface IsecurityConfig {
|
|
223
224
|
export interface InitSecurityConfig {
|
224
225
|
product: ProductSceneEnum;
|
225
226
|
region?: string;
|
227
|
+
securityRegion?: 'US' | 'SG' | 'DE';
|
226
228
|
}
|
227
229
|
export interface frontModulesToBeLoadedInterface {
|
228
230
|
acquirerName: string;
|