@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.
@@ -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: any): void;
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-sdkpreload', this.channelType, this.productSceneVersion);
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'
@@ -22,5 +22,5 @@ export declare class EasySafePayProcessor implements ProductProcessor {
22
22
  private sendRequestAndWaitWebLaunch;
23
23
  private processSubmitPay;
24
24
  private acquireApdidToken;
25
- private initSecuritySDK;
25
+ initSecuritySDK(): Promise<void>;
26
26
  }
@@ -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() {
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1726734012-dev.7",
3
+ "version": "0.0.1726734012-dev.9",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",