@alipay/ams-checkout 0.0.1732700846-dev.1 → 0.0.1732700846-dev.11
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/channel.js +1 -1
- package/esm/component/component.popup.style.d.ts +2 -0
- package/esm/component/component.popup.style.js +15 -2
- package/esm/config/index.d.ts +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +17 -0
- package/esm/constant/index.js +18 -0
- package/esm/core/bus/index.d.ts +3 -3
- package/esm/core/bus/index.js +14 -14
- package/esm/core/component/appPreloadProcessing.js +2 -2
- package/esm/core/component/ckp/index.js +6 -3
- package/esm/core/component/element/index.d.ts +1 -0
- package/esm/core/component/element/index.js +79 -70
- package/esm/core/component/element/mock.d.ts +2 -0
- package/esm/core/component/element/mock.js +129 -53
- package/esm/core/component/element/type.d.ts +5 -4
- package/esm/core/component/element/type.js +3 -2
- package/esm/core/component/index.js +8 -12
- package/esm/core/instance/index.js +3 -3
- package/esm/foundation/core/index.d.ts +2 -0
- package/esm/foundation/core/index.js +50 -20
- package/esm/foundation/product-processor/easysafepay/index.js +17 -16
- package/esm/foundation/service/api-bus/busManager.d.ts +3 -3
- package/esm/foundation/service/api-bus/busManager.js +14 -14
- package/esm/foundation/service/container/index.d.ts +2 -0
- package/esm/foundation/service/container/index.js +33 -1
- package/esm/foundation/service/event-center.d.ts +9 -3
- package/esm/foundation/service/event-center.js +41 -10
- package/esm/foundation/service/log/index.d.ts +2 -2
- package/esm/foundation/service/log/index.js +23 -8
- package/esm/foundation/service/log/keys.d.ts +13 -0
- package/esm/foundation/service/log/keys.js +103 -0
- package/esm/foundation/service/log/processor.d.ts +9 -0
- package/esm/foundation/service/log/processor.js +148 -0
- package/esm/foundation/service/log/types.d.ts +1 -1
- package/esm/foundation/service/requester/requester.js +3 -0
- package/esm/foundation/service/security/index.js +6 -8
- package/esm/foundation/utils/redirect_utils.js +1 -2
- package/esm/index.d.ts +1 -0
- package/esm/index.js +6 -1
- package/esm/plugin/applepay/component.js +10 -8
- package/esm/plugin/applepay/index.js +10 -6
- package/esm/plugin/applepay/interface.d.ts +2 -2
- package/esm/plugin/applepay/service.js +24 -16
- package/esm/plugin/component/cashierApp.js +3 -3
- package/esm/plugin/component/channel.d.ts +41 -1
- package/esm/plugin/component/channel.js +590 -2
- package/esm/plugin/component/component.popup.style.d.ts +8 -0
- package/esm/plugin/component/component.popup.style.js +22 -2
- package/esm/plugin/component/index.d.ts +3 -1
- package/esm/plugin/component/index.js +136 -68
- package/esm/plugin/paypal/index.js +1 -1
- package/esm/service/index.js +4 -2
- package/esm/types/index.d.ts +32 -2
- package/esm/types/index.js +3 -2
- package/esm/util/getBackScheme.js +1 -2
- package/esm/util/index.js +4 -8
- package/esm/util/logger.d.ts +3 -3
- package/esm/util/logger.js +49 -13
- package/esm/util/spm-map.d.ts +172 -0
- package/esm/util/spm-map.js +172 -0
- package/package.json +1 -1
@@ -57,10 +57,12 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
57
57
|
name: 'APPLE_PAY',
|
58
58
|
title: ApplePayComponentEvent.sdk_event_appleAvailable
|
59
59
|
}, {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
eventSource: 'sdk',
|
61
|
+
processResult: canMakePayments,
|
62
|
+
eventMessage: JSON.stringify({
|
63
|
+
type: 'funnel',
|
64
|
+
recurring: subPaymentMethod === 'ApplePayRecurringPayment'
|
65
|
+
})
|
64
66
|
}).send();
|
65
67
|
}
|
66
68
|
}, {
|
@@ -88,8 +90,10 @@ export var ApplePayBusSubscriber = /*#__PURE__*/function (_BusSubscriber) {
|
|
88
90
|
name: 'APPLE_PAY',
|
89
91
|
title: ApplePayComponentEvent.sdk_event_appleDestroyComponent
|
90
92
|
}, {
|
91
|
-
|
92
|
-
|
93
|
+
eventSource: 'sdk',
|
94
|
+
eventMessage: JSON.stringify({
|
95
|
+
type: 'funnel'
|
96
|
+
})
|
93
97
|
}).send();
|
94
98
|
}
|
95
99
|
}, {
|
@@ -37,8 +37,8 @@ export interface IApplePayPaymentContact {
|
|
37
37
|
countryCode: string;
|
38
38
|
}
|
39
39
|
export type IApplePayLineItemType = 'final' | 'pending';
|
40
|
-
export type ApplePayPaymentTiming =
|
41
|
-
export type ApplePayRecurringPaymentDateUnit =
|
40
|
+
export type ApplePayPaymentTiming = 'immediate' | 'recurring' | 'deferred' | 'automaticReload';
|
41
|
+
export type ApplePayRecurringPaymentDateUnit = 'year' | 'month' | 'day' | 'hour' | 'minute';
|
42
42
|
/**
|
43
43
|
*
|
44
44
|
{
|
@@ -62,10 +62,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
62
62
|
name: 'APPLE_PAY',
|
63
63
|
title: ApplePayComponentEvent.sdk_event_appleCreateComponent
|
64
64
|
}, {
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
eventSource: 'sdk',
|
66
|
+
processResult: success,
|
67
|
+
eventMessage: JSON.stringify({
|
68
|
+
type: 'funnel',
|
69
|
+
recurring: _this.isRecurring
|
70
|
+
})
|
69
71
|
}).send();
|
70
72
|
});
|
71
73
|
_defineProperty(this, "onpaymentauthorized", function (event) {
|
@@ -98,10 +100,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
98
100
|
name: 'APPLE_PAY',
|
99
101
|
title: ApplePayComponentEvent.sdk_event_appleSubmitToken
|
100
102
|
}, {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
103
|
+
eventSource: 'sdk',
|
104
|
+
processResult: success,
|
105
|
+
eventMessage: JSON.stringify({
|
106
|
+
type: 'funnel',
|
107
|
+
recurring: _this.isRecurring
|
108
|
+
})
|
105
109
|
}).send();
|
106
110
|
});
|
107
111
|
/**
|
@@ -122,10 +126,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
122
126
|
name: 'APPLE_PAY',
|
123
127
|
title: ApplePayComponentEvent.sdk_event_appleCreateComponent
|
124
128
|
}, {
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
+
eventSource: 'sdk',
|
130
|
+
processResult: ApplePaySession !== null,
|
131
|
+
eventMessage: JSON.stringify({
|
132
|
+
type: 'funnel',
|
133
|
+
recurring: _this.isRecurring
|
134
|
+
})
|
129
135
|
}).send();
|
130
136
|
if (!ApplePaySession) {
|
131
137
|
_this.logError(eventCodeEnum.SDK_PAYMENT_ERROR, "ApplePaySession is only support in Safari");
|
@@ -200,10 +206,12 @@ var ApplePayService = /*#__PURE__*/function () {
|
|
200
206
|
name: 'APPLE_PAY',
|
201
207
|
title: ApplePayComponentEvent.sdk_event_appleShowPaymentSheet
|
202
208
|
}, {
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
209
|
+
eventSource: 'sdk',
|
210
|
+
processResult: true,
|
211
|
+
eventMessage: JSON.stringify({
|
212
|
+
type: 'funnel',
|
213
|
+
recurring: recurringInfo !== null
|
214
|
+
})
|
207
215
|
}).send();
|
208
216
|
});
|
209
217
|
this.logger = logger;
|
@@ -35,11 +35,11 @@ var getAppVersion = function getAppVersion(_extendInfo, productScene, mid) {
|
|
35
35
|
title: 'sdk_event_appUpgradeInfo'
|
36
36
|
}, {
|
37
37
|
appUpgradeVersion: appVersion,
|
38
|
-
|
38
|
+
processResult: appVersion ? true : false,
|
39
39
|
isPreload: _extendInfo ? false : true,
|
40
|
-
|
40
|
+
config: _extendInfo,
|
41
41
|
productScene: productScene,
|
42
|
-
|
42
|
+
merchantId: mid
|
43
43
|
});
|
44
44
|
}
|
45
45
|
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import type
|
1
|
+
import { EventPayloadContext, type EventPayload, type IPaymentMethod, type IPaymentSessionMetaData } from '../../types';
|
2
|
+
import { Logger } from '../../util/logger';
|
2
3
|
export type IChannelBehavior = {
|
3
4
|
usePaymentSessionAsQueryResult: boolean;
|
4
5
|
submitPayInSdk: boolean;
|
@@ -18,4 +19,43 @@ type GetDoubleFaParams = {
|
|
18
19
|
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData): IChannelBehavior | undefined;
|
19
20
|
export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
|
20
21
|
export declare const handleGooglePay: (data: EventPayload) => Promise<unknown>;
|
22
|
+
export declare class ApplePayService {
|
23
|
+
private APPLESDKURL;
|
24
|
+
private applePaySession;
|
25
|
+
private paymentSessionData;
|
26
|
+
private sessionResult;
|
27
|
+
/**
|
28
|
+
* @description 支付状态,pending:支付中,normal:正常
|
29
|
+
*/
|
30
|
+
private paymentStatus;
|
31
|
+
/**
|
32
|
+
* @description paymentRequest
|
33
|
+
*/
|
34
|
+
private paymentRequest;
|
35
|
+
private logger;
|
36
|
+
private dispatchToApp;
|
37
|
+
private paymentMethod;
|
38
|
+
constructor({ sessionData, paymentSessionMetaData, paymentMethod, logger, dispatchToApp, }: {
|
39
|
+
sessionData: string;
|
40
|
+
paymentSessionMetaData: IPaymentSessionMetaData;
|
41
|
+
paymentMethod: IPaymentMethod;
|
42
|
+
logger: Logger;
|
43
|
+
dispatchToApp: (payload: {
|
44
|
+
context: EventPayloadContext;
|
45
|
+
}) => void;
|
46
|
+
});
|
47
|
+
private startPay;
|
48
|
+
private setApplePayStatus;
|
49
|
+
private submitPay;
|
50
|
+
submit(): Promise<void>;
|
51
|
+
private getDeviceId;
|
52
|
+
private initApplePaySession;
|
53
|
+
private isCanMakePayments;
|
54
|
+
private loadApplePaySdk;
|
55
|
+
private abortPaySession;
|
56
|
+
private addEventListener;
|
57
|
+
private get initSessionParams();
|
58
|
+
private get isRequiredParameters();
|
59
|
+
private get checkScriptIsLoaded();
|
60
|
+
}
|
21
61
|
export {};
|