@bigcommerce/checkout-sdk 1.326.1 → 1.326.2
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/CHANGELOG.md +8 -0
- package/dist/checkout-button.js +1 -1
- package/dist/checkout-button.umd.js +1 -1
- package/dist/checkout-sdk.d.ts +48 -156
- package/dist/checkout-sdk.js +1 -1
- package/dist/checkout-sdk.js.map +1 -1
- package/dist/checkout-sdk.umd.js +1 -1
- package/dist/checkout-sdk.umd.js.map +1 -1
- package/docs/README.md +0 -5
- package/docs/classes/CheckoutService.md +18 -17
- package/docs/interfaces/AmazonPayV2CustomerInitializeOptions.md +14 -0
- package/docs/interfaces/AmazonPayV2PaymentInitializeOptions.md +2 -2
- package/docs/interfaces/AmazonPayV2ShippingInitializeOptions.md +14 -0
- package/docs/interfaces/BaseCustomerInitializeOptions.md +0 -10
- package/docs/interfaces/BasePaymentInitializeOptions.md +0 -10
- package/docs/interfaces/BraintreePaypalButtonInitializeOptions.md +3 -3
- package/docs/interfaces/BraintreePaypalCreditButtonInitializeOptions.md +3 -3
- package/docs/interfaces/BraintreePaypalCustomerInitializeOptions.md +1 -1
- package/docs/interfaces/BraintreeVenmoButtonInitializeOptions.md +1 -1
- package/docs/interfaces/ShippingInitializeOptions.md +0 -10
- package/package.json +1 -1
- package/docs/interfaces/AmazonPayCustomerInitializeOptions.md +0 -65
- package/docs/interfaces/AmazonPayOrderReference.md +0 -30
- package/docs/interfaces/AmazonPayPaymentInitializeOptions.md +0 -100
- package/docs/interfaces/AmazonPayShippingInitializeOptions.md +0 -85
- package/docs/interfaces/AmazonPayWidgetError.md +0 -25
package/dist/checkout-sdk.d.ts
CHANGED
|
@@ -519,124 +519,6 @@ declare interface AdyenV3ValidationState {
|
|
|
519
519
|
errorKey?: string;
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
-
/**
|
|
523
|
-
* A set of options that are required to initialize the customer step of
|
|
524
|
-
* checkout to support Amazon Pay.
|
|
525
|
-
*
|
|
526
|
-
* When AmazonPay is initialized, a sign-in button will be inserted into the
|
|
527
|
-
* DOM. When the customer clicks on it, they will be redirected to Amazon to
|
|
528
|
-
* sign in.
|
|
529
|
-
*/
|
|
530
|
-
declare interface AmazonPayCustomerInitializeOptions {
|
|
531
|
-
/**
|
|
532
|
-
* The ID of a container which the sign-in button should insert into.
|
|
533
|
-
*/
|
|
534
|
-
container: string;
|
|
535
|
-
/**
|
|
536
|
-
* The colour of the sign-in button.
|
|
537
|
-
*/
|
|
538
|
-
color?: 'Gold' | 'LightGray' | 'DarkGray';
|
|
539
|
-
/**
|
|
540
|
-
* The size of the sign-in button.
|
|
541
|
-
*/
|
|
542
|
-
size?: 'small' | 'medium' | 'large' | 'x-large';
|
|
543
|
-
/**
|
|
544
|
-
* A callback that gets called if unable to initialize the widget or select
|
|
545
|
-
* one of the address options provided by the widget.
|
|
546
|
-
*
|
|
547
|
-
* @param error - The error object describing the failure.
|
|
548
|
-
*/
|
|
549
|
-
onError?(error: AmazonPayWidgetError | StandardError): void;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
declare interface AmazonPayOrderReference {
|
|
553
|
-
getAmazonBillingAgreementId(): string;
|
|
554
|
-
getAmazonOrderReferenceId(): string;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* A set of options that are required to initialize the Amazon Pay payment
|
|
559
|
-
* method.
|
|
560
|
-
*
|
|
561
|
-
* When AmazonPay is initialized, a widget will be inserted into the DOM. The
|
|
562
|
-
* widget has a list of payment options for the customer to choose from.
|
|
563
|
-
*
|
|
564
|
-
* ```html
|
|
565
|
-
* <!-- This is where the widget will be inserted -->
|
|
566
|
-
* <div id="container"></div>
|
|
567
|
-
* ```
|
|
568
|
-
*
|
|
569
|
-
* ```js
|
|
570
|
-
* service.initializePayment({
|
|
571
|
-
* methodId: 'amazon',
|
|
572
|
-
* amazon: {
|
|
573
|
-
* container: 'container',
|
|
574
|
-
* },
|
|
575
|
-
* });
|
|
576
|
-
* ```
|
|
577
|
-
*/
|
|
578
|
-
declare interface AmazonPayPaymentInitializeOptions {
|
|
579
|
-
/**
|
|
580
|
-
* The ID of a container which the payment widget should insert into.
|
|
581
|
-
*/
|
|
582
|
-
container: string;
|
|
583
|
-
/**
|
|
584
|
-
* A callback that gets called if unable to initialize the widget or select
|
|
585
|
-
* one of the payment options.
|
|
586
|
-
*
|
|
587
|
-
* @param error - The error object describing the failure.
|
|
588
|
-
*/
|
|
589
|
-
onError?(error: AmazonPayWidgetError | StandardError): void;
|
|
590
|
-
/**
|
|
591
|
-
* A callback that gets called when the customer selects one of the payment
|
|
592
|
-
* options provided by the widget.
|
|
593
|
-
*
|
|
594
|
-
* @param reference - The order reference provided by Amazon.
|
|
595
|
-
*/
|
|
596
|
-
onPaymentSelect?(reference: AmazonPayOrderReference): void;
|
|
597
|
-
/**
|
|
598
|
-
* A callback that gets called when the widget is loaded and ready to be
|
|
599
|
-
* interacted with.
|
|
600
|
-
*
|
|
601
|
-
* @param reference - The order reference provided by Amazon.
|
|
602
|
-
*/
|
|
603
|
-
onReady?(reference: AmazonPayOrderReference): void;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* A set of options that are required to initialize the shipping step of
|
|
608
|
-
* checkout in order to support Amazon Pay.
|
|
609
|
-
*
|
|
610
|
-
* When Amazon Pay is initialized, a widget will be inserted into the DOM. The
|
|
611
|
-
* widget has a list of shipping addresses for the customer to choose from.
|
|
612
|
-
*/
|
|
613
|
-
declare interface AmazonPayShippingInitializeOptions {
|
|
614
|
-
/**
|
|
615
|
-
* The ID of a container which the address widget should insert into.
|
|
616
|
-
*/
|
|
617
|
-
container: string;
|
|
618
|
-
/**
|
|
619
|
-
* A callback that gets called when the customer selects an address option.
|
|
620
|
-
*
|
|
621
|
-
* @param reference - The order reference provided by Amazon.
|
|
622
|
-
*/
|
|
623
|
-
onAddressSelect?(reference: AmazonPayOrderReference): void;
|
|
624
|
-
/**
|
|
625
|
-
* A callback that gets called if unable to initialize the widget or select
|
|
626
|
-
* one of the address options provided by the widget.
|
|
627
|
-
*
|
|
628
|
-
* @param error - The error object describing the failure of the initialization.
|
|
629
|
-
*/
|
|
630
|
-
onError?(error: AmazonPayWidgetError | StandardError): void;
|
|
631
|
-
/**
|
|
632
|
-
* A callback that gets called when the widget is loaded and ready to be
|
|
633
|
-
* interacted with.
|
|
634
|
-
*
|
|
635
|
-
* @param reference - The order reference provided by Amazon.
|
|
636
|
-
*/
|
|
637
|
-
onReady?(reference: AmazonPayOrderReference): void;
|
|
638
|
-
}
|
|
639
|
-
|
|
640
522
|
declare enum AmazonPayV2ButtonColor {
|
|
641
523
|
Gold = "Gold",
|
|
642
524
|
LightGray = "LightGray",
|
|
@@ -737,6 +619,20 @@ declare interface AmazonPayV2CheckoutSessionConfig {
|
|
|
737
619
|
* When AmazonPayV2 is initialized, a sign-in button will be inserted into the
|
|
738
620
|
* DOM. When the customer clicks on it, they will be redirected to Amazon to
|
|
739
621
|
* sign in.
|
|
622
|
+
*
|
|
623
|
+
* ```html
|
|
624
|
+
* <!-- This is where the Amazon Pay button will be inserted -->
|
|
625
|
+
* <div id="signInButton"></div>
|
|
626
|
+
* ```
|
|
627
|
+
*
|
|
628
|
+
* ```js
|
|
629
|
+
* service.initializeCustomer({
|
|
630
|
+
* methodId: 'amazonpay',
|
|
631
|
+
* amazonpay: {
|
|
632
|
+
* container: 'signInButton',
|
|
633
|
+
* },
|
|
634
|
+
* });
|
|
635
|
+
* ```
|
|
740
636
|
*/
|
|
741
637
|
declare interface AmazonPayV2CustomerInitializeOptions {
|
|
742
638
|
/**
|
|
@@ -787,8 +683,8 @@ declare enum AmazonPayV2PayOptions {
|
|
|
787
683
|
* select a different payment method.
|
|
788
684
|
*
|
|
789
685
|
* ```html
|
|
790
|
-
* <!-- This is
|
|
791
|
-
* <
|
|
686
|
+
* <!-- This is the change payment button that will be bound -->
|
|
687
|
+
* <button id="edit-button">Change card</button>
|
|
792
688
|
* ```
|
|
793
689
|
*
|
|
794
690
|
* ```js
|
|
@@ -840,6 +736,20 @@ declare interface AmazonPayV2Price {
|
|
|
840
736
|
* When AmazonPayV2 is initialized, a change shipping button will be bound.
|
|
841
737
|
* When the customer clicks on it, they will be redirected to Amazon to
|
|
842
738
|
* select a different shipping address.
|
|
739
|
+
*
|
|
740
|
+
* ```html
|
|
741
|
+
* <!-- This is the change shipping button that will be bound -->
|
|
742
|
+
* <button id="edit-button">Change shipping</button>
|
|
743
|
+
* ```
|
|
744
|
+
*
|
|
745
|
+
* ```js
|
|
746
|
+
* service.initializeShipping({
|
|
747
|
+
* methodId: 'amazonpay',
|
|
748
|
+
* amazonpay: {
|
|
749
|
+
* editAddressButtonId: 'edit-button',
|
|
750
|
+
* },
|
|
751
|
+
* });
|
|
752
|
+
* ```
|
|
843
753
|
*/
|
|
844
754
|
declare interface AmazonPayV2ShippingInitializeOptions {
|
|
845
755
|
/**
|
|
@@ -850,10 +760,6 @@ declare interface AmazonPayV2ShippingInitializeOptions {
|
|
|
850
760
|
editAddressButtonId?: string;
|
|
851
761
|
}
|
|
852
762
|
|
|
853
|
-
declare interface AmazonPayWidgetError extends Error {
|
|
854
|
-
getErrorCode(): string;
|
|
855
|
-
}
|
|
856
|
-
|
|
857
763
|
declare type AnalyticStepType = 'customer' | 'shipping' | 'billing' | 'payment';
|
|
858
764
|
|
|
859
765
|
/**
|
|
@@ -1096,11 +1002,6 @@ declare interface BaseCheckoutButtonInitializeOptions extends CheckoutButtonOpti
|
|
|
1096
1002
|
*/
|
|
1097
1003
|
declare interface BaseCustomerInitializeOptions extends CustomerRequestOptions {
|
|
1098
1004
|
[key: string]: unknown;
|
|
1099
|
-
/**
|
|
1100
|
-
* The options that are required to initialize the customer step of checkout
|
|
1101
|
-
* when using Amazon Pay.
|
|
1102
|
-
*/
|
|
1103
|
-
amazon?: AmazonPayCustomerInitializeOptions;
|
|
1104
1005
|
/**
|
|
1105
1006
|
* The options that are required to initialize the customer step of checkout
|
|
1106
1007
|
* when using AmazonPayV2.
|
|
@@ -1240,11 +1141,6 @@ declare interface BasePaymentInitializeOptions extends PaymentRequestOptions {
|
|
|
1240
1141
|
* consumption.
|
|
1241
1142
|
*/
|
|
1242
1143
|
creditCard?: CreditCardPaymentInitializeOptions;
|
|
1243
|
-
/**
|
|
1244
|
-
* The options that are required to initialize the Amazon Pay payment
|
|
1245
|
-
* method. They can be omitted unless you need to support AmazonPay.
|
|
1246
|
-
*/
|
|
1247
|
-
amazon?: AmazonPayPaymentInitializeOptions;
|
|
1248
1144
|
/**
|
|
1249
1145
|
* The options that are required to initialize the AmazonPayV2 payment
|
|
1250
1146
|
* method. They can be omitted unless you need to support AmazonPayV2.
|
|
@@ -2656,14 +2552,15 @@ declare class CheckoutService {
|
|
|
2656
2552
|
*
|
|
2657
2553
|
* Before a payment method can accept payment details, it must first be
|
|
2658
2554
|
* initialized. Some payment methods require you to provide additional
|
|
2659
|
-
* initialization options. For example,
|
|
2660
|
-
*
|
|
2555
|
+
* initialization options. For example, you can provide an element ID for
|
|
2556
|
+
* Amazon Pay if you want users to be able to select a different payment
|
|
2557
|
+
* method by clicking on the element.
|
|
2661
2558
|
*
|
|
2662
2559
|
* ```js
|
|
2663
2560
|
* await service.initializePayment({
|
|
2664
|
-
* methodId: '
|
|
2665
|
-
*
|
|
2666
|
-
*
|
|
2561
|
+
* methodId: 'amazonpay',
|
|
2562
|
+
* amazonpay: {
|
|
2563
|
+
* editButtonId: 'edit-button',
|
|
2667
2564
|
* },
|
|
2668
2565
|
* });
|
|
2669
2566
|
* ```
|
|
@@ -2682,7 +2579,7 @@ declare class CheckoutService {
|
|
|
2682
2579
|
*
|
|
2683
2580
|
* ```js
|
|
2684
2581
|
* await service.deinitializePayment({
|
|
2685
|
-
* methodId: '
|
|
2582
|
+
* methodId: 'amazonpay',
|
|
2686
2583
|
* });
|
|
2687
2584
|
* ```
|
|
2688
2585
|
*
|
|
@@ -2788,13 +2685,13 @@ declare class CheckoutService {
|
|
|
2788
2685
|
/**
|
|
2789
2686
|
* Initializes the sign-in step of a checkout process.
|
|
2790
2687
|
*
|
|
2791
|
-
* Some payment methods, such as Amazon, have their own sign-in flow. In
|
|
2688
|
+
* Some payment methods, such as Amazon Pay, have their own sign-in flow. In
|
|
2792
2689
|
* order to support them, this method must be called.
|
|
2793
2690
|
*
|
|
2794
2691
|
* ```js
|
|
2795
2692
|
* await service.initializeCustomer({
|
|
2796
|
-
* methodId: '
|
|
2797
|
-
*
|
|
2693
|
+
* methodId: 'amazonpay',
|
|
2694
|
+
* amazonpay: {
|
|
2798
2695
|
* container: 'signInButton',
|
|
2799
2696
|
* },
|
|
2800
2697
|
* });
|
|
@@ -2814,7 +2711,7 @@ declare class CheckoutService {
|
|
|
2814
2711
|
*
|
|
2815
2712
|
* ```js
|
|
2816
2713
|
* await service.deinitializeCustomer({
|
|
2817
|
-
* methodId: '
|
|
2714
|
+
* methodId: 'amazonpay',
|
|
2818
2715
|
* });
|
|
2819
2716
|
* ```
|
|
2820
2717
|
*
|
|
@@ -2999,15 +2896,15 @@ declare class CheckoutService {
|
|
|
2999
2896
|
/**
|
|
3000
2897
|
* Initializes the shipping step of a checkout process.
|
|
3001
2898
|
*
|
|
3002
|
-
* Some payment methods, such as Amazon, can provide shipping
|
|
3003
|
-
* be used for checkout. In order to support them, this
|
|
3004
|
-
* called.
|
|
2899
|
+
* Some payment methods, such as Amazon Pay, can provide shipping
|
|
2900
|
+
* information to be used for checkout. In order to support them, this
|
|
2901
|
+
* method must be called.
|
|
3005
2902
|
*
|
|
3006
2903
|
* ```js
|
|
3007
2904
|
* await service.initializeShipping({
|
|
3008
|
-
* methodId: '
|
|
3009
|
-
*
|
|
3010
|
-
*
|
|
2905
|
+
* methodId: 'amazonpay',
|
|
2906
|
+
* amazonpay: {
|
|
2907
|
+
* editAddressButtonId: 'changeAddressButton',
|
|
3011
2908
|
* },
|
|
3012
2909
|
* });
|
|
3013
2910
|
* ```
|
|
@@ -3026,7 +2923,7 @@ declare class CheckoutService {
|
|
|
3026
2923
|
*
|
|
3027
2924
|
* ```js
|
|
3028
2925
|
* await service.deinitializeShipping({
|
|
3029
|
-
* methodId: '
|
|
2926
|
+
* methodId: 'amazonpay',
|
|
3030
2927
|
* });
|
|
3031
2928
|
* ```
|
|
3032
2929
|
*
|
|
@@ -6855,11 +6752,6 @@ declare interface SepaPlaceHolder_2 {
|
|
|
6855
6752
|
* step of checkout.
|
|
6856
6753
|
*/
|
|
6857
6754
|
declare interface ShippingInitializeOptions<T = {}> extends ShippingRequestOptions<T> {
|
|
6858
|
-
/**
|
|
6859
|
-
* The options that are required to initialize the shipping step of checkout
|
|
6860
|
-
* when using Amazon Pay.
|
|
6861
|
-
*/
|
|
6862
|
-
amazon?: AmazonPayShippingInitializeOptions;
|
|
6863
6755
|
/**
|
|
6864
6756
|
* The options that are required to initialize the shipping step of checkout
|
|
6865
6757
|
* when using AmazonPayV2.
|