@bigcommerce/checkout-sdk 1.308.4 → 1.309.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 +7 -0
- package/dist/checkout-button.js +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 +68 -1
- 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 -1
- package/docs/interfaces/SquareV2PaymentInitializeOptions.md +90 -0
- package/docs/interfaces/WithSquareV2PaymentInitializeOptions.md +18 -0
- package/package.json +2 -1
package/dist/checkout-sdk.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="applepayjs" />
|
|
2
|
+
import { CardClassSelectors } from '@square/web-payments-sdk-types';
|
|
2
3
|
import { Omit as Omit_2 } from '@bigcommerce/checkout-sdk/payment-integration-api';
|
|
3
4
|
import { RequestOptions as RequestOptions_2 } from '@bigcommerce/request-sender';
|
|
4
5
|
import { Response } from '@bigcommerce/request-sender';
|
|
@@ -5998,7 +5999,7 @@ declare interface PayPalInstrument extends BaseAccountInstrument {
|
|
|
5998
5999
|
method: 'paypal';
|
|
5999
6000
|
}
|
|
6000
6001
|
|
|
6001
|
-
declare type PaymentInitializeOptions = BasePaymentInitializeOptions & WithAdyenV2PaymentInitializeOptions & WithAdyenV3PaymentInitializeOptions & WithApplePayPaymentInitializeOptions;
|
|
6002
|
+
declare type PaymentInitializeOptions = BasePaymentInitializeOptions & WithAdyenV2PaymentInitializeOptions & WithAdyenV3PaymentInitializeOptions & WithApplePayPaymentInitializeOptions & WithSquareV2PaymentInitializeOptions;
|
|
6002
6003
|
|
|
6003
6004
|
declare type PaymentInstrument = CardInstrument | AccountInstrument;
|
|
6004
6005
|
|
|
@@ -6907,6 +6908,64 @@ declare interface SquarePaymentInitializeOptions {
|
|
|
6907
6908
|
onError?(errors?: NonceGenerationError[]): void;
|
|
6908
6909
|
}
|
|
6909
6910
|
|
|
6911
|
+
/**
|
|
6912
|
+
* A set of options that are required to initialize the Square payment method.
|
|
6913
|
+
*
|
|
6914
|
+
* Once Square payment is initialized, an iframed payment element will be
|
|
6915
|
+
* inserted into the current page. These options provide a location, styling,
|
|
6916
|
+
* and a callback function that advises when it's safe to pay.
|
|
6917
|
+
*
|
|
6918
|
+
* @example
|
|
6919
|
+
*
|
|
6920
|
+
* ```html
|
|
6921
|
+
* <!-- These container is where the hosted (iframed) payment method element will be inserted -->
|
|
6922
|
+
* <div id="card-payment"></div>
|
|
6923
|
+
* ```
|
|
6924
|
+
*
|
|
6925
|
+
* ```js
|
|
6926
|
+
* service.initializePayment({
|
|
6927
|
+
* methodId: 'squarev2',
|
|
6928
|
+
* squarev2: {
|
|
6929
|
+
* containerId: 'card-payment',
|
|
6930
|
+
* style: {
|
|
6931
|
+
* input: {
|
|
6932
|
+
* backgroundColor: '#F7F8F9',
|
|
6933
|
+
* color: '#373F4A',
|
|
6934
|
+
* fontFamily: 'Helvetica Neue',
|
|
6935
|
+
* fontSize: '16px',
|
|
6936
|
+
* fontWeight: 'normal'
|
|
6937
|
+
* }
|
|
6938
|
+
* },
|
|
6939
|
+
* onValidationChange: (isReadyToPay: boolean) => {
|
|
6940
|
+
* if (isReadyToPay) {
|
|
6941
|
+
* // Show or hide some component or message...
|
|
6942
|
+
* }
|
|
6943
|
+
* }
|
|
6944
|
+
* },
|
|
6945
|
+
* });
|
|
6946
|
+
* ```
|
|
6947
|
+
*/
|
|
6948
|
+
declare interface SquareV2PaymentInitializeOptions {
|
|
6949
|
+
/**
|
|
6950
|
+
* The ID of a container which the payment widget should insert into.
|
|
6951
|
+
*/
|
|
6952
|
+
containerId: string;
|
|
6953
|
+
/**
|
|
6954
|
+
* A map of .css classes and values that customize the style of the
|
|
6955
|
+
* input fields from the card element.
|
|
6956
|
+
*
|
|
6957
|
+
* For more information about applying custom styles to the card form, see
|
|
6958
|
+
* the available [CardClassSelectors](https://developer.squareup.com/reference/sdks/web/payments/objects/CardClassSelectors)
|
|
6959
|
+
* for styling.
|
|
6960
|
+
*/
|
|
6961
|
+
style?: CardClassSelectors;
|
|
6962
|
+
/**
|
|
6963
|
+
* A callback that gets called when the validity of the
|
|
6964
|
+
* payment component changes.
|
|
6965
|
+
*/
|
|
6966
|
+
onValidationChange?: (isReadyToPay: boolean) => void;
|
|
6967
|
+
}
|
|
6968
|
+
|
|
6910
6969
|
/**
|
|
6911
6970
|
* This error type should not be constructed directly. It is a base class for
|
|
6912
6971
|
* all custom errors thrown in this library.
|
|
@@ -7579,6 +7638,14 @@ declare interface WithMollieIssuerInstrument {
|
|
|
7579
7638
|
shopper_locale: string;
|
|
7580
7639
|
}
|
|
7581
7640
|
|
|
7641
|
+
declare interface WithSquareV2PaymentInitializeOptions {
|
|
7642
|
+
/**
|
|
7643
|
+
* The options that are required to initialize the Square payment method.
|
|
7644
|
+
* They can be omitted unless you need to support Square.
|
|
7645
|
+
*/
|
|
7646
|
+
squarev2?: SquareV2PaymentInitializeOptions;
|
|
7647
|
+
}
|
|
7648
|
+
|
|
7582
7649
|
declare interface WorldpayAccessPaymentInitializeOptions {
|
|
7583
7650
|
/**
|
|
7584
7651
|
* A callback that gets called when the iframe is ready to be added to the
|