@alipay/ams-checkout 0.0.1699863258-dev.0 → 0.0.1699863258-dev.1
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/esm/index.d.ts
CHANGED
@@ -13,4 +13,13 @@ export declare class AMSCheckout extends AMSComponent {
|
|
13
13
|
export declare class AMSAutoDebit extends AMSCheckout {
|
14
14
|
constructor(options: IoptionsParams);
|
15
15
|
}
|
16
|
+
export declare class AMSEasyPay extends AMSCheckout {
|
17
|
+
constructor(options: IoptionsParams);
|
18
|
+
}
|
19
|
+
export declare class AMSCashierPayment extends AMSCheckout {
|
20
|
+
constructor(options: IoptionsParams);
|
21
|
+
}
|
22
|
+
export declare class AMSVaulting extends AMSCheckout {
|
23
|
+
constructor(options: IoptionsParams);
|
24
|
+
}
|
16
25
|
export default AMSCheckout;
|
package/esm/index.js
CHANGED
@@ -38,4 +38,31 @@ export var AMSAutoDebit = /*#__PURE__*/function (_AMSCheckout) {
|
|
38
38
|
}
|
39
39
|
return _createClass(AMSAutoDebit);
|
40
40
|
}(AMSCheckout);
|
41
|
+
export var AMSEasyPay = /*#__PURE__*/function (_AMSCheckout2) {
|
42
|
+
_inherits(AMSEasyPay, _AMSCheckout2);
|
43
|
+
var _super3 = _createSuper(AMSEasyPay);
|
44
|
+
function AMSEasyPay(options) {
|
45
|
+
_classCallCheck(this, AMSEasyPay);
|
46
|
+
return _super3.call(this, options);
|
47
|
+
}
|
48
|
+
return _createClass(AMSEasyPay);
|
49
|
+
}(AMSCheckout);
|
50
|
+
export var AMSCashierPayment = /*#__PURE__*/function (_AMSCheckout3) {
|
51
|
+
_inherits(AMSCashierPayment, _AMSCheckout3);
|
52
|
+
var _super4 = _createSuper(AMSCashierPayment);
|
53
|
+
function AMSCashierPayment(options) {
|
54
|
+
_classCallCheck(this, AMSCashierPayment);
|
55
|
+
return _super4.call(this, options);
|
56
|
+
}
|
57
|
+
return _createClass(AMSCashierPayment);
|
58
|
+
}(AMSCheckout);
|
59
|
+
export var AMSVaulting = /*#__PURE__*/function (_AMSCheckout4) {
|
60
|
+
_inherits(AMSVaulting, _AMSCheckout4);
|
61
|
+
var _super5 = _createSuper(AMSVaulting);
|
62
|
+
function AMSVaulting(options) {
|
63
|
+
_classCallCheck(this, AMSVaulting);
|
64
|
+
return _super5.call(this, options);
|
65
|
+
}
|
66
|
+
return _createClass(AMSVaulting);
|
67
|
+
}(AMSCheckout);
|
41
68
|
export default AMSCheckout;
|
@@ -90,7 +90,8 @@ export var getIframeUrl = function getIframeUrl(iframeParams) {
|
|
90
90
|
instanceId: instanceId,
|
91
91
|
analyticsEnabled: (analytics === null || analytics === void 0 ? void 0 : analytics.enabled) === false ? 'false' : 'true',
|
92
92
|
sdkVersion: sdkVersion,
|
93
|
-
refUrl: window.location.href
|
93
|
+
refUrl: window.location.href,
|
94
|
+
_componentStartTime: "".concat(Date.now())
|
94
95
|
});
|
95
96
|
if (LOCAL_MOCK) urlParams.LOCAL_MOCK = LOCAL_MOCK;
|
96
97
|
if (requestHost) urlParams.requestHost = requestHost;
|
@@ -47,7 +47,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
47
47
|
_defineProperty(this, "_componentSign", componentSignEnum.NONE);
|
48
48
|
_defineProperty(this, "_appLocationSearch", void 0);
|
49
49
|
_defineProperty(this, "_renderDisplayType", renderDisplayTypeEnum.popup);
|
50
|
-
this._appVersion = '1.6.
|
50
|
+
this._appVersion = '1.6.2';
|
51
51
|
this._isInitComponent = false;
|
52
52
|
this._selector = "#".concat(COMPONENT_SECTION_ID);
|
53
53
|
this.createIframeNode = function () {
|
@@ -323,8 +323,8 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
323
323
|
// eslint-disable-next-line no-async-promise-executor
|
324
324
|
this._actionQueryPromise = new Promise( /*#__PURE__*/function () {
|
325
325
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(resolve, reject) {
|
326
|
-
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3
|
327
|
-
var envInfo, params,
|
326
|
+
var _this5$_renderParams, _this5$_renderParams2, _this5$_renderParams3;
|
327
|
+
var envInfo, params, _this5$_renderParams4, _ref3, _ref3$productSceneVer, productSceneVersion, _ref3$productScene, productScene, _ref4, _ref4$action, _ref4$action2, _ref4$action2$autoDeb, autoDebitWithToken, _this5$_renderParams5, _action$web, _action$wap, action, signType;
|
328
328
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
329
329
|
while (1) switch (_context2.prev = _context2.next) {
|
330
330
|
case 0:
|
@@ -339,77 +339,68 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
339
339
|
/**
|
340
340
|
* @description card
|
341
341
|
*/
|
342
|
-
if (componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign) {
|
343
|
-
|
344
|
-
}
|
345
|
-
securityConfig = (_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 || (_this5$_renderParams4 = _this5$_renderParams4.paymentSessionMetaData) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.securityConfig;
|
346
|
-
if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign && securityConfig)) {
|
347
|
-
_context2.next = 11;
|
348
|
-
break;
|
349
|
-
}
|
350
|
-
extendInfo = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 || (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.extendInfo) || '{}';
|
351
|
-
info = JSON.parse(extendInfo);
|
352
|
-
if (!((info === null || info === void 0 ? void 0 : info.cardTokenPay) !== 'false')) {
|
353
|
-
_context2.next = 11;
|
342
|
+
if (!(componentSignEnum.CASHIER_PAYMENT_CARD === _this5._componentSign || componentSignEnum.VAULTING_CARD === _this5._componentSign)) {
|
343
|
+
_context2.next = 7;
|
354
344
|
break;
|
355
345
|
}
|
356
|
-
|
346
|
+
params.paymentMethodType = 'CARD';
|
347
|
+
_context2.next = 6;
|
357
348
|
return _this5.getDeviceIdAndLog();
|
358
|
-
case
|
349
|
+
case 6:
|
359
350
|
envInfo.deviceId = _context2.sent;
|
360
|
-
case
|
351
|
+
case 7:
|
361
352
|
if (!(componentSignEnum.EASY_PAY_WALLET === _this5._componentSign)) {
|
362
|
-
_context2.next =
|
353
|
+
_context2.next = 15;
|
363
354
|
break;
|
364
355
|
}
|
365
356
|
_ref3 = params.paymentSessionConfig || {}, _ref3$productSceneVer = _ref3.productSceneVersion, productSceneVersion = _ref3$productSceneVer === void 0 ? '' : _ref3$productSceneVer, _ref3$productScene = _ref3.productScene, productScene = _ref3$productScene === void 0 ? '' : _ref3$productScene;
|
366
|
-
_ref4 = ((_this5$
|
357
|
+
_ref4 = ((_this5$_renderParams4 = _this5._renderParams) === null || _this5$_renderParams4 === void 0 ? void 0 : _this5$_renderParams4.paymentSessionMetaData) || {}, _ref4$action = _ref4.action, _ref4$action2 = _ref4$action === void 0 ? {} : _ref4$action, _ref4$action2$autoDeb = _ref4$action2.autoDebitWithToken, autoDebitWithToken = _ref4$action2$autoDeb === void 0 ? false : _ref4$action2$autoDeb;
|
367
358
|
if (!(productScene === productSceneEnum.EASY_PAY && productSceneVersion === '2.0' && !autoDebitWithToken)) {
|
368
|
-
_context2.next =
|
359
|
+
_context2.next = 12;
|
369
360
|
break;
|
370
361
|
}
|
371
362
|
return _context2.abrupt("return", resolve({
|
372
363
|
message: 'sdk no need to make query request',
|
373
364
|
success: true
|
374
365
|
}));
|
375
|
-
case
|
376
|
-
_context2.next =
|
366
|
+
case 12:
|
367
|
+
_context2.next = 14;
|
377
368
|
return _this5.getDeviceIdAndLog();
|
378
|
-
case
|
369
|
+
case 14:
|
379
370
|
envInfo.deviceId = _context2.sent;
|
380
|
-
case
|
371
|
+
case 15:
|
381
372
|
if (!(componentSignEnum.AUTO_DEBIT_WALLET === _this5._componentSign)) {
|
382
|
-
_context2.next =
|
373
|
+
_context2.next = 22;
|
383
374
|
break;
|
384
375
|
}
|
385
|
-
action = ((_this5$
|
376
|
+
action = ((_this5$_renderParams5 = _this5._renderParams) === null || _this5$_renderParams5 === void 0 || (_this5$_renderParams5 = _this5$_renderParams5.paymentSessionMetaData) === null || _this5$_renderParams5 === void 0 ? void 0 : _this5$_renderParams5.action) || {};
|
386
377
|
signType = isPC() ? action === null || action === void 0 || (_action$web = action.web) === null || _action$web === void 0 ? void 0 : _action$web.signType : action === null || action === void 0 || (_action$wap = action.wap) === null || _action$wap === void 0 ? void 0 : _action$wap.signType;
|
387
378
|
if (!(signType === 'SMS')) {
|
388
|
-
_context2.next =
|
379
|
+
_context2.next = 20;
|
389
380
|
break;
|
390
381
|
}
|
391
382
|
return _context2.abrupt("return", resolve({
|
392
383
|
message: 'sdk no need to make query request',
|
393
384
|
success: true
|
394
385
|
}));
|
395
|
-
case
|
386
|
+
case 20:
|
396
387
|
if (!(!signType || signType !== 'REDIRECT')) {
|
397
|
-
_context2.next =
|
388
|
+
_context2.next = 22;
|
398
389
|
break;
|
399
390
|
}
|
400
391
|
return _context2.abrupt("return", resolve({
|
401
392
|
success: false
|
402
393
|
}));
|
403
|
-
case
|
394
|
+
case 22:
|
404
395
|
if (!isLocalMock()) {
|
405
|
-
_context2.next =
|
396
|
+
_context2.next = 24;
|
406
397
|
break;
|
407
398
|
}
|
408
399
|
return _context2.abrupt("return", resolve({
|
409
400
|
message: 'sdk no need to make query request',
|
410
401
|
success: true
|
411
402
|
}));
|
412
|
-
case
|
403
|
+
case 24:
|
413
404
|
queryPaymentInfo(params, {
|
414
405
|
env: _this5.AMSSDK.options.env.environment,
|
415
406
|
envInfo: envInfo
|
@@ -434,7 +425,7 @@ var ComponentApp = /*#__PURE__*/function () {
|
|
434
425
|
});
|
435
426
|
reject(err);
|
436
427
|
});
|
437
|
-
case
|
428
|
+
case 25:
|
438
429
|
case "end":
|
439
430
|
return _context2.stop();
|
440
431
|
}
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"@alipay/ams-checkout","version":"0.0.1699863258-dev.
|
1
|
+
{"name":"@alipay/ams-checkout","version":"0.0.1699863258-dev.1","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"}}
|