@alipay/ams-checkout 0.0.1735610050-dev.0 → 0.0.1735810732-dev.0
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 +7 -7
- package/esm/config/index.js +7 -7
- package/esm/constant/index.d.ts +0 -3
- package/esm/constant/index.js +0 -3
- package/esm/core/component/element/index.js +1 -1
- package/esm/core/component/element/mock.d.ts +0 -2
- package/esm/core/component/element/mock.js +53 -129
- package/esm/core/component/index.js +2 -2
- package/esm/plugin/applepay/interface.d.ts +2 -2
- package/esm/plugin/component/channel.d.ts +1 -41
- package/esm/plugin/component/channel.js +1 -589
- package/esm/plugin/component/index.d.ts +1 -1
- package/esm/plugin/component/index.js +39 -59
- package/esm/types/index.d.ts +2 -31
- package/esm/types/index.js +2 -2
- package/package.json +1 -1
package/esm/config/index.d.ts
CHANGED
@@ -5,10 +5,10 @@ export declare const sdkVersion: string;
|
|
5
5
|
/**
|
6
6
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
7
7
|
*/
|
8
|
-
export declare const AMSCheckoutAppVersion = "1.
|
9
|
-
export declare const AMSAutoDebitAppVersion = "1.
|
10
|
-
export declare const AMSEasyPayAppVersion = "1.
|
11
|
-
export declare const AMSCashierPaymentAppVersion = "1.
|
12
|
-
export declare const AMSVaultingAppVersion = "1.
|
13
|
-
export declare const AMSPaymentElementAppVersion = "1.
|
14
|
-
export declare const ADDRESSElementAppVersion = "1.
|
8
|
+
export declare const AMSCheckoutAppVersion = "1.27.0";
|
9
|
+
export declare const AMSAutoDebitAppVersion = "1.27.0";
|
10
|
+
export declare const AMSEasyPayAppVersion = "1.27.0";
|
11
|
+
export declare const AMSCashierPaymentAppVersion = "1.27.0";
|
12
|
+
export declare const AMSVaultingAppVersion = "1.27.0";
|
13
|
+
export declare const AMSPaymentElementAppVersion = "1.27.0";
|
14
|
+
export declare const ADDRESSElementAppVersion = "1.27.0";
|
package/esm/config/index.js
CHANGED
@@ -35,10 +35,10 @@ export var sdkVersion = json.version;
|
|
35
35
|
/**
|
36
36
|
* @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
|
37
37
|
*/
|
38
|
-
export var AMSCheckoutAppVersion = '1.
|
39
|
-
export var AMSAutoDebitAppVersion = '1.
|
40
|
-
export var AMSEasyPayAppVersion = '1.
|
41
|
-
export var AMSCashierPaymentAppVersion = '1.
|
42
|
-
export var AMSVaultingAppVersion = '1.
|
43
|
-
export var AMSPaymentElementAppVersion = '1.
|
44
|
-
export var ADDRESSElementAppVersion = '1.
|
38
|
+
export var AMSCheckoutAppVersion = '1.27.0'; // 兜底版本号
|
39
|
+
export var AMSAutoDebitAppVersion = '1.27.0'; // 代扣
|
40
|
+
export var AMSEasyPayAppVersion = '1.27.0'; // easypay
|
41
|
+
export var AMSCashierPaymentAppVersion = '1.27.0'; // 收银台(卡、apm)
|
42
|
+
export var AMSVaultingAppVersion = '1.27.0'; // 绑卡
|
43
|
+
export var AMSPaymentElementAppVersion = '1.27.0'; // payment element
|
44
|
+
export var ADDRESSElementAppVersion = '1.27.0'; // address element
|
package/esm/constant/index.d.ts
CHANGED
@@ -198,9 +198,6 @@ export declare const EVENT: {
|
|
198
198
|
initSecuritySDK: {
|
199
199
|
name: string;
|
200
200
|
};
|
201
|
-
getApplePayToken: {
|
202
|
-
name: string;
|
203
|
-
};
|
204
201
|
};
|
205
202
|
export declare const COMPONENT_CONTAINER_ID = "ams-component-container";
|
206
203
|
export declare const COMPONENT_SECTION_ID = "ams-component-section";
|
package/esm/constant/index.js
CHANGED
@@ -640,7 +640,7 @@ export var ElementComponent = /*#__PURE__*/function () {
|
|
640
640
|
params.queryResult = _this7.sdkActionRes;
|
641
641
|
}
|
642
642
|
_this7.eventService.emitAndListen({
|
643
|
-
event: ElementPaymentEvent.
|
643
|
+
event: ElementPaymentEvent.INITIAL_DATA_READY,
|
644
644
|
data: {
|
645
645
|
target: target,
|
646
646
|
source: ElementPaymentMethod.CONTAINER_ELEMENT,
|
@@ -361,7 +361,7 @@ export var sdkAction = {
|
|
361
361
|
},
|
362
362
|
success: true
|
363
363
|
};
|
364
|
-
export var
|
364
|
+
export var oneAccount = {
|
365
365
|
accountInfo: {
|
366
366
|
accountStatus: 'EFFECTIVE',
|
367
367
|
email: 'test10@test.com',
|
@@ -375,23 +375,7 @@ export var oneAccount1 = {
|
|
375
375
|
},
|
376
376
|
errorActions: {},
|
377
377
|
extendInfo: {},
|
378
|
-
paymentMethods: [
|
379
|
-
paymentMethodType: 'CARD',
|
380
|
-
iconName: 'VISA',
|
381
|
-
icon: 'https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg',
|
382
|
-
paymentMethodId: 'card-id',
|
383
|
-
paymentMethodDetail: {
|
384
|
-
last4: '**** 1233'
|
385
|
-
}
|
386
|
-
}, {
|
387
|
-
paymentMethodType: 'CARD',
|
388
|
-
iconName: 'VISA2',
|
389
|
-
icon: 'https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg',
|
390
|
-
paymentMethodId: 'card-id2',
|
391
|
-
paymentMethodDetail: {
|
392
|
-
last4: '**** 1235'
|
393
|
-
}
|
394
|
-
}],
|
378
|
+
paymentMethods: [],
|
395
379
|
shippings: [{
|
396
380
|
notes: '',
|
397
381
|
prefer: '1',
|
@@ -413,66 +397,6 @@ export var oneAccount1 = {
|
|
413
397
|
}],
|
414
398
|
success: true
|
415
399
|
};
|
416
|
-
export var oneAccount2 = {
|
417
|
-
accountInfo: {
|
418
|
-
email: 'xxxxx@163.com',
|
419
|
-
accountStatus: 'UNREGISTERED'
|
420
|
-
},
|
421
|
-
goods: {
|
422
|
-
goodsName: 'xxxxx@163.com',
|
423
|
-
goodsImageUrl: '',
|
424
|
-
goodsQuantity: 100,
|
425
|
-
goodsUnitAmount: {
|
426
|
-
currency: 'EUR',
|
427
|
-
value: 100,
|
428
|
-
currencyLabel: ''
|
429
|
-
}
|
430
|
-
},
|
431
|
-
paymentMethods: [],
|
432
|
-
links: {
|
433
|
-
privacyLink: 'https://global.alipay.com/docs/ac/Platform/bahzqeb-',
|
434
|
-
cookieLink: 'https://global.alipay.com/docs/ac/Platform/x1rhufzj'
|
435
|
-
},
|
436
|
-
metaData: {
|
437
|
-
countryList: [{
|
438
|
-
countryName: 'China',
|
439
|
-
default: true
|
440
|
-
}, {
|
441
|
-
countryName: 'Singapore',
|
442
|
-
default: false
|
443
|
-
}]
|
444
|
-
},
|
445
|
-
errorActions: {},
|
446
|
-
extendInfo: {},
|
447
|
-
merchantId: '111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=',
|
448
|
-
needInstallmentAbility: false,
|
449
|
-
needOtherElements: false,
|
450
|
-
orderDescription: 'AMSDM_GIFT',
|
451
|
-
success: true,
|
452
|
-
supportedLanguages: [{
|
453
|
-
locale: 'en_US',
|
454
|
-
preferred: true,
|
455
|
-
title: 'English'
|
456
|
-
}, {
|
457
|
-
country: 'BR',
|
458
|
-
locale: 'pt_BR',
|
459
|
-
preferred: false,
|
460
|
-
title: 'Português'
|
461
|
-
}, {
|
462
|
-
country: 'KR',
|
463
|
-
locale: 'ko_KR',
|
464
|
-
preferred: false,
|
465
|
-
title: '한국어'
|
466
|
-
}, {
|
467
|
-
country: 'MX,CL,PE',
|
468
|
-
locale: 'es_ES',
|
469
|
-
preferred: false,
|
470
|
-
title: 'Español'
|
471
|
-
}]
|
472
|
-
};
|
473
|
-
export var oneAccount = oneAccount1;
|
474
|
-
// export const oneAccount = oneAccount2;
|
475
|
-
|
476
400
|
export var paymentResult = {
|
477
401
|
success: true,
|
478
402
|
data: {
|
@@ -505,63 +429,63 @@ export var paymentResult = {
|
|
505
429
|
target: 'CONTAINER_ELEMENT'
|
506
430
|
};
|
507
431
|
export var submitResult = {
|
508
|
-
actionForm: {
|
509
|
-
actionFormType:
|
510
|
-
method:
|
511
|
-
normalUrl:
|
512
|
-
redirectUrl:
|
432
|
+
"actionForm": {
|
433
|
+
"actionFormType": "RedirectActionForm",
|
434
|
+
"method": "GET",
|
435
|
+
"normalUrl": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8",
|
436
|
+
"redirectUrl": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8"
|
513
437
|
},
|
514
|
-
codeFormViews: [{
|
515
|
-
code:
|
516
|
-
codeExpireTime:
|
517
|
-
displayType:
|
438
|
+
"codeFormViews": [{
|
439
|
+
"code": "https://global.alipay.com/281002040092rqa01k6Ed31LA96JETxv4IP8",
|
440
|
+
"codeExpireTime": "1732567070000",
|
441
|
+
"displayType": "QRCODE"
|
518
442
|
}],
|
519
|
-
errorActions: {},
|
520
|
-
extendInfo: {
|
521
|
-
iconName:
|
522
|
-
paymentRedirectUrl:
|
523
|
-
icon:
|
524
|
-
paymentMethod:
|
443
|
+
"errorActions": {},
|
444
|
+
"extendInfo": {
|
445
|
+
"iconName": "AlipayHK",
|
446
|
+
"paymentRedirectUrl": "http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=amsdmpay_20240410_143002_4shkjh123",
|
447
|
+
"icon": "https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",
|
448
|
+
"paymentMethod": "ALIPAY_HK"
|
525
449
|
},
|
526
|
-
orderAmount: {
|
527
|
-
amount:
|
528
|
-
currency:
|
529
|
-
currencyLabel:
|
530
|
-
formattedAmount:
|
531
|
-
formattedAmountWithCurrency:
|
532
|
-
value:
|
450
|
+
"orderAmount": {
|
451
|
+
"amount": "1.10",
|
452
|
+
"currency": "EUR",
|
453
|
+
"currencyLabel": "€",
|
454
|
+
"formattedAmount": "1,10",
|
455
|
+
"formattedAmountWithCurrency": "€ 1,10",
|
456
|
+
"value": "110"
|
533
457
|
},
|
534
|
-
orderAmountView: {
|
535
|
-
currency:
|
536
|
-
currencyDivider:
|
537
|
-
currencyLabel:
|
538
|
-
currencySymbolPosition:
|
539
|
-
formattedValue:
|
540
|
-
value:
|
458
|
+
"orderAmountView": {
|
459
|
+
"currency": "EUR",
|
460
|
+
"currencyDivider": " ",
|
461
|
+
"currencyLabel": "€",
|
462
|
+
"currencySymbolPosition": "L",
|
463
|
+
"formattedValue": "1,10",
|
464
|
+
"value": "1.10"
|
541
465
|
},
|
542
|
-
paymentAmount: {
|
543
|
-
amount:
|
544
|
-
currency:
|
545
|
-
currencyLabel:
|
546
|
-
formattedAmount:
|
547
|
-
formattedAmountWithCurrency:
|
548
|
-
value:
|
466
|
+
"paymentAmount": {
|
467
|
+
"amount": "1.10",
|
468
|
+
"currency": "EUR",
|
469
|
+
"currencyLabel": "€",
|
470
|
+
"formattedAmount": "1,10",
|
471
|
+
"formattedAmountWithCurrency": "€ 1,10",
|
472
|
+
"value": "110"
|
549
473
|
},
|
550
|
-
paymentAmountView: {
|
551
|
-
currency:
|
552
|
-
currencyDivider:
|
553
|
-
currencyLabel:
|
554
|
-
currencySymbolPosition:
|
555
|
-
formattedValue:
|
556
|
-
value:
|
474
|
+
"paymentAmountView": {
|
475
|
+
"currency": "EUR",
|
476
|
+
"currencyDivider": " ",
|
477
|
+
"currencyLabel": "€",
|
478
|
+
"currencySymbolPosition": "L",
|
479
|
+
"formattedValue": "1,10",
|
480
|
+
"value": "1.10"
|
557
481
|
},
|
558
|
-
paymentMethodType:
|
559
|
-
paymentResultCode:
|
560
|
-
paymentStatus:
|
561
|
-
serverTime:
|
562
|
-
success: true,
|
563
|
-
supportedLanguages: [{
|
564
|
-
locale:
|
565
|
-
preferred: true
|
482
|
+
"paymentMethodType": "ALIPAY_HK",
|
483
|
+
"paymentResultCode": "PAYMENT_IN_PROCESS",
|
484
|
+
"paymentStatus": "PROCESSING",
|
485
|
+
"serverTime": "1731566233772",
|
486
|
+
"success": true,
|
487
|
+
"supportedLanguages": [{
|
488
|
+
"locale": "en_US",
|
489
|
+
"preferred": true
|
566
490
|
}]
|
567
491
|
};
|
@@ -40,7 +40,7 @@ import { ApplePayBusSubscriber } from "../../plugin/applepay";
|
|
40
40
|
import ComponentApp from "../../plugin/component";
|
41
41
|
import { ExtendPlugin } from "../../plugin/const";
|
42
42
|
import { PaypalBusSubscriber } from "../../plugin/paypal";
|
43
|
-
import { ComponentSignEnum, ComponentSignEnumV2,
|
43
|
+
import { ComponentSignEnum, ComponentSignEnumV2, EnvironmentEnum, modeEnum, networkModeEnum, ProductSceneEnum, DisplayTypeEnum } from "../../types";
|
44
44
|
import { getOrSetStorageId, isPC, parseBase64ToString } from "../../util";
|
45
45
|
import { createIframeNode, createPreloadIframeNode } from "../../util/createIframeNode";
|
46
46
|
import { getSecurityConfigStorageKey } from "../../util/security";
|
@@ -101,7 +101,7 @@ var handleParams = function handleParams(params, _this) {
|
|
101
101
|
parseData = _handleSessionData2[0],
|
102
102
|
sessionData = _handleSessionData2[1];
|
103
103
|
var componentSign = getComponentSign(parseData);
|
104
|
-
if (_toConsumableArray(Object.values(ComponentSignEnumV2)).includes(componentSign) && _params.renderDisplayType === DisplayTypeEnum.popup
|
104
|
+
if (_toConsumableArray(Object.values(ComponentSignEnumV2)).includes(componentSign) && _params.renderDisplayType === DisplayTypeEnum.popup) {
|
105
105
|
return Promise.reject({
|
106
106
|
code: ERRORMESSAGE.CREATEPAYMENT_PARAMETER_ERROR.code,
|
107
107
|
message: "unsupported payment method"
|
@@ -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
|
{
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import { EventPayloadContext, type EventPayload, type IPaymentMethod, type IPaymentSessionMetaData } from '../../types';
|
1
|
+
import type { EventPayload, IPaymentSessionMetaData } from '../../types';
|
3
2
|
export type IChannelBehavior = {
|
4
3
|
usePaymentSessionAsQueryResult: boolean;
|
5
4
|
submitPayInSdk: boolean;
|
@@ -19,43 +18,4 @@ type GetDoubleFaParams = {
|
|
19
18
|
export declare function getChannelBehavior(paymentSessionMetaData?: IPaymentSessionMetaData): IChannelBehavior | undefined;
|
20
19
|
export declare function getDoubleFaUrl(params: GetDoubleFaParams): string;
|
21
20
|
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
|
-
}
|
61
21
|
export {};
|