@bigcommerce/checkout-sdk 1.369.1 → 1.370.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 +15 -0
- package/dist/checkout-button.d.ts +21 -1
- 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 +22 -214
- 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 +4 -51
- package/docs/interfaces/BasePaymentInitializeOptions.md +1 -1
- package/docs/interfaces/BoltButtonInitializeOptions.md +17 -0
- package/docs/interfaces/BoltBuyNowInitializeOptions.md +29 -0
- package/docs/interfaces/WithBoltButtonInitializeOptions.md +18 -0
- package/package.json +1 -1
- package/docs/enums/PaypalCommerceFormFieldType.md +0 -50
- package/docs/interfaces/PaypalCommerceCreditCardPaymentInitializeOptions.md +0 -90
- package/docs/interfaces/PaypalCommerceFormFieldCardTypeChangeEventData.md +0 -15
- package/docs/interfaces/PaypalCommerceFormFieldKeyboardEventData.md +0 -15
- package/docs/interfaces/PaypalCommerceFormFieldOptions.md +0 -28
- package/docs/interfaces/PaypalCommerceFormFieldStylesMap.md +0 -29
- package/docs/interfaces/PaypalCommerceFormFieldValidateErrorData.md +0 -29
- package/docs/interfaces/PaypalCommerceFormFieldValidateEventData.md +0 -33
- package/docs/interfaces/PaypalCommerceFormFieldsMap.md +0 -36
- package/docs/interfaces/PaypalCommerceFormOptions.md +0 -148
- package/docs/interfaces/PaypalCommerceStoredCardFieldOptions.md +0 -43
- package/docs/interfaces/PaypalCommerceStoredCardFieldsMap.md +0 -22
package/dist/checkout-sdk.d.ts
CHANGED
|
@@ -1191,7 +1191,7 @@ declare interface BasePaymentInitializeOptions extends PaymentRequestOptions {
|
|
|
1191
1191
|
* The options that are required to initialize the PayPal Commerce payment method.
|
|
1192
1192
|
* They can be omitted unless you need to support PayPal Commerce.
|
|
1193
1193
|
*/
|
|
1194
|
-
paypalcommerce?:
|
|
1194
|
+
paypalcommerce?: PaypalCommercePaymentInitializeOptions;
|
|
1195
1195
|
/**
|
|
1196
1196
|
* The options that are required to initialize the Square payment method.
|
|
1197
1197
|
* They can be omitted unless you need to support Square.
|
|
@@ -1370,6 +1370,18 @@ declare interface BodyStyles {
|
|
|
1370
1370
|
backgroundColor?: string;
|
|
1371
1371
|
}
|
|
1372
1372
|
|
|
1373
|
+
declare interface BoltButtonInitializeOptions {
|
|
1374
|
+
/**
|
|
1375
|
+
* The options that are required to initialize Buy Now functionality.
|
|
1376
|
+
*/
|
|
1377
|
+
buyNowInitializeOptions?: BoltBuyNowInitializeOptions;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
declare interface BoltBuyNowInitializeOptions {
|
|
1381
|
+
storefrontApiToken?: string;
|
|
1382
|
+
getBuyNowCartRequestBody(): BuyNowCartRequestBody_2;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1373
1385
|
/**
|
|
1374
1386
|
* A set of options that are required to initialize the customer step of
|
|
1375
1387
|
* checkout to support Bolt.
|
|
@@ -2157,7 +2169,7 @@ declare class CheckoutButtonErrorSelector {
|
|
|
2157
2169
|
getDeinitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
|
|
2158
2170
|
}
|
|
2159
2171
|
|
|
2160
|
-
declare type CheckoutButtonInitializeOptions = BaseCheckoutButtonInitializeOptions & WithApplePayButtonInitializeOptions & WithPayPalCommerceButtonInitializeOptions & WithPayPalCommerceCreditButtonInitializeOptions & WithPayPalCommerceInlineButtonInitializeOptions & WithPayPalCommerceVenmoButtonInitializeOptions;
|
|
2172
|
+
declare type CheckoutButtonInitializeOptions = BaseCheckoutButtonInitializeOptions & WithApplePayButtonInitializeOptions & WithBoltButtonInitializeOptions & WithPayPalCommerceButtonInitializeOptions & WithPayPalCommerceCreditButtonInitializeOptions & WithPayPalCommerceInlineButtonInitializeOptions & WithPayPalCommerceVenmoButtonInitializeOptions;
|
|
2161
2173
|
|
|
2162
2174
|
declare class CheckoutButtonInitializer {
|
|
2163
2175
|
private _store;
|
|
@@ -6349,209 +6361,6 @@ declare enum PaypalButtonStyleSizeOption {
|
|
|
6349
6361
|
RESPONSIVE = "responsive"
|
|
6350
6362
|
}
|
|
6351
6363
|
|
|
6352
|
-
/**
|
|
6353
|
-
* A set of options that are required to initialize the PayPal Commerce payment
|
|
6354
|
-
* method for presenting its credit card form.
|
|
6355
|
-
*
|
|
6356
|
-
* ```html
|
|
6357
|
-
* <!-- These containers are where the hosted (iframed) credit card fields will be inserted -->
|
|
6358
|
-
* <div id="card-number"></div>
|
|
6359
|
-
* <div id="card-name"></div>
|
|
6360
|
-
* <div id="card-expiry"></div>
|
|
6361
|
-
* <div id="card-code"></div>
|
|
6362
|
-
* ```
|
|
6363
|
-
*
|
|
6364
|
-
* ```js
|
|
6365
|
-
* service.initializePayment({
|
|
6366
|
-
* methodId: 'paypalcommerce',
|
|
6367
|
-
* paypalcommerce: {
|
|
6368
|
-
* form: {
|
|
6369
|
-
* fields: {
|
|
6370
|
-
* cardNumber: { containerId: 'card-number' },
|
|
6371
|
-
* cardName: { containerId: 'card-name' },
|
|
6372
|
-
* cardExpiry: { containerId: 'card-expiry' },
|
|
6373
|
-
* cardCode: { containerId: 'card-code' },
|
|
6374
|
-
* },
|
|
6375
|
-
* },
|
|
6376
|
-
* },
|
|
6377
|
-
* });
|
|
6378
|
-
* ```
|
|
6379
|
-
*
|
|
6380
|
-
* Additional options can be passed in to customize the fields and register
|
|
6381
|
-
* event callbacks.
|
|
6382
|
-
*
|
|
6383
|
-
* ```js
|
|
6384
|
-
* service.initializePayment({
|
|
6385
|
-
* methodId: 'paypalcommerce',
|
|
6386
|
-
* creditCard: {
|
|
6387
|
-
* form: {
|
|
6388
|
-
* fields: {
|
|
6389
|
-
* cardNumber: { containerId: 'card-number', placeholder: 'Number of card' },
|
|
6390
|
-
* cardName: { containerId: 'card-name', placeholder: 'Name of card' },
|
|
6391
|
-
* cardExpiry: { containerId: 'card-expiry', placeholder: 'Expiry of card' },
|
|
6392
|
-
* cardCode: { containerId: 'card-code', placeholder: 'Code of card' },
|
|
6393
|
-
* },
|
|
6394
|
-
* styles: {
|
|
6395
|
-
* default: {
|
|
6396
|
-
* color: '#000',
|
|
6397
|
-
* },
|
|
6398
|
-
* error: {
|
|
6399
|
-
* color: '#f00',
|
|
6400
|
-
* },
|
|
6401
|
-
* focus: {
|
|
6402
|
-
* color: '#0f0',
|
|
6403
|
-
* },
|
|
6404
|
-
* },
|
|
6405
|
-
* onBlur({ fieldType }) {
|
|
6406
|
-
* console.log(fieldType);
|
|
6407
|
-
* },
|
|
6408
|
-
* onFocus({ fieldType }) {
|
|
6409
|
-
* console.log(fieldType);
|
|
6410
|
-
* },
|
|
6411
|
-
* onEnter({ fieldType }) {
|
|
6412
|
-
* console.log(fieldType);
|
|
6413
|
-
* },
|
|
6414
|
-
* onCardTypeChange({ cardType }) {
|
|
6415
|
-
* console.log(cardType);
|
|
6416
|
-
* },
|
|
6417
|
-
* onValidate({ errors, isValid }) {
|
|
6418
|
-
* console.log(errors);
|
|
6419
|
-
* console.log(isValid);
|
|
6420
|
-
* },
|
|
6421
|
-
* },
|
|
6422
|
-
* },
|
|
6423
|
-
* });
|
|
6424
|
-
* ```
|
|
6425
|
-
*/
|
|
6426
|
-
declare interface PaypalCommerceCreditCardPaymentInitializeOptions {
|
|
6427
|
-
/**
|
|
6428
|
-
* The form is data for Credit Card Form
|
|
6429
|
-
*/
|
|
6430
|
-
form: PaypalCommerceFormOptions;
|
|
6431
|
-
}
|
|
6432
|
-
|
|
6433
|
-
declare type PaypalCommerceFormFieldBlurEventData = PaypalCommerceFormFieldKeyboardEventData;
|
|
6434
|
-
|
|
6435
|
-
declare interface PaypalCommerceFormFieldCardTypeChangeEventData {
|
|
6436
|
-
cardType?: string;
|
|
6437
|
-
}
|
|
6438
|
-
|
|
6439
|
-
declare type PaypalCommerceFormFieldEnterEventData = PaypalCommerceFormFieldKeyboardEventData;
|
|
6440
|
-
|
|
6441
|
-
declare type PaypalCommerceFormFieldFocusEventData = PaypalCommerceFormFieldKeyboardEventData;
|
|
6442
|
-
|
|
6443
|
-
declare interface PaypalCommerceFormFieldKeyboardEventData {
|
|
6444
|
-
fieldType: string;
|
|
6445
|
-
}
|
|
6446
|
-
|
|
6447
|
-
declare interface PaypalCommerceFormFieldOptions {
|
|
6448
|
-
containerId: string;
|
|
6449
|
-
placeholder?: string;
|
|
6450
|
-
}
|
|
6451
|
-
|
|
6452
|
-
declare type PaypalCommerceFormFieldStyles = Partial<Pick<CSSStyleDeclaration, 'color' | 'fontFamily' | 'fontSize' | 'fontWeight'>>;
|
|
6453
|
-
|
|
6454
|
-
declare interface PaypalCommerceFormFieldStylesMap {
|
|
6455
|
-
default?: PaypalCommerceFormFieldStyles;
|
|
6456
|
-
error?: PaypalCommerceFormFieldStyles;
|
|
6457
|
-
focus?: PaypalCommerceFormFieldStyles;
|
|
6458
|
-
}
|
|
6459
|
-
|
|
6460
|
-
declare enum PaypalCommerceFormFieldType {
|
|
6461
|
-
CardCode = "cardCode",
|
|
6462
|
-
CardCodeVerification = "cardCodeVerification",
|
|
6463
|
-
CardExpiry = "cardExpiry",
|
|
6464
|
-
CardName = "cardName",
|
|
6465
|
-
CardNumber = "cardNumber",
|
|
6466
|
-
CardNumberVerification = "cardNumberVerification"
|
|
6467
|
-
}
|
|
6468
|
-
|
|
6469
|
-
declare interface PaypalCommerceFormFieldValidateErrorData {
|
|
6470
|
-
fieldType: string;
|
|
6471
|
-
message: string;
|
|
6472
|
-
type: string;
|
|
6473
|
-
}
|
|
6474
|
-
|
|
6475
|
-
declare interface PaypalCommerceFormFieldValidateEventData {
|
|
6476
|
-
errors: {
|
|
6477
|
-
[PaypalCommerceFormFieldType.CardCode]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6478
|
-
[PaypalCommerceFormFieldType.CardExpiry]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6479
|
-
[PaypalCommerceFormFieldType.CardName]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6480
|
-
[PaypalCommerceFormFieldType.CardNumber]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6481
|
-
[PaypalCommerceFormFieldType.CardCodeVerification]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6482
|
-
[PaypalCommerceFormFieldType.CardNumberVerification]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6483
|
-
};
|
|
6484
|
-
isValid: boolean;
|
|
6485
|
-
}
|
|
6486
|
-
|
|
6487
|
-
declare interface PaypalCommerceFormFieldsMap {
|
|
6488
|
-
[PaypalCommerceFormFieldType.CardCode]?: PaypalCommerceFormFieldOptions;
|
|
6489
|
-
[PaypalCommerceFormFieldType.CardExpiry]: PaypalCommerceFormFieldOptions;
|
|
6490
|
-
[PaypalCommerceFormFieldType.CardName]: PaypalCommerceFormFieldOptions;
|
|
6491
|
-
[PaypalCommerceFormFieldType.CardNumber]: PaypalCommerceFormFieldOptions;
|
|
6492
|
-
}
|
|
6493
|
-
|
|
6494
|
-
declare interface PaypalCommerceFormOptions {
|
|
6495
|
-
/**
|
|
6496
|
-
* Containers for fields can be to present in one set of values
|
|
6497
|
-
*
|
|
6498
|
-
* ```js
|
|
6499
|
-
* { cardNumber: { containerId: 'card-number' },
|
|
6500
|
-
* cardName: { containerId: 'card-name' },
|
|
6501
|
-
* cardExpiry: { containerId: 'card-expiry' },
|
|
6502
|
-
* cardCode: { containerId: 'card-code' }, }
|
|
6503
|
-
* ```
|
|
6504
|
-
*
|
|
6505
|
-
* Or in another set of values.
|
|
6506
|
-
*
|
|
6507
|
-
* ```js
|
|
6508
|
-
* { cardCodeVerification: { containerId: 'card-number' },
|
|
6509
|
-
* cardNumberVerification: { containerId: 'card-name' }, }
|
|
6510
|
-
* ```
|
|
6511
|
-
*/
|
|
6512
|
-
fields: PaypalCommerceFormFieldsMap | PaypalCommerceStoredCardFieldsMap;
|
|
6513
|
-
/**
|
|
6514
|
-
* Styles for inputs. Change the width, height and other styling.
|
|
6515
|
-
*
|
|
6516
|
-
* ```js
|
|
6517
|
-
* default: { color: '#000' },
|
|
6518
|
-
* error: { color: '#f00' },
|
|
6519
|
-
* focus: { color: '#0f0' }
|
|
6520
|
-
* ```
|
|
6521
|
-
*/
|
|
6522
|
-
styles?: PaypalCommerceFormFieldStylesMap;
|
|
6523
|
-
/**
|
|
6524
|
-
* A callback that gets called when a field loses focus.
|
|
6525
|
-
*/
|
|
6526
|
-
onBlur?(data: PaypalCommerceFormFieldBlurEventData): void;
|
|
6527
|
-
/**
|
|
6528
|
-
* A callback that gets called when activity within
|
|
6529
|
-
* the number field has changed such that the possible
|
|
6530
|
-
* card type has changed.
|
|
6531
|
-
*/
|
|
6532
|
-
onCardTypeChange?(data: PaypalCommerceFormFieldCardTypeChangeEventData): void;
|
|
6533
|
-
/**
|
|
6534
|
-
* A callback that gets called when a field gains focus.
|
|
6535
|
-
*/
|
|
6536
|
-
onFocus?(data: PaypalCommerceFormFieldFocusEventData): void;
|
|
6537
|
-
/**
|
|
6538
|
-
* A callback that gets called when the validity of a field has changed.
|
|
6539
|
-
*/
|
|
6540
|
-
onValidate?(data: PaypalCommerceFormFieldValidateEventData): void;
|
|
6541
|
-
/**
|
|
6542
|
-
* A callback that gets called when the user requests submission
|
|
6543
|
-
* of an input field, by pressing the Enter or Return key
|
|
6544
|
-
* on their keyboard, or mobile equivalent.
|
|
6545
|
-
*/
|
|
6546
|
-
onEnter?(data: PaypalCommerceFormFieldEnterEventData): void;
|
|
6547
|
-
}
|
|
6548
|
-
|
|
6549
|
-
/**
|
|
6550
|
-
* A set of options that are required to initialize the PayPal Commerce payment
|
|
6551
|
-
* method could be used for PayPal Smart Payment Buttons or PayPal Credit Card methods.
|
|
6552
|
-
*/
|
|
6553
|
-
declare type PaypalCommerceInitializeOptions = PaypalCommercePaymentInitializeOptions | PaypalCommerceCreditCardPaymentInitializeOptions;
|
|
6554
|
-
|
|
6555
6364
|
/**
|
|
6556
6365
|
* A set of options that are required to initialize the PayPal Commerce payment
|
|
6557
6366
|
* method for presenting its PayPal button.
|
|
@@ -6665,15 +6474,6 @@ declare interface PaypalCommercePaymentInitializeOptions {
|
|
|
6665
6474
|
onError?(error: Error): void;
|
|
6666
6475
|
}
|
|
6667
6476
|
|
|
6668
|
-
declare interface PaypalCommerceStoredCardFieldOptions extends PaypalCommerceFormFieldOptions {
|
|
6669
|
-
instrumentId: string;
|
|
6670
|
-
}
|
|
6671
|
-
|
|
6672
|
-
declare interface PaypalCommerceStoredCardFieldsMap {
|
|
6673
|
-
[PaypalCommerceFormFieldType.CardCodeVerification]?: PaypalCommerceStoredCardFieldOptions;
|
|
6674
|
-
[PaypalCommerceFormFieldType.CardNumberVerification]?: PaypalCommerceStoredCardFieldOptions;
|
|
6675
|
-
}
|
|
6676
|
-
|
|
6677
6477
|
/**
|
|
6678
6478
|
* A set of options that are required to initialize the PayPal Express payment
|
|
6679
6479
|
* method.
|
|
@@ -7719,6 +7519,14 @@ declare interface WithApplePayPaymentInitializeOptions {
|
|
|
7719
7519
|
applepay?: ApplePayPaymentInitializeOptions;
|
|
7720
7520
|
}
|
|
7721
7521
|
|
|
7522
|
+
declare interface WithBoltButtonInitializeOptions {
|
|
7523
|
+
/**
|
|
7524
|
+
* The options that are required to initialize the Bolt payment
|
|
7525
|
+
* method. They can be omitted unless you need to support Bolt.
|
|
7526
|
+
*/
|
|
7527
|
+
bolt?: BoltButtonInitializeOptions;
|
|
7528
|
+
}
|
|
7529
|
+
|
|
7722
7530
|
declare interface WithBoltPaymentInitializeOptions {
|
|
7723
7531
|
/**
|
|
7724
7532
|
* The options that are required to initialize the Bolt payment
|