@alipay/ams-checkout 0.0.1699863258-dev.0 → 0.0.1699863258-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.
@@ -120,6 +120,7 @@ export interface IpaymentSessionMetaData {
120
120
  paymentMethodInfoView?: any;
121
121
  action?: {
122
122
  autoDebitWithToken: boolean;
123
+ skipSdkQuery: boolean;
123
124
  };
124
125
  }
125
126
  export declare enum localeEnum {
@@ -256,7 +257,7 @@ export declare enum errorEnum {
256
257
  SIGNIN = "SIGNIN",
257
258
  GETSIGNPARAMSERROR = "GETSIGNPARAMSERROR"
258
259
  }
259
- export interface IrequestConfig {
260
+ export interface RequestConfig {
260
261
  env?: string;
261
262
  baseURL?: string;
262
263
  timeout?: number;
@@ -268,8 +269,11 @@ export interface IrequestConfig {
268
269
  beforerRequest?: () => void;
269
270
  afterRequest?: () => void;
270
271
  needEnvInfo?: boolean;
271
- locale?: string;
272
272
  hostSign?: string;
273
+ appId?: string;
274
+ sandbox?: boolean;
275
+ deviceId?: string;
276
+ locale?: string;
273
277
  envInfo?: Record<string, any>;
274
278
  }
275
279
  export interface CashierSdkActionQueryRequest {
@@ -279,6 +283,29 @@ export interface CashierSdkActionQueryRequest {
279
283
  notRedirectAfterComplete?: boolean;
280
284
  extParams?: any;
281
285
  }
286
+ export interface CashierSubmitPayRequest {
287
+ /**
288
+ * @description payment method type
289
+ */
290
+ paymentMethodType?: string;
291
+ /**
292
+ * @description payment factors
293
+ */
294
+ paymentFactors?: Record<string, string>;
295
+ /**
296
+ * @description 需要验证的场景
297
+ */
298
+ verifyFactors?: Record<string, string>;
299
+ paymentSessionData: string;
300
+ paymentSessionConfig?: any;
301
+ }
302
+ export interface CashierSubmitPayRequest {
303
+ paymentMethodType?: string;
304
+ paymentFactors?: Record<string, string>;
305
+ verifyFactors?: Record<string, string>;
306
+ paymentSessionData: string;
307
+ paymentSessionConfig?: any;
308
+ }
282
309
  export interface CashierSdkActionQueryResult {
283
310
  supportedLanguages?: any[];
284
311
  amountConfirmRequired?: boolean;
@@ -296,6 +323,30 @@ export interface CashierSdkActionQueryResult {
296
323
  schemeUrl?: string;
297
324
  authUrl?: string;
298
325
  }
326
+ export declare enum redirectTypeEnum {
327
+ UNSAFE_BROWSER = "UNSAFE_BROWSER",
328
+ SAFETY_BROWSER = "SAFETY_BROWSER",
329
+ INVOKE_SDK = "INVOKE_SDK"
330
+ }
331
+ export interface ActionForm {
332
+ parameters: any;
333
+ redirectUrl: any;
334
+ elementValue?: string;
335
+ redirectType?: redirectTypeEnum;
336
+ }
337
+ export interface CashierSubmitPayResult {
338
+ success: boolean;
339
+ resultCode?: string;
340
+ resultMessage?: string;
341
+ errorActions?: Record<string, string>;
342
+ errorCode?: string;
343
+ errorMessage?: string;
344
+ extendInfo?: Record<string, string>;
345
+ actionForm?: ActionForm;
346
+ normalUrl?: string;
347
+ errorStatus?: string;
348
+ message?: string;
349
+ }
299
350
  export declare enum eventCodeEnum {
300
351
  SDK_START_OF_LOADING = "SDK_START_OF_LOADING",
301
352
  SDK_END_OF_LOADING = "SDK_END_OF_LOADING",
@@ -125,6 +125,12 @@ export var errorEnum = /*#__PURE__*/function (errorEnum) {
125
125
  errorEnum["GETSIGNPARAMSERROR"] = "GETSIGNPARAMSERROR";
126
126
  return errorEnum;
127
127
  }({});
128
+ export var redirectTypeEnum = /*#__PURE__*/function (redirectTypeEnum) {
129
+ redirectTypeEnum["UNSAFE_BROWSER"] = "UNSAFE_BROWSER";
130
+ redirectTypeEnum["SAFETY_BROWSER"] = "SAFETY_BROWSER";
131
+ redirectTypeEnum["INVOKE_SDK"] = "INVOKE_SDK";
132
+ return redirectTypeEnum;
133
+ }({}); // 拉SDK
128
134
  export var eventCodeEnum = /*#__PURE__*/function (eventCodeEnum) {
129
135
  eventCodeEnum["SDK_START_OF_LOADING"] = "SDK_START_OF_LOADING";
130
136
  eventCodeEnum["SDK_END_OF_LOADING"] = "SDK_END_OF_LOADING";
package/esm/util/index.js CHANGED
@@ -225,20 +225,25 @@ var getOrSetStorageId = function getOrSetStorageId(key, value) {
225
225
  }
226
226
  };
227
227
  var checkTimeElapsed = function checkTimeElapsed() {
228
+ var key = 'antomSDKConfiglastCallTime';
229
+ var currentTime = new Date().getTime();
228
230
  try {
229
- var key = 'antomSDKConfiglastCallTime';
230
- var currentTime = new Date().getTime();
231
231
  var lastCallTime = localStorage.getItem(key);
232
232
  if (lastCallTime) {
233
233
  var elapsedTime = currentTime - parseInt(lastCallTime);
234
234
  if (elapsedTime >= 10 * 60 * 1000) {
235
+ // 记录当前调用时间
236
+ localStorage.setItem(key, currentTime.toString());
235
237
  // 超过10分钟
236
238
  return true;
237
- } else return false;
239
+ }
240
+ return false;
238
241
  }
239
- // 记录当前调用时间
240
- localStorage.setItem(key, currentTime.toString());
241
- } catch (error) {/* empty */}
242
+ } catch (error) {
243
+ /* empty */
244
+ }
245
+ // 记录当前调用时间
246
+ localStorage.setItem(key, currentTime.toString());
242
247
  return true;
243
248
  };
244
249
  export { getType, EventCenter, getViewPort, getOrigin, serialize, isJsonString, isDom, device, safeJson, isPC, queryParse, getDesignFontSize, amsSetSize, addSetFontSizeEvent, getOrSetStorageId, checkTimeElapsed };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@alipay/ams-checkout","version":"0.0.1699863258-dev.0","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","eslint-plugin-prettier":"latest","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}
1
+ {"name":"@alipay/ams-checkout","version":"0.0.1699863258-dev.2","description":"","author":"","main":"esm/index.js","module":"esm/index.js","typings":"esm/index.d.ts","files":["dist","esm","LEGAL.md","LICENSE","README.md"],"scripts":{"build":"father build","ci":"npm run lint","cov":"jest --coverage","format":"prettier --write --no-error-on-unmatched-pattern \"**/*.{js,jsx,ts,tsx,md,json,css,less}\"","lint":"eslint ./src","test":"jest"},"dependencies":{"axios":"^1.3.4","uuid":"^9.0.0"},"devDependencies":{"@babel/core":"^7.20.7","@babel/preset-env":"^7.20.2","@testing-library/jest-dom":"^5.1.1","@testing-library/react":"^9.5.0","@types/jest":"^29.2.4","@types/uuid":"^9.0.0","@typescript-eslint/eslint-plugin":"latest","@typescript-eslint/parser":"^5.60.0","babel-jest":"^29.3.1","babel-loader":"^9.1.0","babel-plugin-import":"^1.13.0","eslint":"^8.36.0","eslint-plugin-prettier":"latest","father":"^4.2.3","jest":"^29.5.0","jest-environment-jsdom":"^29.3.1","prettier":"^2.8.4","prettier-plugin-organize-imports":"^3.2.3","prettier-plugin-packagejson":"^2.4.5","ts-jest":"^29.0.3","ts-node":"^10.9.1","typescript":"^4.9.5"},"engines":{},"publishConfig":{"access":"public"}}