@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.
@@ -5,10 +5,10 @@ export declare const sdkVersion: string;
5
5
  /**
6
6
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
7
7
  */
8
- export declare const AMSCheckoutAppVersion = "1.26.0";
9
- export declare const AMSAutoDebitAppVersion = "1.26.0";
10
- export declare const AMSEasyPayAppVersion = "1.26.0";
11
- export declare const AMSCashierPaymentAppVersion = "1.26.0";
12
- export declare const AMSVaultingAppVersion = "1.26.0";
13
- export declare const AMSPaymentElementAppVersion = "1.26.0";
14
- export declare const ADDRESSElementAppVersion = "1.26.0";
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";
@@ -35,10 +35,10 @@ export var sdkVersion = json.version;
35
35
  /**
36
36
  * @description: 目前应用层分为v1和v2,会存在两个应用版本号不是同步发布的情况。所以需要把默认的应用版本号配置抽离出来。
37
37
  */
38
- export var AMSCheckoutAppVersion = '1.26.0'; // 兜底版本号
39
- export var AMSAutoDebitAppVersion = '1.26.0'; // 代扣
40
- export var AMSEasyPayAppVersion = '1.26.0'; // easypay
41
- export var AMSCashierPaymentAppVersion = '1.26.0'; // 收银台(卡、apm)
42
- export var AMSVaultingAppVersion = '1.26.0'; // 绑卡
43
- export var AMSPaymentElementAppVersion = '1.26.0'; // payment element
44
- export var ADDRESSElementAppVersion = '1.26.0'; // address element
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
@@ -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";
@@ -200,9 +200,6 @@ export var EVENT = {
200
200
  },
201
201
  initSecuritySDK: {
202
202
  name: 'initSecuritySDK'
203
- },
204
- getApplePayToken: {
205
- name: 'getApplePayToken'
206
203
  }
207
204
  };
208
205
  export var COMPONENT_CONTAINER_ID = 'ams-component-container';
@@ -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.RENDER_COMPONENT,
643
+ event: ElementPaymentEvent.INITIAL_DATA_READY,
644
644
  data: {
645
645
  target: target,
646
646
  source: ElementPaymentMethod.CONTAINER_ELEMENT,
@@ -1,6 +1,4 @@
1
1
  export declare const sdkAction: any;
2
- export declare const oneAccount1: any;
3
- export declare const oneAccount2: any;
4
2
  export declare const oneAccount: any;
5
3
  export declare const paymentResult: any;
6
4
  export declare const submitResult: any;
@@ -361,7 +361,7 @@ export var sdkAction = {
361
361
  },
362
362
  success: true
363
363
  };
364
- export var oneAccount1 = {
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: 'RedirectActionForm',
510
- method: 'GET',
511
- normalUrl: 'https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8',
512
- redirectUrl: 'https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=https%3A%2F%2Fglobal.alipay.com%2F281002040092rqa01k6Ed31LA96JETxv4IP8'
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: 'https://global.alipay.com/281002040092rqa01k6Ed31LA96JETxv4IP8',
516
- codeExpireTime: '1732567070000',
517
- displayType: 'QRCODE'
438
+ "codeFormViews": [{
439
+ "code": "https://global.alipay.com/281002040092rqa01k6Ed31LA96JETxv4IP8",
440
+ "codeExpireTime": "1732567070000",
441
+ "displayType": "QRCODE"
518
442
  }],
519
- errorActions: {},
520
- extendInfo: {
521
- iconName: 'AlipayHK',
522
- paymentRedirectUrl: 'http://gol.alipay.net:8080/amsdemo/result?paymentRequestId=amsdmpay_20240410_143002_4shkjh123',
523
- icon: 'https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg',
524
- paymentMethod: 'ALIPAY_HK'
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: '1.10',
528
- currency: 'EUR',
529
- currencyLabel: '',
530
- formattedAmount: '1,10',
531
- formattedAmountWithCurrency: '€ 1,10',
532
- value: '110'
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: 'EUR',
536
- currencyDivider: ' ',
537
- currencyLabel: '',
538
- currencySymbolPosition: 'L',
539
- formattedValue: '1,10',
540
- value: '1.10'
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: '1.10',
544
- currency: 'EUR',
545
- currencyLabel: '',
546
- formattedAmount: '1,10',
547
- formattedAmountWithCurrency: '€ 1,10',
548
- value: '110'
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: 'EUR',
552
- currencyDivider: ' ',
553
- currencyLabel: '',
554
- currencySymbolPosition: 'L',
555
- formattedValue: '1,10',
556
- value: '1.10'
474
+ "paymentAmountView": {
475
+ "currency": "EUR",
476
+ "currencyDivider": " ",
477
+ "currencyLabel": "",
478
+ "currencySymbolPosition": "L",
479
+ "formattedValue": "1,10",
480
+ "value": "1.10"
557
481
  },
558
- paymentMethodType: 'ALIPAY_HK',
559
- paymentResultCode: 'PAYMENT_IN_PROCESS',
560
- paymentStatus: 'PROCESSING',
561
- serverTime: '1731566233772',
562
- success: true,
563
- supportedLanguages: [{
564
- locale: 'en_US',
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, DisplayTypeEnum, EnvironmentEnum, modeEnum, networkModeEnum, ProductSceneEnum } from "../../types";
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 && window.location.href.indexOf('popup=true') === -1) {
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 = 'immediate' | 'recurring' | 'deferred' | 'automaticReload';
41
- export type ApplePayRecurringPaymentDateUnit = 'year' | 'month' | 'day' | 'hour' | 'minute';
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 { Logger } from "../../util/logger";
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 {};