@alipay/ams-checkout 0.0.1746674797-dev.2 → 0.0.1746674797-dev.3

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.
@@ -1,4 +1,5 @@
1
1
  import { getDefaultEasySafePayPageUrl } from "../foundation/utils/web_app_url_utils";
2
+ import { ESP_PAGE_NAME } from "../constant/easysafepay";
2
3
  export function getChannelBehavior(paymentSessionMetaData) {
3
4
  var _paymentSessionMetaDa;
4
5
  var allowSubmitPayCallAhead = false;
@@ -76,6 +77,6 @@ export function getDoubleFaUrl(params) {
76
77
  sdkVersion = params.sdkVersion;
77
78
  var isLandscapeOrientation = false; // Web 不含横屏
78
79
 
79
- var defaultFaBaseUrl = getDefaultEasySafePayPageUrl("double-fa", env);
80
+ var defaultFaBaseUrl = getDefaultEasySafePayPageUrl(ESP_PAGE_NAME.DOUBLE_FA, env);
80
81
  return "".concat(defaultFaBaseUrl, "?scene=cashierResultPage&instanceId=").concat(instanceId, "&paymentSessionData=").concat(encodeURIComponent(paymentSessionData), "&isLandscape=").concat(isLandscapeOrientation ? 'true' : '', "&pmt=").concat(paymentMethodType, "&locale=").concat(locale, "&sdkVersion=").concat(sdkVersion);
81
82
  }
@@ -0,0 +1,6 @@
1
+ export declare enum ESP_PAGE_NAME {
2
+ API_PORTAL = "api-portal",
3
+ SDK_PORTAL = "sdk-portal",
4
+ DOUBLE_FA = "double-fa",
5
+ PRELOAD = "preload"
6
+ }
@@ -0,0 +1,7 @@
1
+ export var ESP_PAGE_NAME = /*#__PURE__*/function (ESP_PAGE_NAME) {
2
+ ESP_PAGE_NAME["API_PORTAL"] = "api-portal";
3
+ ESP_PAGE_NAME["SDK_PORTAL"] = "sdk-portal";
4
+ ESP_PAGE_NAME["DOUBLE_FA"] = "double-fa";
5
+ ESP_PAGE_NAME["PRELOAD"] = "preload";
6
+ return ESP_PAGE_NAME;
7
+ }({});
@@ -1,5 +1,6 @@
1
1
  import { DisplayTypeEnum, PaymentMethodCategoryTypeEnum, ProductSceneEnum } from '../../types';
2
2
  import { SDKMetaData } from '../index';
3
+ import { ESP_PAGE_NAME } from "../../constant/easysafepay";
3
4
  /**
4
5
  * Tell the SDK which version of the Web App to load.
5
6
  * Sent by server inside paymentSession.
@@ -91,7 +92,7 @@ export declare const getLocalCheckoutUrl: (productScene: ProductSceneEnum, envir
91
92
  export declare const defaultCheckoutUrl: (productScene: ProductSceneEnum, environment?: string) => string;
92
93
  /**
93
94
  * V2应用EasySafePay 热更新兜底URL构建规则
94
- * 1. 兜底到初始版本v1.0.1
95
+ * 1. 兜底URL版本与sdk版本保持一致
95
96
  * 2. DEV环境下html新增版本前缀
96
97
  **/
97
- export declare const getDefaultEasySafePayPageUrl: (pageName: string, env: string) => string;
98
+ export declare const getDefaultEasySafePayPageUrl: (pageName: ESP_PAGE_NAME, env: string) => string;
@@ -5,10 +5,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import { ComponentSignEnum, ProductSceneEnum } from "../../types";
8
- import { marmotMap, v2AppMarmotMap } from "../../config";
8
+ import { marmotMap, v2AppMarmotMap, sdkVersion } from "../../config";
9
9
  import { queryParse, serialize } from "../../util";
10
10
  import { isDebugLog } from "../../util/debug";
11
-
11
+ import { ESP_PAGE_NAME } from "../../constant/easysafepay";
12
12
  /**
13
13
  * Tell the SDK which version of the Web App to load.
14
14
  * Sent by server inside paymentSession.
@@ -196,7 +196,7 @@ export var defaultCheckoutUrl = function defaultCheckoutUrl(productScene) {
196
196
  var environment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "prod";
197
197
  switch (productScene) {
198
198
  case ProductSceneEnum.EASY_PAY:
199
- return getDefaultEasySafePayPageUrl("api-portal", environment);
199
+ return getDefaultEasySafePayPageUrl(ESP_PAGE_NAME.API_PORTAL, environment);
200
200
  default:
201
201
  return '';
202
202
  }
@@ -237,19 +237,18 @@ var getMatchedWebAppV2Url = function getMatchedWebAppV2Url(productScene) {
237
237
 
238
238
  /**
239
239
  * V2应用EasySafePay 热更新兜底URL构建规则
240
- * 1. 兜底到初始版本v1.0.1
240
+ * 1. 兜底URL版本与sdk版本保持一致
241
241
  * 2. DEV环境下html新增版本前缀
242
242
  **/
243
243
  export var getDefaultEasySafePayPageUrl = function getDefaultEasySafePayPageUrl(pageName, env) {
244
244
  // 生成的URL EXAMPLE:
245
245
  // const DEFAULT_DOUBLE_FA_URL_MAPPING = {
246
- // local: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.0.1/pages/double-fa/index-1.0.1.html',
247
- // dev: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.0.1/pages/double-fa/index-1.0.1.html',
248
- // sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2/easysafepay/1.0.1/pages/double-fa/index.html',
249
- // pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2/easysafepay/1.0.1/pages/double-fa/index.html',
250
- // prod: 'https://checkout.antom.com/easysafepay/1.0.1/pages/double-fa/index.html',
246
+ // local: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index-1.36.0.html',
247
+ // dev: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index-1.36.0.html',
248
+ // sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index.html',
249
+ // pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2/easysafepay/1.36.0/pages/double-fa/index.html',
250
+ // prod: 'https://checkout.antom.com/easysafepay/1.36.0/pages/double-fa/index.html',
251
251
  // };
252
- var defaultEasyPayVersion = '1.0.1';
253
252
  var environment = env || "prod";
254
- if (environment === "dev") return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(defaultEasyPayVersion, "/pages/").concat(pageName, "/index-").concat(defaultEasyPayVersion, ".html");else return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(defaultEasyPayVersion, "/pages/").concat(pageName, "/index.html");
253
+ if (environment === "dev") return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(sdkVersion, "/pages/").concat(pageName, "/index-").concat(sdkVersion, ".html");else return "".concat(v2AppMarmotMap[environment], "/easysafepay/").concat(sdkVersion, "/pages/").concat(pageName, "/index.html");
255
254
  };
@@ -14,6 +14,8 @@ import { getApplePayPaymentSession, submitPayInfo } from "../../service";
14
14
  import { EnvironmentEnum } from "../../types";
15
15
  import { device, isEmpty } from "../../util";
16
16
  import { APPLE_PAY_RECURRING_VERSION, APPLE_PAY_VERSION } from "../applepay/interface";
17
+ import { getDefaultEasySafePayPageUrl } from "../../foundation/utils/web_app_url_utils";
18
+ import { ESP_PAGE_NAME } from "../../constant/easysafepay";
17
19
  var APPLEPAYERRORENUM = /*#__PURE__*/function (APPLEPAYERRORENUM) {
18
20
  APPLEPAYERRORENUM["APPLE_PAY_MISSING_DATA"] = "APPLE_PAY_MISSING_DATA";
19
21
  APPLEPAYERRORENUM["APPLE_PAY_NOT_SUPPORTED"] = "APPLE_PAY_NOT_SUPPORTED";
@@ -70,15 +72,8 @@ export function getDoubleFaUrl(params) {
70
72
  sdkVersion = params.sdkVersion;
71
73
  var isLandscapeOrientation = false; // Web 不含横屏
72
74
 
73
- var DOUBLE_FA_URL_MAPPING = {
74
- local: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index-1.0.1.html',
75
- dev: 'http://page.alipay.net/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index-1.0.1.html',
76
- sit: 'http://page.test.alipay.net/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index.html',
77
- pre: 'https://pre.ac.alipay.com/page/antom-web-checkout-v2/easysafepay/pages/double-fa/index.html',
78
- prod: 'https://checkout.antom.com/easysafepay/pages/double-fa/index.html'
79
- };
80
- var doubleFaBaseUrl = DOUBLE_FA_URL_MAPPING[env] || DOUBLE_FA_URL_MAPPING.prod;
81
- return "".concat(doubleFaBaseUrl, "?scene=cashierResultPage&instanceId=").concat(instanceId, "&paymentSessionData=").concat(encodeURIComponent(paymentSessionData), "&isLandscape=").concat(isLandscapeOrientation ? 'true' : '', "&pmt=").concat(paymentMethodType, "&locale=").concat(locale, "&sdkVersion=").concat(sdkVersion);
75
+ var defaultFaBaseUrl = getDefaultEasySafePayPageUrl(ESP_PAGE_NAME.DOUBLE_FA, env);
76
+ return "".concat(defaultFaBaseUrl, "?scene=cashierResultPage&instanceId=").concat(instanceId, "&paymentSessionData=").concat(encodeURIComponent(paymentSessionData), "&isLandscape=").concat(isLandscapeOrientation ? 'true' : '', "&pmt=").concat(paymentMethodType, "&locale=").concat(locale, "&sdkVersion=").concat(sdkVersion);
82
77
  }
83
78
  export var handleGooglePay = function handleGooglePay(data) {
84
79
  return new Promise(function (resolve, reject) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1746674797-dev.2",
3
+ "version": "0.0.1746674797-dev.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",