@alipay/ams-checkout 0.0.1755258862-dev.6 → 0.0.1755258862-dev.7

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.
@@ -25,7 +25,7 @@ import { ServiceProvider } from '..';
25
25
  // import { errorEnum } from '../../../types';
26
26
 
27
27
  import { errorEnum } from "./deps";
28
- import { appId, device, fomatGetwayError, get, hostSignMap, isPC, lightSandboxMap, queryParse, requestHost, safeJson, sdkVersion, sofaId, tntInstId } from "./deps";
28
+ import { device, fomatGetwayError, get, isPC, queryParse, safeJson, sdkVersion } from "./deps";
29
29
 
30
30
  /**
31
31
  * @author congle.zzq <congle.zzq@alipay.com>
@@ -215,6 +215,63 @@ export var RequesterService = /*#__PURE__*/function () {
215
215
  var timestamp = date.getTime(); // 获取时间戳
216
216
  var utcTimestamp = timestamp + date.getTimezoneOffset() * 60 * 1000; // 获取 UTC 时间戳
217
217
  var env = options.env || 'prod';
218
+ var _queryParse2 = queryParse(),
219
+ _light_sandbox = _queryParse2._light_sandbox,
220
+ groupId = _queryParse2.groupId,
221
+ host = _queryParse2.requestHost;
222
+ var requestHost = {
223
+ local: 'http://imgs-63.sggz00b.dev.alipay.net/mgw.htm',
224
+ dev: host || 'http://imgs-63.sggz00b.dev.alipay.net/mgw.htm',
225
+ sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
226
+ pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
227
+ prod: 'https://imgs-sea-global.alipay.com/mgw.htm',
228
+ sandbox: 'https://imgs-sea-global.alipay.com/mgw.htm'
229
+ };
230
+ var tntInstId = 'ALIPW3SG';
231
+ var appId = 'ANTOM_PAYMENT_WEB';
232
+ var sofaId = groupId || 'GROUP_20240627151021';
233
+ var hostSignMap = function hostSignMap(hostSign, env) {
234
+ var map = {
235
+ SG: 'https://imgs-sea-global.alipay.com/mgw.htm',
236
+ US: 'https://imgs-na-global.alipay.com/mgw.htm',
237
+ DE: 'https://imgs-de-global.alipay.com/mgw.htm'
238
+ };
239
+ var preMap = {
240
+ SG: 'https://imgs-sea-pre.alipay.com/mgw.htm',
241
+ US: 'https://imgs-pre.alipay.com/mgw.htm',
242
+ DE: 'https://imgs-de-pre.alipay.com/mgw.htm'
243
+ };
244
+ if (env === 'prod' || env === 'sandbox' || env === 'light_sandbox') {
245
+ return map[hostSign || 'SG'];
246
+ } else if (env === 'pre') {
247
+ return preMap[hostSign || 'SG'];
248
+ } else return '';
249
+ };
250
+ var lightSandboxMap = function lightSandboxMap() {
251
+ var operationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
252
+ var env = arguments.length > 1 ? arguments[1] : undefined;
253
+ var map = {
254
+ pre: 'https://imgs-sea-pre.alipay.com/mgw.htm',
255
+ sit: host || 'http://imgs-9.sggz00a.test.alipay.net/mgw.htm',
256
+ dev: host || 'http://imgs-13.sggz00b.stable.alipay.net/mgw.htm'
257
+ };
258
+ var typeMap = {
259
+ 'com.ipay.iexpcashier.sdkAction.query': 'com.ipay.iopensandbox.sdk.paymentSession.query'
260
+ };
261
+ var appId = 'SDK_MOCK_SANDBOX';
262
+ var sofaId = groupId || 'GROUP_20230315210531';
263
+ if (typeMap[operationType] && env === 'light_sandbox' || _light_sandbox === 'true') return {
264
+ appId: appId,
265
+ sofaId: sofaId,
266
+ baseURL: map[env],
267
+ 'Operation-Type': typeMap[operationType]
268
+ };else return {
269
+ appId: '',
270
+ sofaId: '',
271
+ baseURL: '',
272
+ 'Operation-Type': ''
273
+ };
274
+ };
218
275
  var lightSandboxConfig = lightSandboxMap(options['Operation-Type'], env); // light_sandbox
219
276
  console.log('[DEBUG] - createRequestInstance lightSandboxConfig:', lightSandboxConfig);
220
277
  var baseURL = options.baseURL || lightSandboxConfig.baseURL || hostSignMap(options === null || options === void 0 ? void 0 : options.hostSign, env) || requestHost[env];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alipay/ams-checkout",
3
- "version": "0.0.1755258862-dev.6",
3
+ "version": "0.0.1755258862-dev.7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "main": "esm/index.js",