@bigcommerce/checkout-sdk 1.271.1 → 1.272.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/CHANGELOG.md +21 -0
- package/dist/checkout-button.d.ts +3 -62
- package/dist/checkout-button.js +1 -1
- package/dist/checkout-button.js.map +1 -1
- package/dist/checkout-button.umd.js +1 -1
- package/dist/checkout-button.umd.js.map +1 -1
- package/dist/checkout-sdk.d.ts +17 -180
- 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 +3 -58
- package/docs/classes/CheckoutButtonInitializer.md +2 -2
- package/docs/classes/CheckoutService.md +6 -6
- package/docs/interfaces/{CheckoutButtonInitializeOptions_4.md → CheckoutButtonInitializeOptions.md} +30 -30
- package/docs/interfaces/CheckoutButtonOptions.md +5 -5
- package/docs/interfaces/{CustomerInitializeOptions_4.md → CustomerInitializeOptions.md} +27 -27
- package/docs/interfaces/CustomerRequestOptions.md +39 -2
- package/docs/interfaces/ExecutePaymentMethodCheckoutOptions.md +4 -4
- package/docs/interfaces/{PaymentInitializeOptions_4.md → PaymentInitializeOptions.md} +46 -46
- package/docs/interfaces/PaymentRequestOptions.md +4 -4
- package/docs/interfaces/RequestOptions.md +3 -3
- package/docs/interfaces/SpamProtectionOptions.md +1 -1
- package/package.json +1 -1
- package/docs/interfaces/ApplePayButtonInitializeOptions_2.md +0 -38
- package/docs/interfaces/ApplePayCustomerInitializeOptions_2.md +0 -77
- package/docs/interfaces/ApplePayPaymentInitializeOptions_2.md +0 -40
- package/docs/interfaces/CheckoutButtonInitializeOptions_3.md +0 -68
- package/docs/interfaces/CheckoutButtonOptions_2.md +0 -55
- package/docs/interfaces/CustomerInitializeOptions_3.md +0 -29
- package/docs/interfaces/CustomerRequestOptions_2.md +0 -60
- package/docs/interfaces/PaymentInitializeOptions_3.md +0 -74
- package/docs/interfaces/PaymentRequestOptions_2.md +0 -67
- package/docs/interfaces/RequestOptions_2.md +0 -44
- package/docs/interfaces/WithApplePayButtonInitializeOptions.md +0 -15
- package/docs/interfaces/WithApplePayCustomerInitializeOptions.md +0 -15
- package/docs/interfaces/WithApplePayPaymentInitializeOptions.md +0 -15
package/dist/checkout-sdk.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="applepayjs" />
|
|
2
|
-
import { RequestOptions as
|
|
2
|
+
import { RequestOptions as RequestOptions_2 } from '@bigcommerce/request-sender';
|
|
3
3
|
import { Response } from '@bigcommerce/request-sender';
|
|
4
4
|
import { Timeout } from '@bigcommerce/request-sender';
|
|
5
5
|
import { createTimeout } from '@bigcommerce/request-sender';
|
|
@@ -773,23 +773,6 @@ declare interface ApplePayButtonInitializeOptions {
|
|
|
773
773
|
onPaymentAuthorize(): void;
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
/**
|
|
777
|
-
* A set of options that are required to initialize ApplePay in cart.
|
|
778
|
-
*
|
|
779
|
-
* When ApplePay is initialized, an ApplePay button will be inserted into the
|
|
780
|
-
* DOM. When a customer clicks on it, it will trigger Apple sheet.
|
|
781
|
-
*/
|
|
782
|
-
declare interface ApplePayButtonInitializeOptions_2 {
|
|
783
|
-
/**
|
|
784
|
-
* The class name of the ApplePay button style.
|
|
785
|
-
*/
|
|
786
|
-
buttonClassName?: string;
|
|
787
|
-
/**
|
|
788
|
-
* A callback that gets called when a payment is successfully completed.
|
|
789
|
-
*/
|
|
790
|
-
onPaymentAuthorize(): void;
|
|
791
|
-
}
|
|
792
|
-
|
|
793
776
|
/**
|
|
794
777
|
* A set of options that are required to initialize the customer step of
|
|
795
778
|
* checkout in order to support ApplePay.
|
|
@@ -823,39 +806,6 @@ declare interface ApplePayCustomerInitializeOptions {
|
|
|
823
806
|
onError?(error?: Error): void;
|
|
824
807
|
}
|
|
825
808
|
|
|
826
|
-
/**
|
|
827
|
-
* A set of options that are required to initialize the customer step of
|
|
828
|
-
* checkout in order to support ApplePay.
|
|
829
|
-
*
|
|
830
|
-
* When ApplePay is initialized, a sign-in button will be inserted into the
|
|
831
|
-
* DOM. When the customer clicks on it, it will trigger apple sheet
|
|
832
|
-
*/
|
|
833
|
-
declare interface ApplePayCustomerInitializeOptions_2 {
|
|
834
|
-
/**
|
|
835
|
-
* The ID of a container which the sign-in button should insert into.
|
|
836
|
-
*/
|
|
837
|
-
container: string;
|
|
838
|
-
/**
|
|
839
|
-
* Shipping label to be passed to apple sheet.
|
|
840
|
-
*/
|
|
841
|
-
shippingLabel?: string;
|
|
842
|
-
/**
|
|
843
|
-
* Sub total label to be passed to apple sheet.
|
|
844
|
-
*/
|
|
845
|
-
subtotalLabel?: string;
|
|
846
|
-
/**
|
|
847
|
-
* A callback that gets called when a payment is successfully completed.
|
|
848
|
-
*/
|
|
849
|
-
onPaymentAuthorize(): void;
|
|
850
|
-
/**
|
|
851
|
-
* A callback that gets called if unable to initialize the widget or select
|
|
852
|
-
* one of the address options provided by the widget.
|
|
853
|
-
*
|
|
854
|
-
* @param error - The error object describing the failure.
|
|
855
|
-
*/
|
|
856
|
-
onError?(error?: Error): void;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
809
|
/**
|
|
860
810
|
* A set of options that are required to initialize the Applepay payment method with:
|
|
861
811
|
*
|
|
@@ -882,32 +832,6 @@ declare interface ApplePayPaymentInitializeOptions {
|
|
|
882
832
|
subtotalLabel?: string;
|
|
883
833
|
}
|
|
884
834
|
|
|
885
|
-
/**
|
|
886
|
-
* A set of options that are required to initialize the Applepay payment method with:
|
|
887
|
-
*
|
|
888
|
-
* 1) ApplePay:
|
|
889
|
-
*
|
|
890
|
-
* ```js
|
|
891
|
-
* service.initializePayment({
|
|
892
|
-
* methodId: 'applepay',
|
|
893
|
-
* applepay: {
|
|
894
|
-
* shippingLabel: 'Shipping',
|
|
895
|
-
* subtotalLabel: 'Sub total',
|
|
896
|
-
* }
|
|
897
|
-
* });
|
|
898
|
-
* ```
|
|
899
|
-
*/
|
|
900
|
-
declare interface ApplePayPaymentInitializeOptions_2 {
|
|
901
|
-
/**
|
|
902
|
-
* Shipping label to be passed to apple sheet.
|
|
903
|
-
*/
|
|
904
|
-
shippingLabel?: string;
|
|
905
|
-
/**
|
|
906
|
-
* Sub total label to be passed to apple sheet.
|
|
907
|
-
*/
|
|
908
|
-
subtotalLabel?: string;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
835
|
declare interface BankInstrument extends BaseAccountInstrument {
|
|
912
836
|
accountNumber: string;
|
|
913
837
|
issuer: string;
|
|
@@ -1726,24 +1650,12 @@ declare class CheckoutButtonErrorSelector {
|
|
|
1726
1650
|
getDeinitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
|
|
1727
1651
|
}
|
|
1728
1652
|
|
|
1729
|
-
declare
|
|
1730
|
-
|
|
1731
|
-
declare type CheckoutButtonInitializeOptions_2 = CheckoutButtonInitializeOptions_3 & WithApplePayButtonInitializeOptions;
|
|
1732
|
-
|
|
1733
|
-
declare interface CheckoutButtonInitializeOptions_3 extends CheckoutButtonOptions {
|
|
1734
|
-
/**
|
|
1735
|
-
* The ID of a container which the checkout button should be inserted.
|
|
1736
|
-
*/
|
|
1737
|
-
containerId: string;
|
|
1738
|
-
[key: string]: unknown;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
declare interface CheckoutButtonInitializeOptions_4 extends CheckoutButtonOptions_2 {
|
|
1653
|
+
declare interface CheckoutButtonInitializeOptions extends CheckoutButtonOptions {
|
|
1742
1654
|
/**
|
|
1743
1655
|
* The options that are required to initialize the ApplePay payment method.
|
|
1744
1656
|
* They can be omitted unless you need to support ApplePay in cart.
|
|
1745
1657
|
*/
|
|
1746
|
-
applepay?:
|
|
1658
|
+
applepay?: ApplePayButtonInitializeOptions;
|
|
1747
1659
|
/**
|
|
1748
1660
|
* The options that are required to facilitate AmazonPayV2. They can be
|
|
1749
1661
|
* omitted unless you need to support AmazonPayV2.
|
|
@@ -1917,7 +1829,7 @@ declare class CheckoutButtonInitializer {
|
|
|
1917
1829
|
* @param options - Options for deinitializing the checkout button.
|
|
1918
1830
|
* @returns A promise that resolves to the current state.
|
|
1919
1831
|
*/
|
|
1920
|
-
deinitializeButton(options:
|
|
1832
|
+
deinitializeButton(options: CheckoutButtonOptions): Promise<CheckoutButtonSelectors>;
|
|
1921
1833
|
}
|
|
1922
1834
|
|
|
1923
1835
|
declare interface CheckoutButtonInitializerOptions {
|
|
@@ -1950,17 +1862,7 @@ declare enum CheckoutButtonMethodType {
|
|
|
1950
1862
|
/**
|
|
1951
1863
|
* The set of options for configuring the checkout button.
|
|
1952
1864
|
*/
|
|
1953
|
-
declare interface CheckoutButtonOptions extends
|
|
1954
|
-
/**
|
|
1955
|
-
* The identifier of the payment method.
|
|
1956
|
-
*/
|
|
1957
|
-
methodId: string;
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
/**
|
|
1961
|
-
* The set of options for configuring the checkout button.
|
|
1962
|
-
*/
|
|
1963
|
-
declare interface CheckoutButtonOptions_2 extends RequestOptions {
|
|
1865
|
+
declare interface CheckoutButtonOptions extends RequestOptions {
|
|
1964
1866
|
/**
|
|
1965
1867
|
* The identifier of the payment method.
|
|
1966
1868
|
*/
|
|
@@ -2286,7 +2188,7 @@ declare class CheckoutService {
|
|
|
2286
2188
|
* @param options - Options for deinitializing the payment step of checkout.
|
|
2287
2189
|
* @returns A promise that resolves to the current state.
|
|
2288
2190
|
*/
|
|
2289
|
-
deinitializePayment(options:
|
|
2191
|
+
deinitializePayment(options: PaymentRequestOptions): Promise<CheckoutSelectors>;
|
|
2290
2192
|
/**
|
|
2291
2193
|
* Loads a list of countries available for billing.
|
|
2292
2194
|
*
|
|
@@ -2418,7 +2320,7 @@ declare class CheckoutService {
|
|
|
2418
2320
|
* @param options - Options for deinitializing the customer step of checkout.
|
|
2419
2321
|
* @returns A promise that resolves to the current state.
|
|
2420
2322
|
*/
|
|
2421
|
-
deinitializeCustomer(options?:
|
|
2323
|
+
deinitializeCustomer(options?: CustomerRequestOptions): Promise<CheckoutSelectors>;
|
|
2422
2324
|
/**
|
|
2423
2325
|
* Sends a email that contains a single-use sign-in link. When a valid links is clicked,
|
|
2424
2326
|
* signs in the customer without requiring any password, redirecting them to the account page if no redirectUrl is provided.
|
|
@@ -2526,7 +2428,7 @@ declare class CheckoutService {
|
|
|
2526
2428
|
* @param options - Options for signing in the customer.
|
|
2527
2429
|
* @returns A promise that resolves to the current state.
|
|
2528
2430
|
*/
|
|
2529
|
-
signInCustomer(credentials: CustomerCredentials, options?:
|
|
2431
|
+
signInCustomer(credentials: CustomerCredentials, options?: CustomerRequestOptions): Promise<CheckoutSelectors>;
|
|
2530
2432
|
/**
|
|
2531
2433
|
* Signs out the current customer if they are previously signed in.
|
|
2532
2434
|
*
|
|
@@ -2556,7 +2458,7 @@ declare class CheckoutService {
|
|
|
2556
2458
|
* @param options - Options for signing out the customer.
|
|
2557
2459
|
* @returns A promise that resolves to the current state.
|
|
2558
2460
|
*/
|
|
2559
|
-
signOutCustomer(options?:
|
|
2461
|
+
signOutCustomer(options?: CustomerRequestOptions): Promise<CheckoutSelectors>;
|
|
2560
2462
|
/**
|
|
2561
2463
|
* Executes custom checkout of the priority payment method.
|
|
2562
2464
|
*
|
|
@@ -4167,14 +4069,6 @@ declare interface CustomerGroup {
|
|
|
4167
4069
|
name: string;
|
|
4168
4070
|
}
|
|
4169
4071
|
|
|
4170
|
-
declare type CustomerInitializeOptions = CustomerInitializeOptions_2 & CustomerInitializeOptions_4;
|
|
4171
|
-
|
|
4172
|
-
declare type CustomerInitializeOptions_2 = CustomerInitializeOptions_3 & WithApplePayCustomerInitializeOptions;
|
|
4173
|
-
|
|
4174
|
-
declare interface CustomerInitializeOptions_3 extends CustomerRequestOptions {
|
|
4175
|
-
[key: string]: unknown;
|
|
4176
|
-
}
|
|
4177
|
-
|
|
4178
4072
|
/**
|
|
4179
4073
|
* A set of options that are required to initialize the customer step of the
|
|
4180
4074
|
* current checkout flow.
|
|
@@ -4184,7 +4078,7 @@ declare interface CustomerInitializeOptions_3 extends CustomerRequestOptions {
|
|
|
4184
4078
|
* using their sign-in button. As a result, you may need to provide additional
|
|
4185
4079
|
* information in order to initialize the customer step of checkout.
|
|
4186
4080
|
*/
|
|
4187
|
-
declare interface
|
|
4081
|
+
declare interface CustomerInitializeOptions extends CustomerRequestOptions {
|
|
4188
4082
|
/**
|
|
4189
4083
|
* The options that are required to initialize the customer step of checkout
|
|
4190
4084
|
* when using Amazon Pay.
|
|
@@ -4199,7 +4093,7 @@ declare interface CustomerInitializeOptions_4 extends CustomerRequestOptions_2 {
|
|
|
4199
4093
|
* The options that are required to initialize the customer step of checkout
|
|
4200
4094
|
* when using ApplePay.
|
|
4201
4095
|
*/
|
|
4202
|
-
applepay?:
|
|
4096
|
+
applepay?: ApplePayCustomerInitializeOptions;
|
|
4203
4097
|
/**
|
|
4204
4098
|
* The options that are required to initialize the customer step of checkout
|
|
4205
4099
|
* when using Visa Checkout provided by Braintree.
|
|
@@ -4274,10 +4168,6 @@ declare interface CustomerPasswordRequirements {
|
|
|
4274
4168
|
description: string;
|
|
4275
4169
|
}
|
|
4276
4170
|
|
|
4277
|
-
declare interface CustomerRequestOptions extends RequestOptions_3 {
|
|
4278
|
-
methodId?: string;
|
|
4279
|
-
}
|
|
4280
|
-
|
|
4281
4171
|
/**
|
|
4282
4172
|
* A set of options for configuring any requests related to the customer step of
|
|
4283
4173
|
* the current checkout flow.
|
|
@@ -4286,7 +4176,7 @@ declare interface CustomerRequestOptions extends RequestOptions_3 {
|
|
|
4286
4176
|
* need to indicate the method you want to use if you need to trigger a specific
|
|
4287
4177
|
* flow for signing in or out a customer. Otherwise, these options are not required.
|
|
4288
4178
|
*/
|
|
4289
|
-
declare interface
|
|
4179
|
+
declare interface CustomerRequestOptions extends RequestOptions {
|
|
4290
4180
|
methodId?: string;
|
|
4291
4181
|
}
|
|
4292
4182
|
|
|
@@ -4562,7 +4452,7 @@ declare interface EmbeddedContentOptions {
|
|
|
4562
4452
|
* to execution method.
|
|
4563
4453
|
*
|
|
4564
4454
|
*/
|
|
4565
|
-
declare interface ExecutePaymentMethodCheckoutOptions extends
|
|
4455
|
+
declare interface ExecutePaymentMethodCheckoutOptions extends CustomerRequestOptions {
|
|
4566
4456
|
continueWithCheckoutCallback?(): void;
|
|
4567
4457
|
}
|
|
4568
4458
|
|
|
@@ -5709,19 +5599,11 @@ declare interface PayPalInstrument extends BaseAccountInstrument {
|
|
|
5709
5599
|
method: 'paypal';
|
|
5710
5600
|
}
|
|
5711
5601
|
|
|
5712
|
-
declare type PaymentInitializeOptions = PaymentInitializeOptions_2 & PaymentInitializeOptions_4;
|
|
5713
|
-
|
|
5714
|
-
declare type PaymentInitializeOptions_2 = PaymentInitializeOptions_3 & WithApplePayPaymentInitializeOptions;
|
|
5715
|
-
|
|
5716
|
-
declare interface PaymentInitializeOptions_3 extends PaymentRequestOptions {
|
|
5717
|
-
[key: string]: unknown;
|
|
5718
|
-
}
|
|
5719
|
-
|
|
5720
5602
|
/**
|
|
5721
5603
|
* A set of options that are required to initialize the payment step of the
|
|
5722
5604
|
* current checkout flow.
|
|
5723
5605
|
*/
|
|
5724
|
-
declare interface
|
|
5606
|
+
declare interface PaymentInitializeOptions extends PaymentRequestOptions {
|
|
5725
5607
|
/**
|
|
5726
5608
|
* @alpha
|
|
5727
5609
|
* Please note that this option is currently in an early stage of
|
|
@@ -5748,7 +5630,7 @@ declare interface PaymentInitializeOptions_4 extends PaymentRequestOptions_2 {
|
|
|
5748
5630
|
* The options that are required to initialize the Apple Pay payment
|
|
5749
5631
|
* method. They can be omitted unless you need to support AmazonPay.
|
|
5750
5632
|
*/
|
|
5751
|
-
applepay?:
|
|
5633
|
+
applepay?: ApplePayPaymentInitializeOptions;
|
|
5752
5634
|
/**
|
|
5753
5635
|
* The options that are required to initialize the AmazonPayV2 payment
|
|
5754
5636
|
* method. They can be omitted unless you need to support AmazonPayV2.
|
|
@@ -5932,24 +5814,7 @@ declare interface PaymentMethodConfig {
|
|
|
5932
5814
|
* The set of options for configuring any requests related to the payment step of
|
|
5933
5815
|
* the current checkout flow.
|
|
5934
5816
|
*/
|
|
5935
|
-
declare interface PaymentRequestOptions extends
|
|
5936
|
-
/**
|
|
5937
|
-
* The identifier of the payment method.
|
|
5938
|
-
*/
|
|
5939
|
-
methodId: string;
|
|
5940
|
-
/**
|
|
5941
|
-
* The identifier of the payment provider providing the payment method. This
|
|
5942
|
-
* option is only required if the provider offers multiple payment options.
|
|
5943
|
-
* i.e.: Adyen and Klarna.
|
|
5944
|
-
*/
|
|
5945
|
-
gatewayId?: string;
|
|
5946
|
-
}
|
|
5947
|
-
|
|
5948
|
-
/**
|
|
5949
|
-
* The set of options for configuring any requests related to the payment step of
|
|
5950
|
-
* the current checkout flow.
|
|
5951
|
-
*/
|
|
5952
|
-
declare interface PaymentRequestOptions_2 extends RequestOptions {
|
|
5817
|
+
declare interface PaymentRequestOptions extends RequestOptions {
|
|
5953
5818
|
/**
|
|
5954
5819
|
* The identifier of the payment method.
|
|
5955
5820
|
*/
|
|
@@ -6541,22 +6406,6 @@ declare interface RequestOptions<TParams = {}> {
|
|
|
6541
6406
|
params?: TParams;
|
|
6542
6407
|
}
|
|
6543
6408
|
|
|
6544
|
-
/**
|
|
6545
|
-
* A set of options for configuring an asynchronous request.
|
|
6546
|
-
*/
|
|
6547
|
-
declare interface RequestOptions_2<TParams = {}> {
|
|
6548
|
-
/**
|
|
6549
|
-
* Provide this option if you want to cancel or time out the request. If the
|
|
6550
|
-
* timeout object completes before the request, the request will be
|
|
6551
|
-
* cancelled.
|
|
6552
|
-
*/
|
|
6553
|
-
timeout?: Timeout;
|
|
6554
|
-
/**
|
|
6555
|
-
* The parameters of the request, if required.
|
|
6556
|
-
*/
|
|
6557
|
-
params?: TParams;
|
|
6558
|
-
}
|
|
6559
|
-
|
|
6560
6409
|
declare interface SearchArea {
|
|
6561
6410
|
radius: Radius;
|
|
6562
6411
|
coordinates: Coordinates;
|
|
@@ -6643,7 +6492,7 @@ declare interface SignInEmailRequestBody {
|
|
|
6643
6492
|
/**
|
|
6644
6493
|
* The set of options for configuring any requests related to spam protection.
|
|
6645
6494
|
*/
|
|
6646
|
-
declare interface SpamProtectionOptions extends
|
|
6495
|
+
declare interface SpamProtectionOptions extends RequestOptions_2 {
|
|
6647
6496
|
/**
|
|
6648
6497
|
* The container ID where the spam protection should be rendered.
|
|
6649
6498
|
*/
|
|
@@ -7240,18 +7089,6 @@ declare interface WithAccountCreation {
|
|
|
7240
7089
|
shouldCreateAccount?: boolean;
|
|
7241
7090
|
}
|
|
7242
7091
|
|
|
7243
|
-
declare interface WithApplePayButtonInitializeOptions {
|
|
7244
|
-
applepay?: ApplePayButtonInitializeOptions;
|
|
7245
|
-
}
|
|
7246
|
-
|
|
7247
|
-
declare interface WithApplePayCustomerInitializeOptions {
|
|
7248
|
-
applepay?: ApplePayCustomerInitializeOptions;
|
|
7249
|
-
}
|
|
7250
|
-
|
|
7251
|
-
declare interface WithApplePayPaymentInitializeOptions {
|
|
7252
|
-
applepay?: ApplePayPaymentInitializeOptions;
|
|
7253
|
-
}
|
|
7254
|
-
|
|
7255
7092
|
declare interface WithCheckoutcomFawryInstrument {
|
|
7256
7093
|
customerMobile: string;
|
|
7257
7094
|
customerEmail: string;
|