@bigcommerce/checkout-sdk 1.369.0 → 1.369.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 +15 -0
- 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 +95 -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/DeprecatedPayPalCommerceCreditCardsPaymentInitializeOptions.md +17 -0
- package/docs/interfaces/{PaypalCommerceCreditCardPaymentInitializeOptions.md → PayPalCommerceCreditCardsPaymentInitializeOptions.md} +8 -8
- package/docs/interfaces/WithPayPalCommerceCreditCardsPaymentInitializeOptions.md +22 -0
- package/package.json +1 -1
- package/docs/enums/PaypalCommerceFormFieldType.md +0 -50
- 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.
|
|
@@ -4522,6 +4522,13 @@ declare interface CustomerRequestOptions extends RequestOptions {
|
|
|
4522
4522
|
methodId?: string;
|
|
4523
4523
|
}
|
|
4524
4524
|
|
|
4525
|
+
declare interface DeprecatedPayPalCommerceCreditCardsPaymentInitializeOptions {
|
|
4526
|
+
/**
|
|
4527
|
+
* The form is data for Credit Card Form
|
|
4528
|
+
*/
|
|
4529
|
+
form?: HostedFormOptions_2;
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4525
4532
|
declare interface DigitalItem extends LineItem {
|
|
4526
4533
|
downloadFileUrls: string[];
|
|
4527
4534
|
downloadPageUrl: string;
|
|
@@ -6043,6 +6050,87 @@ declare interface PayPalCommerceCreditButtonInitializeOptions {
|
|
|
6043
6050
|
onComplete?(): void;
|
|
6044
6051
|
}
|
|
6045
6052
|
|
|
6053
|
+
/**
|
|
6054
|
+
* A set of options that are required to initialize the PayPal Commerce payment
|
|
6055
|
+
* method for presenting its credit card form.
|
|
6056
|
+
*
|
|
6057
|
+
* ```html
|
|
6058
|
+
* <!-- These containers are where the hosted (iframed) credit card fields will be inserted -->
|
|
6059
|
+
* <div id="card-number"></div>
|
|
6060
|
+
* <div id="card-name"></div>
|
|
6061
|
+
* <div id="card-expiry"></div>
|
|
6062
|
+
* <div id="card-code"></div>
|
|
6063
|
+
* ```
|
|
6064
|
+
*
|
|
6065
|
+
* ```js
|
|
6066
|
+
* service.initializePayment({
|
|
6067
|
+
* methodId: 'paypalcommercecreditcard',
|
|
6068
|
+
* paypalcommercecreditcard: {
|
|
6069
|
+
* form: {
|
|
6070
|
+
* fields: {
|
|
6071
|
+
* cardNumber: { containerId: 'card-number' },
|
|
6072
|
+
* cardName: { containerId: 'card-name' },
|
|
6073
|
+
* cardExpiry: { containerId: 'card-expiry' },
|
|
6074
|
+
* cardCode: { containerId: 'card-code' },
|
|
6075
|
+
* },
|
|
6076
|
+
* },
|
|
6077
|
+
* },
|
|
6078
|
+
* });
|
|
6079
|
+
* ```
|
|
6080
|
+
*
|
|
6081
|
+
* Additional options can be passed in to customize the fields and register
|
|
6082
|
+
* event callbacks.
|
|
6083
|
+
*
|
|
6084
|
+
* ```js
|
|
6085
|
+
* service.initializePayment({
|
|
6086
|
+
* methodId: 'paypalcommercecreditcard',
|
|
6087
|
+
* paypalcommercecreditcard: {
|
|
6088
|
+
* form: {
|
|
6089
|
+
* fields: {
|
|
6090
|
+
* cardNumber: { containerId: 'card-number', placeholder: 'Number of card' },
|
|
6091
|
+
* cardName: { containerId: 'card-name', placeholder: 'Name of card' },
|
|
6092
|
+
* cardExpiry: { containerId: 'card-expiry', placeholder: 'Expiry of card' },
|
|
6093
|
+
* cardCode: { containerId: 'card-code', placeholder: 'Code of card' },
|
|
6094
|
+
* },
|
|
6095
|
+
* styles: {
|
|
6096
|
+
* default: {
|
|
6097
|
+
* color: '#000',
|
|
6098
|
+
* },
|
|
6099
|
+
* error: {
|
|
6100
|
+
* color: '#f00',
|
|
6101
|
+
* },
|
|
6102
|
+
* focus: {
|
|
6103
|
+
* color: '#0f0',
|
|
6104
|
+
* },
|
|
6105
|
+
* },
|
|
6106
|
+
* onBlur({ fieldType }) {
|
|
6107
|
+
* console.log(fieldType);
|
|
6108
|
+
* },
|
|
6109
|
+
* onFocus({ fieldType }) {
|
|
6110
|
+
* console.log(fieldType);
|
|
6111
|
+
* },
|
|
6112
|
+
* onEnter({ fieldType }) {
|
|
6113
|
+
* console.log(fieldType);
|
|
6114
|
+
* },
|
|
6115
|
+
* onCardTypeChange({ cardType }) {
|
|
6116
|
+
* console.log(cardType);
|
|
6117
|
+
* },
|
|
6118
|
+
* onValidate({ errors, isValid }) {
|
|
6119
|
+
* console.log(errors);
|
|
6120
|
+
* console.log(isValid);
|
|
6121
|
+
* },
|
|
6122
|
+
* },
|
|
6123
|
+
* },
|
|
6124
|
+
* });
|
|
6125
|
+
* ```
|
|
6126
|
+
*/
|
|
6127
|
+
declare interface PayPalCommerceCreditCardsPaymentInitializeOptions {
|
|
6128
|
+
/**
|
|
6129
|
+
* The form is data for Credit Card Form
|
|
6130
|
+
*/
|
|
6131
|
+
form: HostedFormOptions_2;
|
|
6132
|
+
}
|
|
6133
|
+
|
|
6046
6134
|
declare interface PayPalCommerceCreditCustomerInitializeOptions {
|
|
6047
6135
|
/**
|
|
6048
6136
|
* The ID of a container which the checkout button should be inserted into.
|
|
@@ -6142,7 +6230,7 @@ declare interface PayPalInstrument extends BaseAccountInstrument {
|
|
|
6142
6230
|
method: 'paypal';
|
|
6143
6231
|
}
|
|
6144
6232
|
|
|
6145
|
-
declare type PaymentInitializeOptions = BasePaymentInitializeOptions & WithAdyenV2PaymentInitializeOptions & WithAdyenV3PaymentInitializeOptions & WithApplePayPaymentInitializeOptions & WithBoltPaymentInitializeOptions & WithCreditCardPaymentInitializeOptions & WithSquareV2PaymentInitializeOptions;
|
|
6233
|
+
declare type PaymentInitializeOptions = BasePaymentInitializeOptions & WithAdyenV2PaymentInitializeOptions & WithAdyenV3PaymentInitializeOptions & WithApplePayPaymentInitializeOptions & WithBoltPaymentInitializeOptions & WithCreditCardPaymentInitializeOptions & WithPayPalCommerceCreditCardsPaymentInitializeOptions & WithSquareV2PaymentInitializeOptions;
|
|
6146
6234
|
|
|
6147
6235
|
declare type PaymentInstrument = CardInstrument | AccountInstrument;
|
|
6148
6236
|
|
|
@@ -6261,209 +6349,6 @@ declare enum PaypalButtonStyleSizeOption {
|
|
|
6261
6349
|
RESPONSIVE = "responsive"
|
|
6262
6350
|
}
|
|
6263
6351
|
|
|
6264
|
-
/**
|
|
6265
|
-
* A set of options that are required to initialize the PayPal Commerce payment
|
|
6266
|
-
* method for presenting its credit card form.
|
|
6267
|
-
*
|
|
6268
|
-
* ```html
|
|
6269
|
-
* <!-- These containers are where the hosted (iframed) credit card fields will be inserted -->
|
|
6270
|
-
* <div id="card-number"></div>
|
|
6271
|
-
* <div id="card-name"></div>
|
|
6272
|
-
* <div id="card-expiry"></div>
|
|
6273
|
-
* <div id="card-code"></div>
|
|
6274
|
-
* ```
|
|
6275
|
-
*
|
|
6276
|
-
* ```js
|
|
6277
|
-
* service.initializePayment({
|
|
6278
|
-
* methodId: 'paypalcommerce',
|
|
6279
|
-
* paypalcommerce: {
|
|
6280
|
-
* form: {
|
|
6281
|
-
* fields: {
|
|
6282
|
-
* cardNumber: { containerId: 'card-number' },
|
|
6283
|
-
* cardName: { containerId: 'card-name' },
|
|
6284
|
-
* cardExpiry: { containerId: 'card-expiry' },
|
|
6285
|
-
* cardCode: { containerId: 'card-code' },
|
|
6286
|
-
* },
|
|
6287
|
-
* },
|
|
6288
|
-
* },
|
|
6289
|
-
* });
|
|
6290
|
-
* ```
|
|
6291
|
-
*
|
|
6292
|
-
* Additional options can be passed in to customize the fields and register
|
|
6293
|
-
* event callbacks.
|
|
6294
|
-
*
|
|
6295
|
-
* ```js
|
|
6296
|
-
* service.initializePayment({
|
|
6297
|
-
* methodId: 'paypalcommerce',
|
|
6298
|
-
* creditCard: {
|
|
6299
|
-
* form: {
|
|
6300
|
-
* fields: {
|
|
6301
|
-
* cardNumber: { containerId: 'card-number', placeholder: 'Number of card' },
|
|
6302
|
-
* cardName: { containerId: 'card-name', placeholder: 'Name of card' },
|
|
6303
|
-
* cardExpiry: { containerId: 'card-expiry', placeholder: 'Expiry of card' },
|
|
6304
|
-
* cardCode: { containerId: 'card-code', placeholder: 'Code of card' },
|
|
6305
|
-
* },
|
|
6306
|
-
* styles: {
|
|
6307
|
-
* default: {
|
|
6308
|
-
* color: '#000',
|
|
6309
|
-
* },
|
|
6310
|
-
* error: {
|
|
6311
|
-
* color: '#f00',
|
|
6312
|
-
* },
|
|
6313
|
-
* focus: {
|
|
6314
|
-
* color: '#0f0',
|
|
6315
|
-
* },
|
|
6316
|
-
* },
|
|
6317
|
-
* onBlur({ fieldType }) {
|
|
6318
|
-
* console.log(fieldType);
|
|
6319
|
-
* },
|
|
6320
|
-
* onFocus({ fieldType }) {
|
|
6321
|
-
* console.log(fieldType);
|
|
6322
|
-
* },
|
|
6323
|
-
* onEnter({ fieldType }) {
|
|
6324
|
-
* console.log(fieldType);
|
|
6325
|
-
* },
|
|
6326
|
-
* onCardTypeChange({ cardType }) {
|
|
6327
|
-
* console.log(cardType);
|
|
6328
|
-
* },
|
|
6329
|
-
* onValidate({ errors, isValid }) {
|
|
6330
|
-
* console.log(errors);
|
|
6331
|
-
* console.log(isValid);
|
|
6332
|
-
* },
|
|
6333
|
-
* },
|
|
6334
|
-
* },
|
|
6335
|
-
* });
|
|
6336
|
-
* ```
|
|
6337
|
-
*/
|
|
6338
|
-
declare interface PaypalCommerceCreditCardPaymentInitializeOptions {
|
|
6339
|
-
/**
|
|
6340
|
-
* The form is data for Credit Card Form
|
|
6341
|
-
*/
|
|
6342
|
-
form: PaypalCommerceFormOptions;
|
|
6343
|
-
}
|
|
6344
|
-
|
|
6345
|
-
declare type PaypalCommerceFormFieldBlurEventData = PaypalCommerceFormFieldKeyboardEventData;
|
|
6346
|
-
|
|
6347
|
-
declare interface PaypalCommerceFormFieldCardTypeChangeEventData {
|
|
6348
|
-
cardType?: string;
|
|
6349
|
-
}
|
|
6350
|
-
|
|
6351
|
-
declare type PaypalCommerceFormFieldEnterEventData = PaypalCommerceFormFieldKeyboardEventData;
|
|
6352
|
-
|
|
6353
|
-
declare type PaypalCommerceFormFieldFocusEventData = PaypalCommerceFormFieldKeyboardEventData;
|
|
6354
|
-
|
|
6355
|
-
declare interface PaypalCommerceFormFieldKeyboardEventData {
|
|
6356
|
-
fieldType: string;
|
|
6357
|
-
}
|
|
6358
|
-
|
|
6359
|
-
declare interface PaypalCommerceFormFieldOptions {
|
|
6360
|
-
containerId: string;
|
|
6361
|
-
placeholder?: string;
|
|
6362
|
-
}
|
|
6363
|
-
|
|
6364
|
-
declare type PaypalCommerceFormFieldStyles = Partial<Pick<CSSStyleDeclaration, 'color' | 'fontFamily' | 'fontSize' | 'fontWeight'>>;
|
|
6365
|
-
|
|
6366
|
-
declare interface PaypalCommerceFormFieldStylesMap {
|
|
6367
|
-
default?: PaypalCommerceFormFieldStyles;
|
|
6368
|
-
error?: PaypalCommerceFormFieldStyles;
|
|
6369
|
-
focus?: PaypalCommerceFormFieldStyles;
|
|
6370
|
-
}
|
|
6371
|
-
|
|
6372
|
-
declare enum PaypalCommerceFormFieldType {
|
|
6373
|
-
CardCode = "cardCode",
|
|
6374
|
-
CardCodeVerification = "cardCodeVerification",
|
|
6375
|
-
CardExpiry = "cardExpiry",
|
|
6376
|
-
CardName = "cardName",
|
|
6377
|
-
CardNumber = "cardNumber",
|
|
6378
|
-
CardNumberVerification = "cardNumberVerification"
|
|
6379
|
-
}
|
|
6380
|
-
|
|
6381
|
-
declare interface PaypalCommerceFormFieldValidateErrorData {
|
|
6382
|
-
fieldType: string;
|
|
6383
|
-
message: string;
|
|
6384
|
-
type: string;
|
|
6385
|
-
}
|
|
6386
|
-
|
|
6387
|
-
declare interface PaypalCommerceFormFieldValidateEventData {
|
|
6388
|
-
errors: {
|
|
6389
|
-
[PaypalCommerceFormFieldType.CardCode]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6390
|
-
[PaypalCommerceFormFieldType.CardExpiry]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6391
|
-
[PaypalCommerceFormFieldType.CardName]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6392
|
-
[PaypalCommerceFormFieldType.CardNumber]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6393
|
-
[PaypalCommerceFormFieldType.CardCodeVerification]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6394
|
-
[PaypalCommerceFormFieldType.CardNumberVerification]?: PaypalCommerceFormFieldValidateErrorData[];
|
|
6395
|
-
};
|
|
6396
|
-
isValid: boolean;
|
|
6397
|
-
}
|
|
6398
|
-
|
|
6399
|
-
declare interface PaypalCommerceFormFieldsMap {
|
|
6400
|
-
[PaypalCommerceFormFieldType.CardCode]?: PaypalCommerceFormFieldOptions;
|
|
6401
|
-
[PaypalCommerceFormFieldType.CardExpiry]: PaypalCommerceFormFieldOptions;
|
|
6402
|
-
[PaypalCommerceFormFieldType.CardName]: PaypalCommerceFormFieldOptions;
|
|
6403
|
-
[PaypalCommerceFormFieldType.CardNumber]: PaypalCommerceFormFieldOptions;
|
|
6404
|
-
}
|
|
6405
|
-
|
|
6406
|
-
declare interface PaypalCommerceFormOptions {
|
|
6407
|
-
/**
|
|
6408
|
-
* Containers for fields can be to present in one set of values
|
|
6409
|
-
*
|
|
6410
|
-
* ```js
|
|
6411
|
-
* { cardNumber: { containerId: 'card-number' },
|
|
6412
|
-
* cardName: { containerId: 'card-name' },
|
|
6413
|
-
* cardExpiry: { containerId: 'card-expiry' },
|
|
6414
|
-
* cardCode: { containerId: 'card-code' }, }
|
|
6415
|
-
* ```
|
|
6416
|
-
*
|
|
6417
|
-
* Or in another set of values.
|
|
6418
|
-
*
|
|
6419
|
-
* ```js
|
|
6420
|
-
* { cardCodeVerification: { containerId: 'card-number' },
|
|
6421
|
-
* cardNumberVerification: { containerId: 'card-name' }, }
|
|
6422
|
-
* ```
|
|
6423
|
-
*/
|
|
6424
|
-
fields: PaypalCommerceFormFieldsMap | PaypalCommerceStoredCardFieldsMap;
|
|
6425
|
-
/**
|
|
6426
|
-
* Styles for inputs. Change the width, height and other styling.
|
|
6427
|
-
*
|
|
6428
|
-
* ```js
|
|
6429
|
-
* default: { color: '#000' },
|
|
6430
|
-
* error: { color: '#f00' },
|
|
6431
|
-
* focus: { color: '#0f0' }
|
|
6432
|
-
* ```
|
|
6433
|
-
*/
|
|
6434
|
-
styles?: PaypalCommerceFormFieldStylesMap;
|
|
6435
|
-
/**
|
|
6436
|
-
* A callback that gets called when a field loses focus.
|
|
6437
|
-
*/
|
|
6438
|
-
onBlur?(data: PaypalCommerceFormFieldBlurEventData): void;
|
|
6439
|
-
/**
|
|
6440
|
-
* A callback that gets called when activity within
|
|
6441
|
-
* the number field has changed such that the possible
|
|
6442
|
-
* card type has changed.
|
|
6443
|
-
*/
|
|
6444
|
-
onCardTypeChange?(data: PaypalCommerceFormFieldCardTypeChangeEventData): void;
|
|
6445
|
-
/**
|
|
6446
|
-
* A callback that gets called when a field gains focus.
|
|
6447
|
-
*/
|
|
6448
|
-
onFocus?(data: PaypalCommerceFormFieldFocusEventData): void;
|
|
6449
|
-
/**
|
|
6450
|
-
* A callback that gets called when the validity of a field has changed.
|
|
6451
|
-
*/
|
|
6452
|
-
onValidate?(data: PaypalCommerceFormFieldValidateEventData): void;
|
|
6453
|
-
/**
|
|
6454
|
-
* A callback that gets called when the user requests submission
|
|
6455
|
-
* of an input field, by pressing the Enter or Return key
|
|
6456
|
-
* on their keyboard, or mobile equivalent.
|
|
6457
|
-
*/
|
|
6458
|
-
onEnter?(data: PaypalCommerceFormFieldEnterEventData): void;
|
|
6459
|
-
}
|
|
6460
|
-
|
|
6461
|
-
/**
|
|
6462
|
-
* A set of options that are required to initialize the PayPal Commerce payment
|
|
6463
|
-
* method could be used for PayPal Smart Payment Buttons or PayPal Credit Card methods.
|
|
6464
|
-
*/
|
|
6465
|
-
declare type PaypalCommerceInitializeOptions = PaypalCommercePaymentInitializeOptions | PaypalCommerceCreditCardPaymentInitializeOptions;
|
|
6466
|
-
|
|
6467
6352
|
/**
|
|
6468
6353
|
* A set of options that are required to initialize the PayPal Commerce payment
|
|
6469
6354
|
* method for presenting its PayPal button.
|
|
@@ -6577,15 +6462,6 @@ declare interface PaypalCommercePaymentInitializeOptions {
|
|
|
6577
6462
|
onError?(error: Error): void;
|
|
6578
6463
|
}
|
|
6579
6464
|
|
|
6580
|
-
declare interface PaypalCommerceStoredCardFieldOptions extends PaypalCommerceFormFieldOptions {
|
|
6581
|
-
instrumentId: string;
|
|
6582
|
-
}
|
|
6583
|
-
|
|
6584
|
-
declare interface PaypalCommerceStoredCardFieldsMap {
|
|
6585
|
-
[PaypalCommerceFormFieldType.CardCodeVerification]?: PaypalCommerceStoredCardFieldOptions;
|
|
6586
|
-
[PaypalCommerceFormFieldType.CardNumberVerification]?: PaypalCommerceStoredCardFieldOptions;
|
|
6587
|
-
}
|
|
6588
|
-
|
|
6589
6465
|
/**
|
|
6590
6466
|
* A set of options that are required to initialize the PayPal Express payment
|
|
6591
6467
|
* method.
|
|
@@ -7691,6 +7567,11 @@ declare interface WithPayPalCommerceCreditButtonInitializeOptions {
|
|
|
7691
7567
|
paypalcommercecredit?: PayPalCommerceCreditButtonInitializeOptions;
|
|
7692
7568
|
}
|
|
7693
7569
|
|
|
7570
|
+
declare interface WithPayPalCommerceCreditCardsPaymentInitializeOptions {
|
|
7571
|
+
paypalcommercecreditcards?: PayPalCommerceCreditCardsPaymentInitializeOptions;
|
|
7572
|
+
paypalcommerce?: DeprecatedPayPalCommerceCreditCardsPaymentInitializeOptions;
|
|
7573
|
+
}
|
|
7574
|
+
|
|
7694
7575
|
declare interface WithPayPalCommerceCreditCustomerInitializeOptions {
|
|
7695
7576
|
paypalcommercecredit?: PayPalCommerceCreditCustomerInitializeOptions;
|
|
7696
7577
|
}
|