@alipay/ams-checkout 0.0.1763539719-dev.0 → 0.0.1763711027-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/ams-checkout.js +1 -0
- package/dist/umd/ams-checkout.min.js +1 -1
- package/esm/config/index.js +8 -8
- package/esm/constant/auto-debit.js +15 -0
- package/esm/constant/element.js +30 -0
- package/esm/constant/index.js +3 -0
- package/esm/core/component/element/elementProcessor/addressProcessor.js +2 -3
- package/esm/core/component/element/elementProcessor/authProcessor.js +2 -3
- package/esm/core/component/element/elementProcessor/paymentProcessor.js +30 -28
- package/esm/foundation/core/index.js +27 -0
- package/esm/foundation/service/container/index.js +33 -2
- package/esm/foundation/utils/web_app_url_utils.js +10 -15
- package/esm/index.js +19 -339
- package/esm/loader/Proxy.js +364 -0
- package/esm/loader/constant.js +36 -0
- package/esm/loader/index.js +23 -0
- package/esm/loader/utils/common.js +63 -0
- package/esm/loader/utils/debugger.js +15 -0
- package/esm/loader/utils/loadSDK.js +92 -0
- package/esm/loader/utils/logger.js +59 -0
- package/esm/loader/utils/proxyPerformance.js +66 -0
- package/esm/main.js +329 -0
- package/esm/plugin/component/cashierApp.js +7 -4
- package/esm/util/integrationType.js +48 -0
- package/esm/util/logger.js +1 -1
- package/package.json +7 -1
- package/LEGAL.md +0 -6
- package/LICENSE +0 -6
- package/README.md +0 -49
- package/esm/component/channel.d.ts +0 -21
- package/esm/component/component.inline.style.d.ts +0 -10
- package/esm/component/component.popup.style.d.ts +0 -26
- package/esm/component/popupWindow.style.d.ts +0 -24
- package/esm/config/index.d.ts +0 -16
- package/esm/config/request.d.ts +0 -21
- package/esm/constant/easysafepay.d.ts +0 -16
- package/esm/constant/index.d.ts +0 -341
- package/esm/core/bus/ability/callback.d.ts +0 -9
- package/esm/core/bus/ability/security.d.ts +0 -10
- package/esm/core/bus/ability/tracker.d.ts +0 -9
- package/esm/core/bus/index.d.ts +0 -125
- package/esm/core/bus/interface.d.ts +0 -36
- package/esm/core/component/address.d.ts +0 -8
- package/esm/core/component/appPreloadProcessing.d.ts +0 -1
- package/esm/core/component/ckp/index.d.ts +0 -29
- package/esm/core/component/element/EventCenter/index.d.ts +0 -31
- package/esm/core/component/element/elementContainerService/containerService.d.ts +0 -34
- package/esm/core/component/element/elementContainerService/index.d.ts +0 -20
- package/esm/core/component/element/elementController/index.d.ts +0 -48
- package/esm/core/component/element/elementProcessor/addressProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/authProcessor.d.ts +0 -20
- package/esm/core/component/element/elementProcessor/baseElementProcessor.d.ts +0 -41
- package/esm/core/component/element/elementProcessor/paymentProcessor.d.ts +0 -22
- package/esm/core/component/element/index.d.ts +0 -13
- package/esm/core/component/element/mock.d.ts +0 -10
- package/esm/core/component/element/type.d.ts +0 -443
- package/esm/core/component/element/util.d.ts +0 -85
- package/esm/core/component/index.d.ts +0 -58
- package/esm/core/drop-in/index.d.ts +0 -22
- package/esm/core/instance/index.d.ts +0 -89
- package/esm/foundation/core/index.d.ts +0 -36
- package/esm/foundation/index.d.ts +0 -97
- package/esm/foundation/product-processor/autoDebit/deps.d.ts +0 -14
- package/esm/foundation/product-processor/autoDebit/index.d.ts +0 -48
- package/esm/foundation/product-processor/easysafepay/deps.d.ts +0 -20
- package/esm/foundation/product-processor/easysafepay/index.d.ts +0 -29
- package/esm/foundation/product-processor/element/index.d.ts +0 -7
- package/esm/foundation/service/api-bus/ability/callback.d.ts +0 -9
- package/esm/foundation/service/api-bus/ability/globalData.d.ts +0 -10
- package/esm/foundation/service/api-bus/ability/request.d.ts +0 -10
- package/esm/foundation/service/api-bus/ability/security.d.ts +0 -12
- package/esm/foundation/service/api-bus/ability/tracker.d.ts +0 -9
- package/esm/foundation/service/api-bus/busManager.d.ts +0 -127
- package/esm/foundation/service/api-bus/index.d.ts +0 -20
- package/esm/foundation/service/api-bus/interface.d.ts +0 -48
- package/esm/foundation/service/container/index.d.ts +0 -41
- package/esm/foundation/service/container/popup.d.ts +0 -31
- package/esm/foundation/service/container/utils.d.ts +0 -7
- package/esm/foundation/service/event-center.d.ts +0 -82
- package/esm/foundation/service/global-data/index.d.ts +0 -11
- package/esm/foundation/service/index.d.ts +0 -19
- package/esm/foundation/service/log/index.d.ts +0 -43
- package/esm/foundation/service/log/keys.d.ts +0 -13
- package/esm/foundation/service/log/processor.d.ts +0 -9
- package/esm/foundation/service/log/types.d.ts +0 -33
- package/esm/foundation/service/requester/deps.d.ts +0 -17
- package/esm/foundation/service/requester/requester.d.ts +0 -22
- package/esm/foundation/service/security/index.d.ts +0 -28
- package/esm/foundation/service/security/security.d.ts +0 -33
- package/esm/foundation/utils/gray_scale_utils.d.ts +0 -7
- package/esm/foundation/utils/payment_context_utils.d.ts +0 -13
- package/esm/foundation/utils/payment_product_utils.d.ts +0 -13
- package/esm/foundation/utils/preload_helper.d.ts +0 -21
- package/esm/foundation/utils/redirect_utils.d.ts +0 -11
- package/esm/foundation/utils/system_events.d.ts +0 -4
- package/esm/foundation/utils/web_app_url_utils.d.ts +0 -116
- package/esm/index.d.ts +0 -54
- package/esm/plugin/applepay/component.d.ts +0 -50
- package/esm/plugin/applepay/index.d.ts +0 -17
- package/esm/plugin/applepay/interface.d.ts +0 -161
- package/esm/plugin/applepay/service.d.ts +0 -54
- package/esm/plugin/component/cashierApp.d.ts +0 -38
- package/esm/plugin/component/channel.d.ts +0 -57
- package/esm/plugin/component/component.inline.style.d.ts +0 -10
- package/esm/plugin/component/component.popup.style.d.ts +0 -25
- package/esm/plugin/component/index.d.ts +0 -133
- package/esm/plugin/component/popupWindow.style.d.ts +0 -11
- package/esm/plugin/const.d.ts +0 -2
- package/esm/plugin/drop-in/index.d.ts +0 -71
- package/esm/plugin/payment-element/utils.d.ts +0 -2
- package/esm/plugin/paypal/index.d.ts +0 -20
- package/esm/plugin/type.d.ts +0 -34
- package/esm/plugin/utils.d.ts +0 -6
- package/esm/request/index.d.ts +0 -9
- package/esm/request/utils.d.ts +0 -28
- package/esm/service/index.d.ts +0 -13
- package/esm/types/index.d.ts +0 -854
- package/esm/util/createIframeNode.d.ts +0 -6
- package/esm/util/debug.d.ts +0 -1
- package/esm/util/get.d.ts +0 -25
- package/esm/util/getBackScheme.d.ts +0 -5
- package/esm/util/index.d.ts +0 -61
- package/esm/util/intl-callapp/es/browser.d.ts +0 -21
- package/esm/util/intl-callapp/es/evoke.d.ts +0 -13
- package/esm/util/intl-callapp/es/generate.d.ts +0 -29
- package/esm/util/intl-callapp/es/index.d.ts +0 -43
- package/esm/util/intl-callapp/es/main.d.ts +0 -41
- package/esm/util/intl-callapp/es/openWallet.d.ts +0 -15
- package/esm/util/intl-callapp/es/types.d.ts +0 -46
- package/esm/util/intl-callapp/es/utils/config.d.ts +0 -24
- package/esm/util/intl-callapp/es/utils/index.d.ts +0 -15
- package/esm/util/logger.d.ts +0 -64
- package/esm/util/mock.d.ts +0 -1
- package/esm/util/redirect.d.ts +0 -6
- package/esm/util/security.d.ts +0 -34
- package/esm/util/spm-map.d.ts +0 -211
- package/esm/util/storage.d.ts +0 -2
- package/esm/util/upgrade.d.ts +0 -39
- package/esm/util/versionCompare.d.ts +0 -15
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* 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:
|
|
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
|
-
* 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
|
-
*/
|
|
8
|
-
export type Version = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
9
|
-
export declare const APPLE_PAY_VERSION = 2;
|
|
10
|
-
export declare const APPLE_PAY_RECURRING_VERSION = 14;
|
|
11
|
-
export interface IApplePayValidateMerchantEvent {
|
|
12
|
-
validationURL: string;
|
|
13
|
-
}
|
|
14
|
-
export type ApplePayMerchantCapability = 'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit';
|
|
15
|
-
export type PaymentNetwork = 'amex' | 'cartesBancaires' | 'chinaUnionPay' | 'discover' | 'eftpos' | 'electron' | 'elo' | 'interac' | 'jcb' | 'mada' | 'maestro' | 'masterCard' | 'privateLabel' | 'visa' | 'vPay';
|
|
16
|
-
export interface IApplePayContactField {
|
|
17
|
-
email: string;
|
|
18
|
-
name: string;
|
|
19
|
-
phone: string;
|
|
20
|
-
postalAddress: string;
|
|
21
|
-
phoneticName: string;
|
|
22
|
-
}
|
|
23
|
-
export interface IApplePayPaymentContact {
|
|
24
|
-
phoneNumber: string;
|
|
25
|
-
emailAddress: string;
|
|
26
|
-
givenName: string;
|
|
27
|
-
familyName: string;
|
|
28
|
-
phoneticGivenName: string;
|
|
29
|
-
phoneticFamilyName: string;
|
|
30
|
-
addressLines: string;
|
|
31
|
-
subLocality: string;
|
|
32
|
-
locality: string;
|
|
33
|
-
postalCode: string;
|
|
34
|
-
subAdministrativeArea: string;
|
|
35
|
-
administrativeArea: string;
|
|
36
|
-
country: string;
|
|
37
|
-
countryCode: string;
|
|
38
|
-
}
|
|
39
|
-
export type IApplePayLineItemType = 'final' | 'pending';
|
|
40
|
-
export type ApplePayPaymentTiming = 'immediate' | 'recurring' | 'deferred' | 'automaticReload';
|
|
41
|
-
export type ApplePayRecurringPaymentDateUnit = 'year' | 'month' | 'day' | 'hour' | 'minute';
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
{
|
|
45
|
-
"label": "Subscription",
|
|
46
|
-
"amount": "20.00",
|
|
47
|
-
"type": "final",
|
|
48
|
-
"paymentTiming": "recurring",
|
|
49
|
-
"recurringPaymentStartDate": new Date("2022-01-01T00:00:00"),
|
|
50
|
-
"recurringPaymentIntervalUnit": "month",
|
|
51
|
-
"recurringPaymentIntervalCount": 6,
|
|
52
|
-
"recurringPaymentEndDate": new Date("2024-01-01T00:00:00"),
|
|
53
|
-
}
|
|
54
|
-
*/
|
|
55
|
-
export interface IApplePayLineItem {
|
|
56
|
-
/**
|
|
57
|
-
* A value that indicates whether the line item is final or pending.
|
|
58
|
-
*/
|
|
59
|
-
type: IApplePayLineItemType;
|
|
60
|
-
/**
|
|
61
|
-
* A required value that’s a short, localized description of the line item.
|
|
62
|
-
*/
|
|
63
|
-
label: string;
|
|
64
|
-
/**
|
|
65
|
-
* A required value that’s the monetary amount of the line item.
|
|
66
|
-
*/
|
|
67
|
-
amount: string;
|
|
68
|
-
paymentTiming?: ApplePayPaymentTiming;
|
|
69
|
-
recurringPaymentStartDate?: Date;
|
|
70
|
-
recurringPaymentEndDate?: Date;
|
|
71
|
-
recurringPaymentIntervalUnit?: ApplePayRecurringPaymentDateUnit;
|
|
72
|
-
recurringPaymentIntervalCount?: number;
|
|
73
|
-
deferredPaymentDate?: Date;
|
|
74
|
-
automaticReloadPaymentThresholdAmount?: string;
|
|
75
|
-
}
|
|
76
|
-
export type applePayShippingType = 'shipping' | 'delivery' | 'storePickup' | 'servicePickup';
|
|
77
|
-
export interface IApplePayShippingMethod {
|
|
78
|
-
label: string;
|
|
79
|
-
detail: string;
|
|
80
|
-
amount: string;
|
|
81
|
-
identifier: string;
|
|
82
|
-
}
|
|
83
|
-
export interface IApplePayPayment {
|
|
84
|
-
token: any;
|
|
85
|
-
billingContact?: IApplePayPaymentContact;
|
|
86
|
-
shippingContact?: IApplePayPaymentContact;
|
|
87
|
-
}
|
|
88
|
-
export interface IApplePayPaymentAuthorizedEvent {
|
|
89
|
-
payment: IApplePayPayment;
|
|
90
|
-
}
|
|
91
|
-
export type status = 'STATUS_SUCCESS' | 'STATUS_FAILURE' | 'STATUS_INVALID_BILLING_POSTAL_ADDRESS' | 'STATUS_INVALID_SHIPPING_POSTAL_ADDRESS' | 'STATUS_INVALID_SHIPPING_CONTACT' | 'STATUS_PIN_INCORRECT' | 'STATUS_PIN_LOCKOUT' | 'STATUS_PIN_REQUIRED';
|
|
92
|
-
export interface IApplePayPaymentAuthorizationResult {
|
|
93
|
-
status: any;
|
|
94
|
-
errors?: string[];
|
|
95
|
-
}
|
|
96
|
-
export interface IApplePayPaymentRequest {
|
|
97
|
-
merchantCapabilities: ApplePayMerchantCapability[];
|
|
98
|
-
supportedNetworks: PaymentNetwork[];
|
|
99
|
-
countryCode: string;
|
|
100
|
-
requiredBillingContactFields?: IApplePayContactField[];
|
|
101
|
-
billingContact?: IApplePayPaymentContact;
|
|
102
|
-
requiredShippingContactFields?: IApplePayContactField[];
|
|
103
|
-
shippingContact?: IApplePayPaymentContact;
|
|
104
|
-
applicationData?: string;
|
|
105
|
-
supportedCountries?: string[];
|
|
106
|
-
total: IApplePayLineItem;
|
|
107
|
-
lineItems?: IApplePayLineItem[];
|
|
108
|
-
currencyCode: string;
|
|
109
|
-
shippingType?: applePayShippingType;
|
|
110
|
-
shippingMethods?: IApplePayShippingMethod[];
|
|
111
|
-
recurringPaymentRequest?: IApplePayRecurringPaymentRequest;
|
|
112
|
-
}
|
|
113
|
-
export interface IApplePayRecurringPaymentRequest {
|
|
114
|
-
/**
|
|
115
|
-
* A description of the recurring payment that Apple Pay displays to the user in the payment sheet.
|
|
116
|
-
*/
|
|
117
|
-
paymentDescription: string;
|
|
118
|
-
/**
|
|
119
|
-
* A localized billing agreement that the payment sheet displays to the user before the user authorizes the payment.
|
|
120
|
-
*/
|
|
121
|
-
billingAgreement?: string;
|
|
122
|
-
/**
|
|
123
|
-
* The regular billing cycle for the recurring payment, including start and end dates, an interval, and an interval count.
|
|
124
|
-
*/
|
|
125
|
-
regularBilling: IApplePayLineItem;
|
|
126
|
-
/**
|
|
127
|
-
* 订阅试用的周期控制,暂时不需要
|
|
128
|
-
* The trial billing cycle for the recurring payment.
|
|
129
|
-
*/
|
|
130
|
-
trialBilling?: IApplePayLineItem;
|
|
131
|
-
/**
|
|
132
|
-
* A URL to a web page where the user can update or delete the payment method for the recurring payment.
|
|
133
|
-
*/
|
|
134
|
-
managementURL: string;
|
|
135
|
-
/**
|
|
136
|
-
* A URL you provide for receiving life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.
|
|
137
|
-
*/
|
|
138
|
-
tokenNotificationURL?: string;
|
|
139
|
-
}
|
|
140
|
-
export interface IApplePaySession {
|
|
141
|
-
supportsVersion?: (version: Version) => boolean;
|
|
142
|
-
canMakePayments?: () => boolean;
|
|
143
|
-
canMakePaymentsWithActiveCard?: (merchantIdentifier: string) => Promise<boolean>;
|
|
144
|
-
begin: () => void;
|
|
145
|
-
onvalidatemerchant: (event: IApplePayValidateMerchantEvent) => void;
|
|
146
|
-
completeMerchantValidation: (merchantSession: any) => void;
|
|
147
|
-
onpaymentauthorized: (event: IApplePayPaymentAuthorizedEvent) => void;
|
|
148
|
-
completePayment: (result: IApplePayPaymentAuthorizationResult) => void;
|
|
149
|
-
oncancel?: () => void;
|
|
150
|
-
abort?: () => void;
|
|
151
|
-
}
|
|
152
|
-
export type IGetMerchantSession = (params: {
|
|
153
|
-
displayName?: string;
|
|
154
|
-
merchantIdentifier?: string;
|
|
155
|
-
validationUrl: string;
|
|
156
|
-
}) => Promise<any>;
|
|
157
|
-
export type ICompletePaymentAuthorized = (params: {
|
|
158
|
-
paymentToken?: string;
|
|
159
|
-
}) => Promise<any>;
|
|
160
|
-
export type ICompleteApplePay = (data: any) => void;
|
|
161
|
-
export type ILogError = (code: string, msg: string, error?: any) => void;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022 International Business Group, Ant Group. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* 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:
|
|
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
|
-
* 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
|
-
*/
|
|
8
|
-
import { IGetMerchantSession, ICompletePaymentAuthorized, ICompleteApplePay, ILogError } from './interface';
|
|
9
|
-
import { ApplePaySubTypeEnum, IPaymentSessionMetaData } from '../../types';
|
|
10
|
-
import type { Logger } from '../../util/logger';
|
|
11
|
-
/**
|
|
12
|
-
* Apple Pay Service
|
|
13
|
-
*/
|
|
14
|
-
declare class ApplePayService {
|
|
15
|
-
private merchantIdentifier;
|
|
16
|
-
private merchantName;
|
|
17
|
-
private session;
|
|
18
|
-
private paymentState;
|
|
19
|
-
private getMerchantSession;
|
|
20
|
-
private completePaymentAuthorized;
|
|
21
|
-
private completeApplePay;
|
|
22
|
-
private logError;
|
|
23
|
-
private isRecurring;
|
|
24
|
-
private logger;
|
|
25
|
-
constructor(logger: Logger);
|
|
26
|
-
/**
|
|
27
|
-
* set Apple Pay Params
|
|
28
|
-
* @param getMerchantSession
|
|
29
|
-
* @param completePaymentAuthorized
|
|
30
|
-
* @param completeApplePay
|
|
31
|
-
* @param logError
|
|
32
|
-
* @param applePayTrace
|
|
33
|
-
*/
|
|
34
|
-
setApplePayParams(getMerchantSession: IGetMerchantSession, completePaymentAuthorized: ICompletePaymentAuthorized, completeApplePay: ICompleteApplePay, logError: ILogError): void;
|
|
35
|
-
/**
|
|
36
|
-
* Is Apple Pay Enabled
|
|
37
|
-
* @param subTypeEnum
|
|
38
|
-
* @returns
|
|
39
|
-
*/
|
|
40
|
-
static canMakePayments(subTypeEnum?: ApplePaySubTypeEnum): any;
|
|
41
|
-
/**
|
|
42
|
-
* has Active Card in Apple Pay
|
|
43
|
-
* @param merchantIdentifier
|
|
44
|
-
*/
|
|
45
|
-
hasActiveCard(merchantIdentifier: string): Promise<boolean>;
|
|
46
|
-
private onvalidatemerchant;
|
|
47
|
-
private sessionAbort;
|
|
48
|
-
private onpaymentauthorized;
|
|
49
|
-
/**
|
|
50
|
-
* Start Pay
|
|
51
|
-
*/
|
|
52
|
-
startPay: (param: IPaymentSessionMetaData) => void;
|
|
53
|
-
}
|
|
54
|
-
export default ApplePayService;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ComponentSignEnum, DisplayTypeEnum, Ianalytics } from '../../types';
|
|
2
|
-
export declare const getAppVersion: (_extendInfo: string, productScene: string, mid: string, sendLog?: boolean) => string;
|
|
3
|
-
export declare const getFinalProductSceneVersion: (componentSign: ComponentSignEnum, productSceneVersion: string) => string;
|
|
4
|
-
export declare const getAppPath: (environment: string, appVersion: string, componentSign: ComponentSignEnum, productScene: string, productSceneVersion: string, extendInfo: string, mid: string, sendLog?: boolean, elementLink?: string) => any;
|
|
5
|
-
export declare const getAppDomain: (domainParams: {
|
|
6
|
-
environment: string;
|
|
7
|
-
appVersion: string;
|
|
8
|
-
componentSign: ComponentSignEnum;
|
|
9
|
-
productScene: string;
|
|
10
|
-
productSceneVersion: string;
|
|
11
|
-
extendInfo: string;
|
|
12
|
-
mid: string;
|
|
13
|
-
elementLink: string;
|
|
14
|
-
}) => string;
|
|
15
|
-
export declare const getIframeUrl: (iframeParams: {
|
|
16
|
-
componentSign: ComponentSignEnum;
|
|
17
|
-
analytics?: Ianalytics;
|
|
18
|
-
productScene: string;
|
|
19
|
-
productSceneVersion: string;
|
|
20
|
-
environment: string;
|
|
21
|
-
appVersion: string;
|
|
22
|
-
extendInfo?: string;
|
|
23
|
-
locale?: string;
|
|
24
|
-
instanceId: string;
|
|
25
|
-
renderDisplayType: DisplayTypeEnum;
|
|
26
|
-
isPreload?: string;
|
|
27
|
-
hostSign?: string;
|
|
28
|
-
elementLink?: string;
|
|
29
|
-
mid?: string;
|
|
30
|
-
}) => {
|
|
31
|
-
path: string;
|
|
32
|
-
locationSearch: string;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* @description Create iframe
|
|
36
|
-
*/
|
|
37
|
-
export declare const createIframe: (mode: string, platform: 'mobile' | 'desktop') => HTMLIFrameElement;
|
|
38
|
-
export declare const createPreloadIframe: (channelType: any, version: any) => HTMLIFrameElement;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { type EventPayload, type IPaymentSessionMetaData } from '../../types';
|
|
2
|
-
import { Logger } from '../../util/logger';
|
|
3
|
-
export type IChannelBehavior = {
|
|
4
|
-
usePaymentSessionAsQueryResult: boolean;
|
|
5
|
-
submitPayInSdk: boolean;
|
|
6
|
-
createIframeNode: boolean;
|
|
7
|
-
loadApp: boolean;
|
|
8
|
-
buildSubmitPayExtParams?: (params: GetDoubleFaParams) => any;
|
|
9
|
-
allowClickOutsideClose?: boolean;
|
|
10
|
-
};
|
|
11
|
-
type GetDoubleFaParams = {
|
|
12
|
-
instanceId: string;
|
|
13
|
-
paymentSessionData: string;
|
|
14
|
-
paymentSessionObj: IPaymentSessionMetaData;
|
|
15
|
-
locale: string;
|
|
16
|
-
paymentMethodType: string;
|
|
17
|
-
env: string;
|
|
18
|
-
sdkVersion: string;
|
|
19
|
-
notRedirectAfterComplete: boolean;
|
|
20
|
-
};
|
|
21
|
-
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData, notRedirectAfterComplete?: boolean): IChannelBehavior | undefined;
|
|
22
|
-
export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
|
|
23
|
-
export declare const handleGooglePay: (data: EventPayload) => Promise<unknown>;
|
|
24
|
-
export declare class ApplePaySdk {
|
|
25
|
-
private APPLESDKURL;
|
|
26
|
-
private session;
|
|
27
|
-
private paymentSessionData;
|
|
28
|
-
private parseData;
|
|
29
|
-
/**
|
|
30
|
-
* @description 支付状态,pending:支付中,normal:正常
|
|
31
|
-
*/
|
|
32
|
-
private paymentStatus;
|
|
33
|
-
private logger;
|
|
34
|
-
constructor({ paymentSessionData, parseData, logger, }: {
|
|
35
|
-
paymentSessionData: string;
|
|
36
|
-
parseData: IPaymentSessionMetaData;
|
|
37
|
-
logger: Logger;
|
|
38
|
-
});
|
|
39
|
-
startPay(): Promise<unknown>;
|
|
40
|
-
begin(): Promise<unknown>;
|
|
41
|
-
private submitPay;
|
|
42
|
-
private setPayStatus;
|
|
43
|
-
initApplePaySession(): Promise<never>;
|
|
44
|
-
private abortSession;
|
|
45
|
-
private get initSessionParams();
|
|
46
|
-
private get isRequiredParameters();
|
|
47
|
-
private isCanMakePayments;
|
|
48
|
-
private loadApplePaySdk;
|
|
49
|
-
private get checkScriptIsLoaded();
|
|
50
|
-
/**
|
|
51
|
-
* @description 非标方案,sdk目前无法直接监听国内不支持弹窗的关闭操作
|
|
52
|
-
*/
|
|
53
|
-
private addEventListener;
|
|
54
|
-
private getDeviceId;
|
|
55
|
-
}
|
|
56
|
-
export declare const isSkipRenderPaymentMethod: (parseData: IPaymentSessionMetaData) => boolean;
|
|
57
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ComponentSignEnum, PlatformEnum } from '../../types';
|
|
2
|
-
interface Options {
|
|
3
|
-
componentSign?: ComponentSignEnum;
|
|
4
|
-
type: 'tabs' | 'Accordion';
|
|
5
|
-
isExpressCheckout?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const inlineComponentAddCss: () => void;
|
|
8
|
-
export declare const addInlineLoading: (_selector: HTMLDivElement, platform: PlatformEnum, options: Options) => void;
|
|
9
|
-
export declare const createInlineBaseElement: (selector: string, containerId?: string, selectorId?: string) => HTMLDivElement;
|
|
10
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { PlatformEnum } from '../../types';
|
|
2
|
-
export declare const componentCss = ".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.ams-component-mockup-hidden{\nanimation: ams-component-mockup-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** \u52A0\u8F7D\u52A8\u753B **/\n@-webkit-keyframes ams-component-mockup-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n";
|
|
3
|
-
export declare const componentAddCSS: () => void;
|
|
4
|
-
export declare const createBaseElement: (platform: PlatformEnum, closeBtnFunc: () => void) => HTMLDivElement;
|
|
5
|
-
export declare const createCloseBtn: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
|
|
6
|
-
export declare const createMaskCloseButton: (platform: PlatformEnum, closeBtnFunc: () => void) => void;
|
|
7
|
-
/**
|
|
8
|
-
* 弹出离开挽留弹窗
|
|
9
|
-
* @param platform
|
|
10
|
-
* @param remainBtnFunc
|
|
11
|
-
* @param leaveBtnFunc
|
|
12
|
-
*/
|
|
13
|
-
export declare const createRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
|
14
|
-
export declare const hideRetentionPopup: () => void;
|
|
15
|
-
export declare const removeRetentionPopup: (platform: PlatformEnum, remainBtnFunc: () => void, leaveBtnFunc: () => void) => void;
|
|
16
|
-
export declare const createMockup: (options: {
|
|
17
|
-
platform: PlatformEnum;
|
|
18
|
-
onClickOutside: () => void;
|
|
19
|
-
closeBtnFunc: () => void;
|
|
20
|
-
}) => void;
|
|
21
|
-
export declare const addPopupLoading: () => void;
|
|
22
|
-
export declare const handleDeclareInfo: ({ closeDialogData }: {
|
|
23
|
-
closeDialogData: any;
|
|
24
|
-
}) => void;
|
|
25
|
-
export declare const slideInAndOutKeyframes: (id: any, height: any) => string;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import type AMSCheckout from '../../core/instance';
|
|
2
|
-
import type { EventPayload, EventPayloadContext, IappendIframeNodesParams, IMerchantAppointParam, Iselector } from '../../types';
|
|
3
|
-
import { ComponentSignEnum, DeviceIdParameter, DisplayTypeEnum, PlatformEnum } from '../../types';
|
|
4
|
-
type IrenderFuncParams = (context: ComponentApp, selector: Iselector, renderDisplayType: DisplayTypeEnum) => Promise<void>;
|
|
5
|
-
export default class ComponentApp {
|
|
6
|
-
app: null | HTMLIFrameElement;
|
|
7
|
-
AMSSDK: AMSCheckout;
|
|
8
|
-
platform: PlatformEnum;
|
|
9
|
-
_performanceData: any[];
|
|
10
|
-
_loadAppPromiseResolve: ((value: boolean) => void) | null;
|
|
11
|
-
_isInitComponent: boolean;
|
|
12
|
-
private _globalData?;
|
|
13
|
-
private popupApp?;
|
|
14
|
-
private appDomain;
|
|
15
|
-
private createIframeNode;
|
|
16
|
-
private createPreloadIframeNode;
|
|
17
|
-
private _selector;
|
|
18
|
-
private _appVersion;
|
|
19
|
-
private _isRetention;
|
|
20
|
-
private _allowSubmitPayCallAhead;
|
|
21
|
-
private _actionQueryPromise;
|
|
22
|
-
private _actionSubmitPromise;
|
|
23
|
-
private _renderParams;
|
|
24
|
-
private _componentSign;
|
|
25
|
-
private _appLocationSearch;
|
|
26
|
-
private _renderDisplayType;
|
|
27
|
-
private _multipleCallbackEvents;
|
|
28
|
-
private _isAppWebview;
|
|
29
|
-
private _isNativeAppWebview;
|
|
30
|
-
_merchantAppointParam: IMerchantAppointParam;
|
|
31
|
-
private _webAppHeartBeatTimeoutFn;
|
|
32
|
-
private _hasRenderComponent;
|
|
33
|
-
constructor(componentOption?: {
|
|
34
|
-
appVersion?: string;
|
|
35
|
-
});
|
|
36
|
-
/**
|
|
37
|
-
* @description Cancel listening and destroy the dom
|
|
38
|
-
*/
|
|
39
|
-
logoutPlugin(): void;
|
|
40
|
-
/**
|
|
41
|
-
* @description When SDK registers plug-ins, it is a required function to receive SDK instances
|
|
42
|
-
*/
|
|
43
|
-
applyPlugin(AMSSDK: AMSCheckout): void;
|
|
44
|
-
private initLoggerMeta;
|
|
45
|
-
/**
|
|
46
|
-
* @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
|
|
47
|
-
*/
|
|
48
|
-
setRender(renderFunc: IrenderFuncParams): void;
|
|
49
|
-
setPreloadRender(renderFunc: any): void;
|
|
50
|
-
private initSecurity;
|
|
51
|
-
private logDeviceId;
|
|
52
|
-
getDeviceIdAndLog(deviceIdParameter?: DeviceIdParameter, isPolling?: boolean): Promise<string>;
|
|
53
|
-
/**
|
|
54
|
-
* @description render iframe content
|
|
55
|
-
*/
|
|
56
|
-
appendIframeNodes(componentSign: ComponentSignEnum, renderParams: IappendIframeNodesParams): Promise<void>;
|
|
57
|
-
appendPreloadIframeNodes(componentSign: any, productSceneVersion: any): void;
|
|
58
|
-
private setParameterDefaultValues;
|
|
59
|
-
private renderInlineLoading;
|
|
60
|
-
private renderPopupLoading;
|
|
61
|
-
_createLoadAppPromise(loadTimeLimit?: number): Promise<unknown>;
|
|
62
|
-
/**
|
|
63
|
-
* @description Interface request
|
|
64
|
-
*/
|
|
65
|
-
private createActionQueryPromise;
|
|
66
|
-
private createSubmitPromise;
|
|
67
|
-
private cleanElement;
|
|
68
|
-
private createPreloadApp;
|
|
69
|
-
/**
|
|
70
|
-
* @description Create app
|
|
71
|
-
*/
|
|
72
|
-
private createApp;
|
|
73
|
-
private listener;
|
|
74
|
-
private resizeListener;
|
|
75
|
-
private createDialog;
|
|
76
|
-
private getDeviceIdAndCallback;
|
|
77
|
-
private getUserAgentAndCallback;
|
|
78
|
-
private returnDataAndCallback;
|
|
79
|
-
/**
|
|
80
|
-
* @description Initialize subscription iframe message
|
|
81
|
-
*/
|
|
82
|
-
private addEventListener;
|
|
83
|
-
private removeEventListener;
|
|
84
|
-
private elementEventCallback;
|
|
85
|
-
/**
|
|
86
|
-
* @description Processing messages from iframe
|
|
87
|
-
*/
|
|
88
|
-
_handleAppMessage(data: EventPayload): void;
|
|
89
|
-
private logEventCallback;
|
|
90
|
-
private dismissLoadingFunc;
|
|
91
|
-
private updateMaskCloseBtn;
|
|
92
|
-
private handleSizeChanged;
|
|
93
|
-
private handleAuthUrlInfo;
|
|
94
|
-
private handleRedirect;
|
|
95
|
-
private handleDeclareInfo;
|
|
96
|
-
private handleDeclarePopWindowCallback;
|
|
97
|
-
private handleAppHeartBeat;
|
|
98
|
-
private isAppAttached;
|
|
99
|
-
private isWindowVisible;
|
|
100
|
-
private handleCloseBtnShow;
|
|
101
|
-
private handleMaskCloseBtnShow;
|
|
102
|
-
/**
|
|
103
|
-
* @description Send message to SDK
|
|
104
|
-
*/
|
|
105
|
-
dispatchToSDK(event: string, data: any, eventCallbackId?: string): void;
|
|
106
|
-
/**
|
|
107
|
-
* @description Send message to iframe
|
|
108
|
-
*/
|
|
109
|
-
dispatchToApp(payload: {
|
|
110
|
-
context: EventPayloadContext;
|
|
111
|
-
}, targetElement?: any): any;
|
|
112
|
-
/**
|
|
113
|
-
* @description Subscribe to messages from SDK
|
|
114
|
-
*/
|
|
115
|
-
private subscribeFromSDK;
|
|
116
|
-
/**
|
|
117
|
-
* @description Send rendering events to iframe
|
|
118
|
-
*/
|
|
119
|
-
private sendRenderEvent;
|
|
120
|
-
/**
|
|
121
|
-
* @description close cashier
|
|
122
|
-
*/
|
|
123
|
-
private cleanContainer;
|
|
124
|
-
private hideComponentAnimation;
|
|
125
|
-
private closeBtnFunc;
|
|
126
|
-
private retentionPopupLeaveFunc;
|
|
127
|
-
private removeRetentionPopup;
|
|
128
|
-
private showRetentionPopup;
|
|
129
|
-
private hideRetentionPopupFunc;
|
|
130
|
-
private submitForm;
|
|
131
|
-
shouldValidateFields(): boolean;
|
|
132
|
-
}
|
|
133
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const createCustomSheet: (curTheme?: 'dark' | 'light') => void;
|
|
2
|
-
export declare const renderPopupLoading: (container: HTMLDivElement, curTheme: 'dark' | 'light') => void;
|
|
3
|
-
export declare const removePopupLoading: (isShowMockup?: boolean) => void;
|
|
4
|
-
export declare const insertStyleSheet: () => void;
|
|
5
|
-
export declare const createModal: ({ device, url, widthPadding, loadingConfig }: {
|
|
6
|
-
device: any;
|
|
7
|
-
url: any;
|
|
8
|
-
widthPadding: any;
|
|
9
|
-
loadingConfig: any;
|
|
10
|
-
}) => Promise<HTMLIFrameElement>;
|
|
11
|
-
export declare const destroyModal: () => void;
|
package/esm/plugin/const.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type AMSCheckout from '../../core/instance';
|
|
2
|
-
import type { IcreatePaymentParams, EventPayload } from '../../types';
|
|
3
|
-
export default class CheckoutApp {
|
|
4
|
-
app: any;
|
|
5
|
-
paymentMethodsResult: any;
|
|
6
|
-
appDomain: string;
|
|
7
|
-
AMSSDK: AMSCheckout;
|
|
8
|
-
private _render;
|
|
9
|
-
private _selector;
|
|
10
|
-
private _version;
|
|
11
|
-
constructor();
|
|
12
|
-
/**
|
|
13
|
-
* @description When SDK registers plug-ins, it is a required function to receive SDK instances
|
|
14
|
-
*/
|
|
15
|
-
applyPlugin(AMSSDK: AMSCheckout): void;
|
|
16
|
-
/**
|
|
17
|
-
* @description Set the rendering capability of the cashier plug-in. Different technology stacks have some differences in the packaging and use of rendering functions
|
|
18
|
-
*/
|
|
19
|
-
setRender(createIframeNode: any): void;
|
|
20
|
-
/**
|
|
21
|
-
* @description High order function of rendering capability
|
|
22
|
-
*/
|
|
23
|
-
render(renderParams: IcreatePaymentParams): Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* @description Cancel listening and destroy the dom
|
|
26
|
-
*/
|
|
27
|
-
logoutPlugin(): void;
|
|
28
|
-
/**
|
|
29
|
-
* @description Create app
|
|
30
|
-
*/
|
|
31
|
-
private _createApp;
|
|
32
|
-
private _getIframeUrl;
|
|
33
|
-
/**
|
|
34
|
-
* @description Create iframe
|
|
35
|
-
*/
|
|
36
|
-
private _createIframe;
|
|
37
|
-
/**
|
|
38
|
-
* @description Get iftame id
|
|
39
|
-
*/
|
|
40
|
-
private _getIframeId;
|
|
41
|
-
_listener(e: any): void;
|
|
42
|
-
/**
|
|
43
|
-
* @description Initialize subscription iframe message
|
|
44
|
-
*/
|
|
45
|
-
_addEventListener(): void;
|
|
46
|
-
_removeEventListener(): void;
|
|
47
|
-
/**
|
|
48
|
-
* @description Processing messages from iframe
|
|
49
|
-
*/
|
|
50
|
-
_handleAppMessage(data: EventPayload): void;
|
|
51
|
-
/**
|
|
52
|
-
* @description Send message to SDK
|
|
53
|
-
*/
|
|
54
|
-
_dispatchToSDK(data: EventPayload): void;
|
|
55
|
-
/**
|
|
56
|
-
* @description Send message to iframe
|
|
57
|
-
*/
|
|
58
|
-
_dispatchToApp(data: EventPayload): void;
|
|
59
|
-
/**
|
|
60
|
-
* @description Subscribe to messages from SDK
|
|
61
|
-
*/
|
|
62
|
-
_subscribeFromSDK(): void;
|
|
63
|
-
/**
|
|
64
|
-
* @description Send rendering events to iframe
|
|
65
|
-
*/
|
|
66
|
-
_renderPaymentMethods(paymentResult: any): void;
|
|
67
|
-
/**
|
|
68
|
-
* @description Send the post submission processing event, and the cashier applies the consumption result
|
|
69
|
-
*/
|
|
70
|
-
_handleRequestPayment(data: EventPayload): void;
|
|
71
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BusContext, BusMessage, BusSubscriber } from '../../core/bus';
|
|
2
|
-
import { Logger } from '../../util/logger';
|
|
3
|
-
export declare class PaypalBusSubscriber extends BusSubscriber {
|
|
4
|
-
logger: Logger;
|
|
5
|
-
constructor(logger: Logger);
|
|
6
|
-
actionNames(): string[];
|
|
7
|
-
private onEventCallback;
|
|
8
|
-
protected renderPaypalButton(context: BusContext, message: BusMessage): Promise<never>;
|
|
9
|
-
private appendPaypalLoading;
|
|
10
|
-
private removePaypalLoading;
|
|
11
|
-
private preCheck;
|
|
12
|
-
private loadPaypalResource;
|
|
13
|
-
private createPaypalScript;
|
|
14
|
-
private onShippingChange;
|
|
15
|
-
private createOrder;
|
|
16
|
-
private onApprove;
|
|
17
|
-
private onCancel;
|
|
18
|
-
private destroyComponent;
|
|
19
|
-
onMessage(context: BusContext, message: BusMessage): void;
|
|
20
|
-
}
|
package/esm/plugin/type.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { BusSubscriber } from '../core/bus';
|
|
2
|
-
import { PaymentMethodCategoryTypeEnum, ProductSceneEnum, ProductSceneVersion } from '../types';
|
|
3
|
-
export type IExtendPlugin = IExtendPluginItem[];
|
|
4
|
-
export interface ComponentActionNamesType {
|
|
5
|
-
canMakePayments?: string;
|
|
6
|
-
optional_init?: string;
|
|
7
|
-
createComponent?: string;
|
|
8
|
-
mountComponent?: string;
|
|
9
|
-
submit?: string;
|
|
10
|
-
destroyComponent?: string;
|
|
11
|
-
getValue?: string;
|
|
12
|
-
}
|
|
13
|
-
export type IExtendPluginItem = {
|
|
14
|
-
/**
|
|
15
|
-
* 以下为sessionData匹配的场景
|
|
16
|
-
*/
|
|
17
|
-
sessionMatcher?: {
|
|
18
|
-
productScene: ProductSceneEnum;
|
|
19
|
-
productSceneVersion: ProductSceneVersion;
|
|
20
|
-
paymentMethodCategoryType: PaymentMethodCategoryTypeEnum;
|
|
21
|
-
paymentMethodTypes: string[];
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* 用于无sessionData场景,比如:canMakePayments
|
|
25
|
-
*/
|
|
26
|
-
paymentChannelMatcher?: {
|
|
27
|
-
paymentMethod: string;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* 以下plugin 实现的定义
|
|
31
|
-
*/
|
|
32
|
-
busActionNames: ComponentActionNamesType;
|
|
33
|
-
busSubscriber?: BusSubscriber;
|
|
34
|
-
};
|
package/esm/plugin/utils.d.ts
DELETED
package/esm/request/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RequestConfig } from '../types';
|
|
2
|
-
import type { Logger } from '../util/logger';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param requestData 请求参数
|
|
6
|
-
* @param options 请求配置
|
|
7
|
-
* @example request({ name: 'test' }, { operation-type: 'xxx.xxx.xxx' })
|
|
8
|
-
*/
|
|
9
|
-
export declare function request<T>(requestData: Record<string, any> | undefined, options: RequestConfig, logger: Logger): Promise<T>;
|