@alipay/ams-checkout 0.0.1726713131-dev.3 → 0.0.1726734012-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/dist/umd/ams-checkout.min.js +1 -1
- package/esm/config/index.d.ts +0 -11
- package/esm/config/index.js +1 -20
- package/esm/constant/index.d.ts +0 -5
- package/esm/constant/index.js +0 -5
- package/esm/core/component/index.d.ts +2 -5
- package/esm/core/component/index.js +55 -70
- package/esm/core/instance/index.js +1 -9
- package/esm/index.d.ts +8 -8
- package/esm/index.js +8 -44
- package/esm/plugin/applepay/component.js +1 -1
- package/esm/plugin/component/cashierApp.d.ts +3 -3
- package/esm/plugin/component/cashierApp.js +3 -33
- package/esm/plugin/component/channel.js +0 -1
- package/esm/plugin/component/component.inline.style.d.ts +9 -8
- package/esm/plugin/component/component.inline.style.js +6 -87
- package/esm/plugin/component/component.popup.style.d.ts +0 -1
- package/esm/plugin/component/component.popup.style.js +0 -3
- package/esm/plugin/component/index.d.ts +1 -3
- package/esm/plugin/component/index.js +88 -123
- package/esm/plugin/component/popupWindow.style.d.ts +2 -5
- package/esm/plugin/component/popupWindow.style.js +14 -70
- package/esm/plugin/paypal/index.js +0 -1
- package/esm/plugin/type.d.ts +0 -1
- package/esm/types/index.d.ts +4 -92
- package/esm/types/index.js +0 -14
- package/esm/util/security.d.ts +0 -1
- package/esm/util/security.js +1 -1
- package/package.json +1 -1
- package/esm/core/component/address.d.ts +0 -8
- package/esm/core/component/address.js +0 -72
- package/esm/plugin/payment-element/utils.d.ts +0 -2
- package/esm/plugin/payment-element/utils.js +0 -6
@@ -1,92 +1,41 @@
|
|
1
|
-
import { AMSPOPUP_PREFIX, ANIMATION_TIME
|
2
|
-
import { getDesignFontSize } from "../../util";
|
1
|
+
import { AMSPOPUP_PREFIX, ANIMATION_TIME } from "../../constant";
|
3
2
|
|
4
3
|
// CSS样式字符串
|
5
|
-
var modalStyles = "\n .".concat(AMSPOPUP_PREFIX, "modal {\n /* \u6DFB\u52A0\u5F39\u7A97\u6837\u5F0F */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n
|
6
|
-
|
7
|
-
var curTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
8
|
-
var theme = {
|
9
|
-
night: 'dark',
|
10
|
-
gamingPurple: 'dark',
|
11
|
-
agateGreen: 'dark',
|
12
|
-
default: 'light',
|
13
|
-
nostalgicGray: 'light',
|
14
|
-
cherryBlossomPink: 'light'
|
15
|
-
};
|
16
|
-
return theme[curTheme];
|
17
|
-
};
|
18
|
-
export var createCustomSheet = function createCustomSheet() {
|
19
|
-
var curTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
20
|
-
var sheet = "\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat(curTheme === 'light' ? '#000000' : '#ffffff', " !important;\n }");
|
21
|
-
var style = document.createElement('style');
|
22
|
-
style.innerHTML = sheet;
|
23
|
-
document.head.appendChild(style);
|
24
|
-
};
|
25
|
-
export var renderPopupLoading = function renderPopupLoading(container, curTheme) {
|
26
|
-
createCustomSheet(curTheme);
|
27
|
-
var loading = document.createElement('div');
|
28
|
-
loading === null || loading === void 0 || loading.classList.add(POPUPLOADING_ID);
|
29
|
-
loading.id = POPUPLOADING_ID;
|
30
|
-
loading.innerHTML = '<div class="line"><div></div><div></div><div></div><div></div></div>';
|
31
|
-
loading.style.fontSize = "".concat(getDesignFontSize(), "px");
|
32
|
-
container.appendChild(loading);
|
33
|
-
};
|
34
|
-
export var removePopupLoading = function removePopupLoading() {
|
35
|
-
var _document$getElementB;
|
36
|
-
var isShowMockup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
37
|
-
var mockup = document.getElementById(MOCKUP_ID);
|
38
|
-
if (mockup) {
|
39
|
-
mockup.style.background = 'rgb(0, 0, 0, 0.6)';
|
40
|
-
mockup.style.display = isShowMockup ? 'block' : 'none';
|
41
|
-
}
|
42
|
-
(_document$getElementB = document.getElementById(POPUPLOADING_ID)) === null || _document$getElementB === void 0 || _document$getElementB.remove();
|
43
|
-
};
|
4
|
+
var modalStyles = "\n .".concat(AMSPOPUP_PREFIX, "modal {\n /* \u6DFB\u52A0\u5F39\u7A97\u6837\u5F0F */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* \u8BBE\u7F6E\u5F39\u7A97\u7684\u5C42\u7EA7\u4E3A 9999 */\n overflow: hidden;\n }\n\n .").concat(AMSPOPUP_PREFIX, "overlay {\n /* \u6DFB\u52A0\u8499\u5C42\u6837\u5F0F */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeIn {\n /* \u6DFB\u52A0\u6DE1\u5165\u52A8\u753B */\n animation: fadeIn ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(AMSPOPUP_PREFIX, "fadeOut {\n /* \u6DFB\u52A0\u6DE1\u51FA\u52A8\u753B */\n animation: fadeOut ").concat(ANIMATION_TIME, "ms;\n animation-fill-mode: forwards;\n }\n\n /* \u5B9A\u4E49\u6DE1\u5165\u52A8\u753B */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* \u5B9A\u4E49\u6DE1\u51FA\u52A8\u753B */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n");
|
5
|
+
|
44
6
|
// 创建和插入样式表
|
45
7
|
export var insertStyleSheet = function insertStyleSheet() {
|
46
8
|
var style = document.createElement('style');
|
47
9
|
style.innerHTML = modalStyles;
|
48
10
|
document.head.appendChild(style);
|
49
11
|
};
|
50
|
-
|
12
|
+
|
51
13
|
// 插入弹窗
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
53
14
|
export var createModal = function createModal(_ref) {
|
54
15
|
var device = _ref.device,
|
55
16
|
url = _ref.url,
|
56
17
|
widthPadding = _ref.widthPadding,
|
57
|
-
|
18
|
+
heightPadding = _ref.heightPadding;
|
58
19
|
return new Promise(function (resolve, reject) {
|
59
20
|
try {
|
60
|
-
modalDevice = device;
|
61
21
|
var overlay = document.createElement('div');
|
62
22
|
overlay.classList.add("".concat(AMSPOPUP_PREFIX, "overlay"), "".concat(AMSPOPUP_PREFIX, "fadeIn"));
|
63
23
|
var modal = document.createElement('div');
|
24
|
+
modal.classList.add("".concat(AMSPOPUP_PREFIX, "modal"), "".concat(AMSPOPUP_PREFIX, "fadeIn"));
|
64
25
|
if (device === 'desktop') {
|
65
|
-
modal.
|
66
|
-
modal.style.
|
67
|
-
modal.style.height = '620px';
|
26
|
+
modal.style.width = '600px';
|
27
|
+
modal.style.height = '464px';
|
68
28
|
modal.style.borderRadius = '12px';
|
69
29
|
} else {
|
70
|
-
modal.
|
71
|
-
modal.style.
|
72
|
-
modal.style.
|
73
|
-
modal.style.borderRadius = '12px 12px 0 0';
|
30
|
+
modal.style.width = "calc(100% - ".concat(2 * widthPadding, "px)");
|
31
|
+
modal.style.height = "calc(100% - ".concat(2 * heightPadding, "px)");
|
32
|
+
modal.style.borderRadius = '8px';
|
74
33
|
}
|
75
34
|
var iframe = document.createElement('iframe');
|
76
35
|
iframe.src = url; // 替换为实际的 URL 地址
|
77
36
|
iframe.style.border = 'none';
|
78
37
|
iframe.style.width = '100%';
|
79
38
|
iframe.style.height = '100%';
|
80
|
-
if (loadingConfig && Object.keys(loadingConfig).length) {
|
81
|
-
var _loadingConfig$theme = loadingConfig.theme,
|
82
|
-
theme = _loadingConfig$theme === void 0 ? 'default' : _loadingConfig$theme,
|
83
|
-
_loadingConfig$backgr = loadingConfig.backgroundPrimary,
|
84
|
-
backgroundPrimary = _loadingConfig$backgr === void 0 ? '#ffffff' : _loadingConfig$backgr;
|
85
|
-
var mode = getCurrentTheme(theme);
|
86
|
-
renderPopupLoading(modal, mode);
|
87
|
-
modal.style.backgroundColor = backgroundPrimary;
|
88
|
-
iframe.style.backgroundColor = backgroundPrimary;
|
89
|
-
}
|
90
39
|
modal.appendChild(iframe);
|
91
40
|
var body = document.getElementsByTagName('body')[0];
|
92
41
|
body.appendChild(overlay);
|
@@ -104,16 +53,11 @@ export var createModal = function createModal(_ref) {
|
|
104
53
|
// 销毁弹窗
|
105
54
|
export var destroyModal = function destroyModal() {
|
106
55
|
var overlay = document.querySelector(".".concat(AMSPOPUP_PREFIX, "overlay"));
|
107
|
-
var modal =
|
56
|
+
var modal = document.querySelector(".".concat(AMSPOPUP_PREFIX, "modal"));
|
108
57
|
overlay.classList.remove("".concat(AMSPOPUP_PREFIX, "fadeIn"));
|
109
58
|
overlay.classList.add("".concat(AMSPOPUP_PREFIX, "fadeOut"));
|
110
|
-
|
111
|
-
|
112
|
-
modal.classList.add("".concat(AMSPOPUP_PREFIX, "fadeOut"));
|
113
|
-
} else {
|
114
|
-
modal.classList.remove("".concat(AMSPOPUP_PREFIX, "-drawer-enter"));
|
115
|
-
modal.classList.add("".concat(AMSPOPUP_PREFIX, "-drawer-exit"));
|
116
|
-
}
|
59
|
+
modal.classList.remove("".concat(AMSPOPUP_PREFIX, "fadeIn"));
|
60
|
+
modal.classList.add("".concat(AMSPOPUP_PREFIX, "fadeOut"));
|
117
61
|
setTimeout(function () {
|
118
62
|
overlay.parentNode.removeChild(overlay);
|
119
63
|
modal.parentNode.removeChild(modal);
|
@@ -380,7 +380,6 @@ export var PaypalBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
380
380
|
break;
|
381
381
|
case PaypalActionEnum.destroyComponent:
|
382
382
|
this.destroyComponent(context, message);
|
383
|
-
break;
|
384
383
|
default:
|
385
384
|
console.log('Unknown action: ' + message.getAction());
|
386
385
|
}
|
package/esm/plugin/type.d.ts
CHANGED
package/esm/types/index.d.ts
CHANGED
@@ -5,17 +5,6 @@
|
|
5
5
|
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
|
-
export type onChange = () => onCnageResult;
|
9
|
-
interface onCnageResult {
|
10
|
-
complete: boolean;
|
11
|
-
addressValue: AddressItem[];
|
12
|
-
selectIndex: number | string;
|
13
|
-
}
|
14
|
-
export type getValue = (hasValidate: boolean) => Promise<AddressValueResult>;
|
15
|
-
interface AddressValueResult {
|
16
|
-
complete: boolean;
|
17
|
-
value: AddressItem;
|
18
|
-
}
|
19
8
|
/**
|
20
9
|
* SDK options
|
21
10
|
*/
|
@@ -28,7 +17,6 @@ export interface IoptionsParams {
|
|
28
17
|
onLog?: callOnLog;
|
29
18
|
onEventCallback?: callOnEventCallback;
|
30
19
|
onClose?: callOnClose;
|
31
|
-
onChange?: onChange;
|
32
20
|
networkMode?: string;
|
33
21
|
mode?: string;
|
34
22
|
analytics?: {
|
@@ -53,10 +41,6 @@ export interface IcreatePaymentParams {
|
|
53
41
|
backgroundColor?: string;
|
54
42
|
};
|
55
43
|
}
|
56
|
-
export declare enum ComponentSignEnumV2 {
|
57
|
-
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
58
|
-
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL"
|
59
|
-
}
|
60
44
|
export declare enum componentSignEnum {
|
61
45
|
'EASY_PAY_WALLET' = "EASY_PAY_WALLET",
|
62
46
|
'EASY_PAY_APM' = "EASY_PAY_APM",
|
@@ -67,8 +51,6 @@ export declare enum componentSignEnum {
|
|
67
51
|
'AUTO_DEBIT_PAY_WALLET' = "AUTO_DEBIT_PAY_WALLET",
|
68
52
|
'NONE' = "NONE",
|
69
53
|
'VAULTING_CARD' = "VAULTING_CARD",
|
70
|
-
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT_ALL",
|
71
|
-
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS_ALL",
|
72
54
|
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT"
|
73
55
|
}
|
74
56
|
export declare enum productSceneEnum {
|
@@ -79,16 +61,13 @@ export declare enum productSceneEnum {
|
|
79
61
|
'VAULTING' = "VAULTING",
|
80
62
|
'FLASH_BUY' = "FLASH_BUY",
|
81
63
|
'CARD_APPLE_PAY' = "CARD_APPLE_PAY",
|
82
|
-
'ELEMENT_PAYMENT' = "ELEMENT_PAYMENT",
|
83
|
-
'ELEMENT_ADDRESS' = "ELEMENT_ADDRESS",
|
84
64
|
'CHECKOUT_PAYMENT' = "CHECKOUT_PAYMENT"
|
85
65
|
}
|
86
66
|
export declare enum paymentMethodCategoryTypeEnum {
|
87
67
|
'CARD' = "CARD",
|
88
68
|
'WALLET' = "WALLET",
|
89
69
|
'BANK' = "BANK",
|
90
|
-
'APM' = "APM"
|
91
|
-
'ALL' = "ALL"
|
70
|
+
'APM' = "APM"
|
92
71
|
}
|
93
72
|
export interface DeviceIdParameter {
|
94
73
|
scene?: string;
|
@@ -101,11 +80,7 @@ export interface IcreateComponent {
|
|
101
80
|
sessionData: string;
|
102
81
|
paymentSessionData?: string;
|
103
82
|
notRedirectAfterComplete?: boolean;
|
104
|
-
appearance?:
|
105
|
-
[x: string]: any;
|
106
|
-
themeType?: string;
|
107
|
-
accentColor?: string;
|
108
|
-
};
|
83
|
+
appearance?: Record<string, any>;
|
109
84
|
merchantAppointParam?: IMerchantAppointParam;
|
110
85
|
}
|
111
86
|
export interface IappendIframeNodesParams extends IcreateComponent {
|
@@ -113,59 +88,7 @@ export interface IappendIframeNodesParams extends IcreateComponent {
|
|
113
88
|
renderDisplayType: renderDisplayTypeEnum;
|
114
89
|
selector?: Iselector;
|
115
90
|
paypalConfiguration?: IPaypalConfiguration;
|
116
|
-
|
117
|
-
configParams?: {
|
118
|
-
hideFields?: string[];
|
119
|
-
addressAutoSuggestDisabled?: addressAutoSuggestDisabledType;
|
120
|
-
};
|
121
|
-
prefillValue?: AddressItem[];
|
122
|
-
componentSession?: string;
|
123
|
-
loca?: string;
|
124
|
-
}
|
125
|
-
/** 表单地址数据 */
|
126
|
-
export interface AddressItem {
|
127
|
-
shippingName: {
|
128
|
-
firstName: string;
|
129
|
-
lastName: string;
|
130
|
-
};
|
131
|
-
/** 手机号 */
|
132
|
-
shippingPhoneNo: string;
|
133
|
-
/** 地址 */
|
134
|
-
shippingAddress: {
|
135
|
-
/** 国家 */
|
136
|
-
region: string;
|
137
|
-
/** 地址1 */
|
138
|
-
address1: string;
|
139
|
-
/** 地址2 */
|
140
|
-
address2: string;
|
141
|
-
/** 省份 */
|
142
|
-
province?: string;
|
143
|
-
/** 城市 */
|
144
|
-
city?: string;
|
145
|
-
/** 地址级联 四层 【province,city,district,subDistrict】 */
|
146
|
-
district?: string[];
|
147
|
-
/** 邮政编码 */
|
148
|
-
zipCode: string;
|
149
|
-
/** 对应地址级联数据对象 */
|
150
|
-
districtValues?: {
|
151
|
-
/** 城市 */
|
152
|
-
city?: string;
|
153
|
-
/** 区/县 */
|
154
|
-
district?: string;
|
155
|
-
/** 省份 */
|
156
|
-
province?: string;
|
157
|
-
/** 子区域 */
|
158
|
-
subDistrict?: string;
|
159
|
-
};
|
160
|
-
};
|
161
|
-
/** 备注 */
|
162
|
-
notes?: string;
|
163
|
-
open?: boolean;
|
164
|
-
/** 是否默认地址 */
|
165
|
-
prefer?: '1' | '0';
|
166
|
-
shippingId?: string;
|
167
|
-
}
|
168
|
-
type addressAutoSuggestDisabledType = 0 | 1;
|
91
|
+
}
|
169
92
|
export interface IPaypalConfiguration {
|
170
93
|
style?: object;
|
171
94
|
blockPayPalCreditButton?: boolean;
|
@@ -197,7 +120,7 @@ export interface Isubmit {
|
|
197
120
|
}
|
198
121
|
export interface IpaymentSessionConfig {
|
199
122
|
productScene: productSceneEnum;
|
200
|
-
paymentMethodCategoryType
|
123
|
+
paymentMethodCategoryType: paymentMethodCategoryTypeEnum;
|
201
124
|
productSceneVersion: string;
|
202
125
|
}
|
203
126
|
export interface IpaymentSecurityConfig {
|
@@ -649,14 +572,3 @@ export type IAppendParams = {
|
|
649
572
|
componentSign: componentSignEnum;
|
650
573
|
iframeNodesParams: IappendIframeNodesParams;
|
651
574
|
};
|
652
|
-
export interface IoptionsAddressParams {
|
653
|
-
environment?: string;
|
654
|
-
locale?: string;
|
655
|
-
onSizeChanged?: callOnSizeChanged;
|
656
|
-
onChange?: onChange;
|
657
|
-
analytics?: {
|
658
|
-
enabled: boolean;
|
659
|
-
};
|
660
|
-
product?: string;
|
661
|
-
}
|
662
|
-
export {};
|
package/esm/types/index.js
CHANGED
@@ -6,7 +6,6 @@
|
|
6
6
|
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
7
7
|
*/
|
8
8
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
9
|
-
|
10
9
|
/**
|
11
10
|
* SDK options
|
12
11
|
*/
|
@@ -16,11 +15,6 @@ export var renderDisplayTypeEnum = /*#__PURE__*/function (renderDisplayTypeEnum)
|
|
16
15
|
renderDisplayTypeEnum["inline"] = "inline";
|
17
16
|
return renderDisplayTypeEnum;
|
18
17
|
}({});
|
19
|
-
export var ComponentSignEnumV2 = /*#__PURE__*/function (ComponentSignEnumV2) {
|
20
|
-
ComponentSignEnumV2["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
21
|
-
ComponentSignEnumV2["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
22
|
-
return ComponentSignEnumV2;
|
23
|
-
}({});
|
24
18
|
export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
|
25
19
|
componentSignEnum["EASY_PAY_WALLET"] = "EASY_PAY_WALLET";
|
26
20
|
componentSignEnum["EASY_PAY_APM"] = "EASY_PAY_APM";
|
@@ -31,8 +25,6 @@ export var componentSignEnum = /*#__PURE__*/function (componentSignEnum) {
|
|
31
25
|
componentSignEnum["AUTO_DEBIT_PAY_WALLET"] = "AUTO_DEBIT_PAY_WALLET";
|
32
26
|
componentSignEnum["NONE"] = "NONE";
|
33
27
|
componentSignEnum["VAULTING_CARD"] = "VAULTING_CARD";
|
34
|
-
componentSignEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT_ALL";
|
35
|
-
componentSignEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS_ALL";
|
36
28
|
componentSignEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
37
29
|
return componentSignEnum;
|
38
30
|
}({});
|
@@ -44,8 +36,6 @@ export var productSceneEnum = /*#__PURE__*/function (productSceneEnum) {
|
|
44
36
|
productSceneEnum["VAULTING"] = "VAULTING";
|
45
37
|
productSceneEnum["FLASH_BUY"] = "FLASH_BUY";
|
46
38
|
productSceneEnum["CARD_APPLE_PAY"] = "CARD_APPLE_PAY";
|
47
|
-
productSceneEnum["ELEMENT_PAYMENT"] = "ELEMENT_PAYMENT";
|
48
|
-
productSceneEnum["ELEMENT_ADDRESS"] = "ELEMENT_ADDRESS";
|
49
39
|
productSceneEnum["CHECKOUT_PAYMENT"] = "CHECKOUT_PAYMENT";
|
50
40
|
return productSceneEnum;
|
51
41
|
}({});
|
@@ -54,12 +44,8 @@ export var paymentMethodCategoryTypeEnum = /*#__PURE__*/function (paymentMethodC
|
|
54
44
|
paymentMethodCategoryTypeEnum["WALLET"] = "WALLET";
|
55
45
|
paymentMethodCategoryTypeEnum["BANK"] = "BANK";
|
56
46
|
paymentMethodCategoryTypeEnum["APM"] = "APM";
|
57
|
-
paymentMethodCategoryTypeEnum["ALL"] = "ALL";
|
58
47
|
return paymentMethodCategoryTypeEnum;
|
59
48
|
}({});
|
60
|
-
|
61
|
-
/** 表单地址数据 */
|
62
|
-
|
63
49
|
export var payPalConfigurationIntentEnum = /*#__PURE__*/function (payPalConfigurationIntentEnum) {
|
64
50
|
payPalConfigurationIntentEnum["intent"] = "intent";
|
65
51
|
payPalConfigurationIntentEnum["capture"] = "capture";
|
package/esm/util/security.d.ts
CHANGED
@@ -18,7 +18,6 @@ export declare const sceneMap: {
|
|
18
18
|
EASYPAY: string;
|
19
19
|
EASY_PAY: string;
|
20
20
|
FLASH_BUY: string;
|
21
|
-
ELEMENT_PAYMENT: string;
|
22
21
|
};
|
23
22
|
export declare const getSecurityHost: (region: string) => string;
|
24
23
|
export declare const getSecurityScene: (product: string) => string;
|
package/esm/util/security.js
CHANGED
@@ -24,7 +24,7 @@ export var securityHost = {
|
|
24
24
|
US: 'https://open-na-global.alipay.com/api/open/risk_client',
|
25
25
|
DE: 'https://open-de-global.alipay.com/api/open/risk_client'
|
26
26
|
};
|
27
|
-
export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(
|
27
|
+
export var sceneMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, productSceneEnum.CASHIER_PAYMENT, 'Acquirer'), productSceneEnum.AUTO_DEBIT, 'Acquirer'), productSceneEnum.VAULTING, 'Acquirer'), productSceneEnum.CARD_APPLE_PAY, 'Acquirer'), "EASYPAY", 'EasyPay'), productSceneEnum.EASY_PAY, 'EasyPay'), productSceneEnum.FLASH_BUY, 'OneAccount');
|
28
28
|
export var getSecurityHost = function getSecurityHost(region) {
|
29
29
|
return securityHost[region] || securityHost[SecurityRegionEnum.SG];
|
30
30
|
};
|
package/package.json
CHANGED
@@ -1,8 +0,0 @@
|
|
1
|
-
import { IoptionsParams } from '../../types';
|
2
|
-
import { AMSComponent } from './index';
|
3
|
-
export declare class AddressComponent extends AMSComponent {
|
4
|
-
constructor(options: IoptionsParams & {
|
5
|
-
appVersion: string;
|
6
|
-
});
|
7
|
-
getValue(hasValidate?: boolean): Promise<unknown>;
|
8
|
-
}
|
@@ -1,72 +0,0 @@
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
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
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
8
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
10
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
11
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
12
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
13
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
14
|
-
/**
|
15
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
16
|
-
*
|
17
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, and/or distribute the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
18
|
-
* 1. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE; and
|
19
|
-
* 2. If applicable, the use of the Software is also subject to the terms and conditions of any non-disclosure agreement signed by you and the relevant Ant Group entity.
|
20
|
-
*/
|
21
|
-
import { v4 as uuid } from 'uuid';
|
22
|
-
import { BusManager, BusMessage } from "../bus";
|
23
|
-
import { AMSComponent } from "./index";
|
24
|
-
export var AddressComponent = /*#__PURE__*/function (_AMSComponent) {
|
25
|
-
_inherits(AddressComponent, _AMSComponent);
|
26
|
-
var _super = _createSuper(AddressComponent);
|
27
|
-
function AddressComponent(options) {
|
28
|
-
_classCallCheck(this, AddressComponent);
|
29
|
-
return _super.call(this, options);
|
30
|
-
}
|
31
|
-
_createClass(AddressComponent, [{
|
32
|
-
key: "getValue",
|
33
|
-
value: function getValue(hasValidate) {
|
34
|
-
var _this = this;
|
35
|
-
return new Promise(function (resolve, reject) {
|
36
|
-
try {
|
37
|
-
var _this$getBusActionNam;
|
38
|
-
var eventCallbackId = uuid();
|
39
|
-
_this.logger.logInfo({
|
40
|
-
title: 'sdk_event_apiGetValue'
|
41
|
-
});
|
42
|
-
var actionName = (_this$getBusActionNam = _this.getBusActionNames()) === null || _this$getBusActionNam === void 0 ? void 0 : _this$getBusActionNam.getValue;
|
43
|
-
if (actionName && BusManager.isSubscribed(actionName)) {
|
44
|
-
// 执行出错了,在通用拦截器返回
|
45
|
-
BusManager.publishForResult(new BusMessage(actionName, JSON.stringify({
|
46
|
-
appendParams: _this._appendParams,
|
47
|
-
options: _this.originOptions,
|
48
|
-
data: hasValidate
|
49
|
-
}))).then(function (busMessage) {
|
50
|
-
resolve(busMessage === null || busMessage === void 0 ? void 0 : busMessage.getJSONObject());
|
51
|
-
});
|
52
|
-
} else {
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
54
|
-
_this._eventCenter.once(eventCallbackId, function (_data) {
|
55
|
-
resolve(_data);
|
56
|
-
});
|
57
|
-
_this._componentApp.dispatchToApp({
|
58
|
-
context: {
|
59
|
-
event: 'getValue',
|
60
|
-
eventCallbackId: eventCallbackId,
|
61
|
-
data: hasValidate
|
62
|
-
}
|
63
|
-
});
|
64
|
-
}
|
65
|
-
} catch (error) {
|
66
|
-
reject(error);
|
67
|
-
}
|
68
|
-
});
|
69
|
-
}
|
70
|
-
}]);
|
71
|
-
return AddressComponent;
|
72
|
-
}(AMSComponent);
|
@@ -1,6 +0,0 @@
|
|
1
|
-
export var handlePaymentSessionConfig = function handlePaymentSessionConfig(config) {
|
2
|
-
return {
|
3
|
-
productScene: config === null || config === void 0 ? void 0 : config.productScene,
|
4
|
-
productSceneVersion: config === null || config === void 0 ? void 0 : config.productSceneVersion
|
5
|
-
};
|
6
|
-
};
|