@alipay/ams-checkout 0.0.1745390310-dev.5 → 0.0.1745390310-dev.6
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/component/component.inline.style.js +1 -1
- package/esm/component/popupWindow.style.js +4 -1
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +9 -0
- package/esm/constant/index.js +9 -0
- package/esm/core/component/element/elementContainerService/containerService.d.ts +33 -0
- package/esm/core/component/element/elementContainerService/containerService.js +123 -0
- package/esm/core/component/element/elementContainerService/index.d.ts +20 -0
- package/esm/core/component/element/elementContainerService/index.js +63 -0
- package/esm/core/component/element/elementController/index.d.ts +27 -0
- package/esm/core/component/element/elementController/index.js +478 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.js +160 -0
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/authProcessor.js +125 -0
- package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +38 -0
- package/esm/core/component/element/elementProcessor/baseElementProcessor.js +85 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +20 -0
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +373 -0
- package/esm/core/component/element/index.d.ts +8 -46
- package/esm/core/component/element/index.js +28 -922
- package/esm/core/component/element/mock.d.ts +4 -0
- package/esm/core/component/element/mock.js +365 -1
- package/esm/core/component/element/type.d.ts +42 -1
- package/esm/core/component/element/util.d.ts +60 -0
- package/esm/core/component/element/util.js +451 -0
- package/esm/core/component/index.d.ts +5 -1
- package/esm/core/component/index.js +1 -2
- package/esm/core/component/oldElement/index.d.ts +59 -0
- package/esm/core/component/oldElement/index.js +956 -0
- package/esm/core/component/oldElement/mock.d.ts +6 -0
- package/esm/core/component/oldElement/mock.js +567 -0
- package/esm/core/component/oldElement/type.d.ts +351 -0
- package/esm/core/component/oldElement/type.js +81 -0
- package/esm/foundation/core/index.d.ts +6 -1
- package/esm/foundation/core/index.js +70 -35
- package/esm/foundation/index.d.ts +14 -0
- package/esm/foundation/index.js +13 -2
- package/esm/foundation/product-processor/element/index.d.ts +7 -0
- package/esm/foundation/product-processor/element/index.js +24 -0
- package/esm/foundation/service/container/index.d.ts +6 -3
- package/esm/foundation/service/container/index.js +45 -15
- package/esm/foundation/service/container/popup.d.ts +1 -1
- package/esm/foundation/service/event-center.js +1 -0
- package/esm/foundation/service/log/keys.js +3 -1
- package/esm/index.js +1 -0
- package/esm/plugin/component/cashierApp.d.ts +1 -1
- package/esm/plugin/component/index.js +1 -1
- package/esm/types/index.d.ts +1 -1
- package/esm/types/index.js +1 -1
- package/package.json +1 -1
- /package/esm/core/component/{element → oldElement}/components/address.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/address.js +0 -0
- /package/esm/core/component/{element → oldElement}/components/auth.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/auth.js +0 -0
- /package/esm/core/component/{element → oldElement}/components/payment.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/components/payment.js +0 -0
- /package/esm/core/component/{element → oldElement}/utils.d.ts +0 -0
- /package/esm/core/component/{element → oldElement}/utils.js +0 -0
@@ -0,0 +1,351 @@
|
|
1
|
+
import { ActionForm, ConnectErrorCode, IAmount, IAmountView, IPaymentMethod } from '../../../types';
|
2
|
+
export declare enum ElementPaymentEvent {
|
3
|
+
RENDER_COMPONENT = "renderComponent",
|
4
|
+
CAPTURE_ASSET = "onCaptureAsset",
|
5
|
+
SIGN_OUT = "onSignout",
|
6
|
+
BLUR = "onBlur",
|
7
|
+
VALIDATE = "submitPay",
|
8
|
+
SUBMIT_RISK = "onSubmitRisk",
|
9
|
+
AFTER_SUBMIT = "onAfterSubmit",
|
10
|
+
SIZE_CHANGE = "onSizeChange",
|
11
|
+
LAUNCH = "onLaunch",
|
12
|
+
CALLBACK = "callback",
|
13
|
+
SEND_MUITI_APP_EVENT_TO_SDK = "sendMuitiAppEventToSdk",
|
14
|
+
LOG = "log",
|
15
|
+
HANDLE_PAYMENT = "handlePayment"
|
16
|
+
}
|
17
|
+
export declare enum ElementPaymentMethod {
|
18
|
+
CONTAINER_ELEMENT = "CONTAINER_ELEMENT",
|
19
|
+
AUTH_ELEMENT = "AUTH_ELEMENT",
|
20
|
+
ADDRESS_ELEMENT = "ADDRESS_ELEMENT",
|
21
|
+
PAYMENT_ELEMENT = "PAYMENT_ELEMENT"
|
22
|
+
}
|
23
|
+
export declare enum ThemeType {
|
24
|
+
NostalgicGray = "nostalgicGray",
|
25
|
+
Default = "default",
|
26
|
+
Night = "night",
|
27
|
+
CherryBlossomPink = "cherryBlossomPink",
|
28
|
+
GamingPurple = "gamingPurple",
|
29
|
+
AgateGreen = "agateGreen"
|
30
|
+
}
|
31
|
+
export declare enum ElementType {
|
32
|
+
auth = "auth",
|
33
|
+
address = "address",
|
34
|
+
payment = "payment"
|
35
|
+
}
|
36
|
+
export declare enum PaymentElementLayout {
|
37
|
+
Tabs = "tabs",
|
38
|
+
Accordion = "Accordion"
|
39
|
+
}
|
40
|
+
export declare enum MountElementType {
|
41
|
+
auth = "AUTH_ELEMENT",
|
42
|
+
address = "ADDRESS_ELEMENT",
|
43
|
+
payment = "PAYMENT_ELEMENT"
|
44
|
+
}
|
45
|
+
export declare const addressTheme: {
|
46
|
+
default: string;
|
47
|
+
night: string;
|
48
|
+
};
|
49
|
+
export declare enum EventCallbackCode {
|
50
|
+
SDK_CREATE_COMPONENT_ERROR = "SDK_CREATE_COMPONENT_ERROR",
|
51
|
+
SDK_CREATEPAYMENT_PARAMETER_ERROR = "SDK_CREATEPAYMENT_PARAMETER_ERROR"
|
52
|
+
}
|
53
|
+
export declare enum ELEMENT_ENVIRONMENT {
|
54
|
+
DEV = "DEV",
|
55
|
+
TEST = "TEST",
|
56
|
+
SIT = "SIT",
|
57
|
+
PRE = "PRE",
|
58
|
+
PROD = "PROD",
|
59
|
+
SANDBOX = "SANDBOX"
|
60
|
+
}
|
61
|
+
export type ELEMENT_ENVIRONMENT_TYPE = keyof typeof ELEMENT_ENVIRONMENT | (typeof ELEMENT_ENVIRONMENT)[keyof typeof ELEMENT_ENVIRONMENT];
|
62
|
+
export interface IElementOptions {
|
63
|
+
sessionData: string;
|
64
|
+
environment?: ELEMENT_ENVIRONMENT_TYPE;
|
65
|
+
locale?: string;
|
66
|
+
version?: string;
|
67
|
+
appearance?: {
|
68
|
+
theme: ThemeType.Default | ThemeType.Night;
|
69
|
+
};
|
70
|
+
onEventCallback?: ({ code, message, result }: {
|
71
|
+
code: EventCallbackCode;
|
72
|
+
message: string;
|
73
|
+
result?: any;
|
74
|
+
}) => void;
|
75
|
+
loading?: {
|
76
|
+
onStartLoading: () => void;
|
77
|
+
onEndLoading: () => void;
|
78
|
+
};
|
79
|
+
}
|
80
|
+
export interface AddressMountComponentsParams {
|
81
|
+
configParams?: AddressMountConfig;
|
82
|
+
prefillValue: Array<AddressSubmitData>;
|
83
|
+
sessionData: string;
|
84
|
+
appearance: {
|
85
|
+
themeType: string;
|
86
|
+
};
|
87
|
+
debugProps?: {
|
88
|
+
localLink: string;
|
89
|
+
};
|
90
|
+
elementProps?: {
|
91
|
+
elementLink: string;
|
92
|
+
};
|
93
|
+
}
|
94
|
+
interface BaseMountOptions<T = void> {
|
95
|
+
configParams?: T;
|
96
|
+
sessionData: string;
|
97
|
+
debugProps?: {
|
98
|
+
localLink: string;
|
99
|
+
};
|
100
|
+
elementProps?: {
|
101
|
+
elementLink: string;
|
102
|
+
};
|
103
|
+
}
|
104
|
+
type HideField = 'shippingCountry' | 'shippingName' | 'shippingPhoneNo' | 'shippingRegion' | 'shippingAddress1' | 'shippingZipCode' | 'shippingAddress2';
|
105
|
+
interface AddressMountConfig {
|
106
|
+
/**
|
107
|
+
* 是否开启地址联想功能
|
108
|
+
* 0 开启
|
109
|
+
* 1 关闭
|
110
|
+
*/
|
111
|
+
autoSaveAsDefaultAddress?: boolean;
|
112
|
+
/**
|
113
|
+
* 隐藏部分地址要素
|
114
|
+
*/
|
115
|
+
hideFields?: Array<HideField>;
|
116
|
+
}
|
117
|
+
export interface AddressMountOptions extends BaseMountOptions<AddressMountConfig> {
|
118
|
+
type: ElementType.address;
|
119
|
+
prefillValue: Array<AddressSubmitData>;
|
120
|
+
appearance?: {
|
121
|
+
theme?: ThemeType.Default | ThemeType.Night;
|
122
|
+
};
|
123
|
+
}
|
124
|
+
export interface LinkAuthMountOptions extends BaseMountOptions {
|
125
|
+
type: ElementType.auth;
|
126
|
+
appearance?: {
|
127
|
+
theme?: ThemeType;
|
128
|
+
};
|
129
|
+
}
|
130
|
+
export interface PaymentMountOptions extends BaseMountOptions {
|
131
|
+
type: ElementType.payment;
|
132
|
+
appearance?: {
|
133
|
+
theme?: ThemeType;
|
134
|
+
layout?: {
|
135
|
+
type: PaymentElementLayout;
|
136
|
+
};
|
137
|
+
variables?: {
|
138
|
+
'content-primary': string;
|
139
|
+
'content-secondary': string;
|
140
|
+
'content-tertiary': string;
|
141
|
+
'content-quaternary': string;
|
142
|
+
'background-primary': string;
|
143
|
+
'background-secondary': string;
|
144
|
+
'background-disable': string;
|
145
|
+
'background-transparency': string;
|
146
|
+
'border-primary': string;
|
147
|
+
'border-secondary': string;
|
148
|
+
'border-disable': string;
|
149
|
+
'action-normal': string;
|
150
|
+
'action-hover': string;
|
151
|
+
'action-disable': string;
|
152
|
+
'action-secondary': string;
|
153
|
+
'state-failure': string;
|
154
|
+
'state-warning': string;
|
155
|
+
'state-success': string;
|
156
|
+
'state-info': string;
|
157
|
+
'state-marketing': string;
|
158
|
+
'radius-backup': string;
|
159
|
+
'radius-module': string;
|
160
|
+
'radius-component': string;
|
161
|
+
'radius-button': string;
|
162
|
+
};
|
163
|
+
};
|
164
|
+
}
|
165
|
+
export declare enum AddressEventCallbackName {
|
166
|
+
SHIPPING_CHANGE = "SHIPPING_CHANGE"
|
167
|
+
}
|
168
|
+
interface BaseMountResult {
|
169
|
+
}
|
170
|
+
export interface AddressMountResult extends BaseMountResult {
|
171
|
+
on: (event: AddressEventCallbackName, callback: (data: any) => void) => void;
|
172
|
+
}
|
173
|
+
export interface LinkAuthMountResult extends BaseMountResult {
|
174
|
+
}
|
175
|
+
export interface PaymentMountResult extends BaseMountResult {
|
176
|
+
}
|
177
|
+
export interface EventCallbackData<T = {}> {
|
178
|
+
source?: ElementPaymentMethod;
|
179
|
+
target?: ElementPaymentMethod;
|
180
|
+
success?: boolean;
|
181
|
+
data?: T;
|
182
|
+
event?: AddressEventCallbackName;
|
183
|
+
}
|
184
|
+
export interface ValidateResult<T = {}> {
|
185
|
+
success: boolean;
|
186
|
+
data: {
|
187
|
+
success: boolean;
|
188
|
+
data: T;
|
189
|
+
};
|
190
|
+
}
|
191
|
+
export interface AuthSubmitData {
|
192
|
+
accountInfo: {
|
193
|
+
email: string;
|
194
|
+
};
|
195
|
+
}
|
196
|
+
export interface PaymentSubmitData {
|
197
|
+
paymentMethod: {
|
198
|
+
paymentMethodType: string;
|
199
|
+
paymentMethodDetail?: {
|
200
|
+
cardNo?: string;
|
201
|
+
};
|
202
|
+
cardHolderName?: {
|
203
|
+
firstName: string;
|
204
|
+
};
|
205
|
+
lastName: string;
|
206
|
+
};
|
207
|
+
paymentFactors: {
|
208
|
+
paymentRedirectUrl: string;
|
209
|
+
paymentMethodId?: string;
|
210
|
+
};
|
211
|
+
}
|
212
|
+
export interface AddressSubmitData {
|
213
|
+
shippingName: {
|
214
|
+
firstName: string;
|
215
|
+
lastName: string;
|
216
|
+
};
|
217
|
+
shippingPhoneNo: string;
|
218
|
+
shippingAddress: {
|
219
|
+
region: string;
|
220
|
+
address1: string;
|
221
|
+
address2: string;
|
222
|
+
city?: string;
|
223
|
+
province?: string;
|
224
|
+
zipCode: string;
|
225
|
+
districts?: string[];
|
226
|
+
districtValues?: {
|
227
|
+
[key: string]: string;
|
228
|
+
};
|
229
|
+
};
|
230
|
+
notes: string;
|
231
|
+
prefer: '1' | '0';
|
232
|
+
shippingId: string;
|
233
|
+
actionFlag?: 'I' | 'U' | 'D';
|
234
|
+
}
|
235
|
+
export interface SubmitServiceParams extends PaymentSubmitData {
|
236
|
+
accountInfo: AuthSubmitData['accountInfo'];
|
237
|
+
shipping?: AddressSubmitData;
|
238
|
+
}
|
239
|
+
interface SubmitResultActionForm extends ActionForm {
|
240
|
+
paymentCodeExpireTime: string;
|
241
|
+
}
|
242
|
+
export interface SubmitServiceResult {
|
243
|
+
success: boolean;
|
244
|
+
errorCode: ConnectErrorCode;
|
245
|
+
errorMessage: string;
|
246
|
+
errorStatus: string;
|
247
|
+
traceId: string;
|
248
|
+
actionForm?: SubmitResultActionForm;
|
249
|
+
codeFormViews?: Array<{
|
250
|
+
codeExpireTime?: string;
|
251
|
+
}>;
|
252
|
+
}
|
253
|
+
export interface SubmitFuncResult {
|
254
|
+
success: boolean;
|
255
|
+
msg: string;
|
256
|
+
}
|
257
|
+
declare enum AccountStatusEnum {
|
258
|
+
EFFECTIVE = "EFFECTIVE",
|
259
|
+
UNREGISTERED = "UNREGISTERED"
|
260
|
+
}
|
261
|
+
type IAccountInfo = {
|
262
|
+
email?: string;
|
263
|
+
verifyId?: string;
|
264
|
+
accountStatus?: AccountStatusEnum;
|
265
|
+
oneAccountId?: string;
|
266
|
+
needOtp?: boolean;
|
267
|
+
errorMsg?: string;
|
268
|
+
inputStatus?: 'success' | 'loading' | 'error' | 'focused' | '';
|
269
|
+
resendLeftTimes?: number;
|
270
|
+
};
|
271
|
+
interface ShippingsItem {
|
272
|
+
shippingName: {
|
273
|
+
firstName: string;
|
274
|
+
lastName: string;
|
275
|
+
};
|
276
|
+
prefer: '1' | '0';
|
277
|
+
shippingId: string;
|
278
|
+
shippingPhoneNo: string;
|
279
|
+
shippingAddress: {
|
280
|
+
region: string;
|
281
|
+
state: string;
|
282
|
+
city: string;
|
283
|
+
address1: string;
|
284
|
+
address2: string;
|
285
|
+
zipCode: string;
|
286
|
+
};
|
287
|
+
}
|
288
|
+
interface Estimate {
|
289
|
+
unit: string;
|
290
|
+
value: number;
|
291
|
+
}
|
292
|
+
interface DeliveryEstimate {
|
293
|
+
maximum: Estimate;
|
294
|
+
minimum: Estimate;
|
295
|
+
}
|
296
|
+
interface FixedAmount {
|
297
|
+
amount: number;
|
298
|
+
currency: string;
|
299
|
+
}
|
300
|
+
interface ShippingRateData {
|
301
|
+
displayName: string;
|
302
|
+
deliveryEstimate: DeliveryEstimate;
|
303
|
+
fixedAmount: FixedAmount;
|
304
|
+
}
|
305
|
+
interface ShippingAddress {
|
306
|
+
address1: string;
|
307
|
+
address2: string;
|
308
|
+
city: string;
|
309
|
+
region: string;
|
310
|
+
state: string;
|
311
|
+
zipCode: string;
|
312
|
+
}
|
313
|
+
interface IUserName {
|
314
|
+
firstName: string;
|
315
|
+
middleName?: string;
|
316
|
+
lastName: string;
|
317
|
+
fullName?: string;
|
318
|
+
}
|
319
|
+
type Shippings = ShippingsItem[];
|
320
|
+
type IPaymentMethods = IPaymentMethod[];
|
321
|
+
interface CKPShipping {
|
322
|
+
shippingRateId?: string;
|
323
|
+
shippingRateData?: ShippingRateData;
|
324
|
+
shippingAddress: ShippingAddress;
|
325
|
+
shippingFee?: IAmount;
|
326
|
+
shippingFeeView?: IAmountView;
|
327
|
+
shippingDescription?: string;
|
328
|
+
deliveryEstimate?: DeliveryEstimate;
|
329
|
+
shippingFeeId?: string;
|
330
|
+
shippingName?: IUserName;
|
331
|
+
shippingPhoneNo?: string;
|
332
|
+
shipToEmail?: string;
|
333
|
+
notes?: string;
|
334
|
+
}
|
335
|
+
export interface AccountQueryRequest {
|
336
|
+
paymentSessionData: string;
|
337
|
+
paymentSessionConfig: any;
|
338
|
+
accountInfo: IAccountInfo;
|
339
|
+
}
|
340
|
+
export interface AccountQueryResult {
|
341
|
+
accountInfo: IAccountInfo;
|
342
|
+
actionForm?: ActionForm;
|
343
|
+
paymentMethods: IPaymentMethods;
|
344
|
+
shippings: Shippings;
|
345
|
+
success: boolean;
|
346
|
+
errorCode?: string;
|
347
|
+
errorMessage?: string;
|
348
|
+
errorStatus?: string;
|
349
|
+
shippingInfo?: CKPShipping;
|
350
|
+
}
|
351
|
+
export {};
|
@@ -0,0 +1,81 @@
|
|
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 _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
4
|
+
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); }
|
5
|
+
export var ElementPaymentEvent = /*#__PURE__*/function (ElementPaymentEvent) {
|
6
|
+
ElementPaymentEvent["RENDER_COMPONENT"] = "renderComponent";
|
7
|
+
ElementPaymentEvent["CAPTURE_ASSET"] = "onCaptureAsset";
|
8
|
+
ElementPaymentEvent["SIGN_OUT"] = "onSignout";
|
9
|
+
ElementPaymentEvent["BLUR"] = "onBlur";
|
10
|
+
ElementPaymentEvent["VALIDATE"] = "submitPay";
|
11
|
+
ElementPaymentEvent["SUBMIT_RISK"] = "onSubmitRisk";
|
12
|
+
ElementPaymentEvent["AFTER_SUBMIT"] = "onAfterSubmit";
|
13
|
+
ElementPaymentEvent["SIZE_CHANGE"] = "onSizeChange";
|
14
|
+
ElementPaymentEvent["LAUNCH"] = "onLaunch";
|
15
|
+
ElementPaymentEvent["CALLBACK"] = "callback";
|
16
|
+
ElementPaymentEvent["SEND_MUITI_APP_EVENT_TO_SDK"] = "sendMuitiAppEventToSdk";
|
17
|
+
ElementPaymentEvent["LOG"] = "log";
|
18
|
+
ElementPaymentEvent["HANDLE_PAYMENT"] = "handlePayment";
|
19
|
+
return ElementPaymentEvent;
|
20
|
+
}({});
|
21
|
+
export var ElementPaymentMethod = /*#__PURE__*/function (ElementPaymentMethod) {
|
22
|
+
ElementPaymentMethod["CONTAINER_ELEMENT"] = "CONTAINER_ELEMENT";
|
23
|
+
ElementPaymentMethod["AUTH_ELEMENT"] = "AUTH_ELEMENT";
|
24
|
+
ElementPaymentMethod["ADDRESS_ELEMENT"] = "ADDRESS_ELEMENT";
|
25
|
+
ElementPaymentMethod["PAYMENT_ELEMENT"] = "PAYMENT_ELEMENT";
|
26
|
+
return ElementPaymentMethod;
|
27
|
+
}({});
|
28
|
+
export var ThemeType = /*#__PURE__*/function (ThemeType) {
|
29
|
+
ThemeType["NostalgicGray"] = "nostalgicGray";
|
30
|
+
ThemeType["Default"] = "default";
|
31
|
+
ThemeType["Night"] = "night";
|
32
|
+
ThemeType["CherryBlossomPink"] = "cherryBlossomPink";
|
33
|
+
ThemeType["GamingPurple"] = "gamingPurple";
|
34
|
+
ThemeType["AgateGreen"] = "agateGreen";
|
35
|
+
return ThemeType;
|
36
|
+
}({});
|
37
|
+
export var ElementType = /*#__PURE__*/function (ElementType) {
|
38
|
+
ElementType["auth"] = "auth";
|
39
|
+
ElementType["address"] = "address";
|
40
|
+
ElementType["payment"] = "payment";
|
41
|
+
return ElementType;
|
42
|
+
}({});
|
43
|
+
export var PaymentElementLayout = /*#__PURE__*/function (PaymentElementLayout) {
|
44
|
+
PaymentElementLayout["Tabs"] = "tabs";
|
45
|
+
PaymentElementLayout["Accordion"] = "Accordion";
|
46
|
+
return PaymentElementLayout;
|
47
|
+
}({});
|
48
|
+
export var MountElementType = /*#__PURE__*/function (MountElementType) {
|
49
|
+
MountElementType["auth"] = "AUTH_ELEMENT";
|
50
|
+
MountElementType["address"] = "ADDRESS_ELEMENT";
|
51
|
+
MountElementType["payment"] = "PAYMENT_ELEMENT";
|
52
|
+
return MountElementType;
|
53
|
+
}({});
|
54
|
+
export var addressTheme = _defineProperty(_defineProperty({}, ThemeType.Default, 'LIGHT'), ThemeType.Night, 'NIGHT');
|
55
|
+
export var EventCallbackCode = /*#__PURE__*/function (EventCallbackCode) {
|
56
|
+
EventCallbackCode["SDK_CREATE_COMPONENT_ERROR"] = "SDK_CREATE_COMPONENT_ERROR";
|
57
|
+
EventCallbackCode["SDK_CREATEPAYMENT_PARAMETER_ERROR"] = "SDK_CREATEPAYMENT_PARAMETER_ERROR";
|
58
|
+
return EventCallbackCode;
|
59
|
+
}({});
|
60
|
+
export var ELEMENT_ENVIRONMENT = /*#__PURE__*/function (ELEMENT_ENVIRONMENT) {
|
61
|
+
ELEMENT_ENVIRONMENT["DEV"] = "DEV";
|
62
|
+
ELEMENT_ENVIRONMENT["TEST"] = "TEST";
|
63
|
+
ELEMENT_ENVIRONMENT["SIT"] = "SIT";
|
64
|
+
ELEMENT_ENVIRONMENT["PRE"] = "PRE";
|
65
|
+
ELEMENT_ENVIRONMENT["PROD"] = "PROD";
|
66
|
+
ELEMENT_ENVIRONMENT["SANDBOX"] = "SANDBOX";
|
67
|
+
return ELEMENT_ENVIRONMENT;
|
68
|
+
}({});
|
69
|
+
// export type IMountOptions = AddressMountOptions | LinkAuthMountOptions | PaymentMountOptions;
|
70
|
+
|
71
|
+
export var AddressEventCallbackName = /*#__PURE__*/function (AddressEventCallbackName) {
|
72
|
+
AddressEventCallbackName["SHIPPING_CHANGE"] = "SHIPPING_CHANGE";
|
73
|
+
return AddressEventCallbackName;
|
74
|
+
}({});
|
75
|
+
|
76
|
+
// export type IMountResult = AddressMountResult | LinkAuthMountResult | PaymentMountResult;
|
77
|
+
var AccountStatusEnum = /*#__PURE__*/function (AccountStatusEnum) {
|
78
|
+
AccountStatusEnum["EFFECTIVE"] = "EFFECTIVE";
|
79
|
+
AccountStatusEnum["UNREGISTERED"] = "UNREGISTERED";
|
80
|
+
return AccountStatusEnum;
|
81
|
+
}(AccountStatusEnum || {}); // element 接口start
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IoptionsParams, ProductSceneEnum } from '../../types';
|
2
|
-
import { BizFlowStartBehavior, PaymentContext, ProductProcessor, StartBizFlowOptions } from '../index';
|
2
|
+
import { BizFlowStartBehavior, IElementStatus, PaymentContext, ProductProcessor, StartBizFlowOptions } from '../index';
|
3
3
|
import { ServiceProvider } from '../service';
|
4
4
|
/**
|
5
5
|
* @author 谦彧 <zhangmian.zm@alipay.com>
|
@@ -13,7 +13,11 @@ export declare class AntomSDKCore {
|
|
13
13
|
private sdkMetaData;
|
14
14
|
private productProcessors;
|
15
15
|
private enablePopWindowEventCallback;
|
16
|
+
private status;
|
16
17
|
constructor();
|
18
|
+
getStatus(): IElementStatus;
|
19
|
+
setStatus(status: any): void;
|
20
|
+
updatePaymentSessionData(paymentSession: string): void;
|
17
21
|
registerProcessor(productScene: string, paymentMethod: string, processor: ProductProcessor): void;
|
18
22
|
init(options: IoptionsParams, productScene: ProductSceneEnum): void;
|
19
23
|
private prepare;
|
@@ -25,4 +29,5 @@ export declare class AntomSDKCore {
|
|
25
29
|
private handleBehaviorRender;
|
26
30
|
private handleClose;
|
27
31
|
private cleanRender;
|
32
|
+
getInstanceId(): string;
|
28
33
|
}
|