@bigcommerce/checkout-sdk 1.248.2 → 1.251.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.
@@ -1039,7 +1039,7 @@ declare interface BoltPaymentInitializeOptions {
1039
1039
  declare interface BraintreeError extends Error {
1040
1040
  type: 'CUSTOMER' | 'MERCHANT' | 'NETWORK' | 'INTERNAL' | 'UNKNOWN';
1041
1041
  code: string;
1042
- message: string;
1042
+ details?: unknown;
1043
1043
  }
1044
1044
 
1045
1045
  declare type BraintreeFormFieldBlurEventData = BraintreeFormFieldKeyboardEventData;
@@ -1200,7 +1200,37 @@ declare interface BraintreePaymentInitializeOptions {
1200
1200
  form?: BraintreeFormOptions;
1201
1201
  }
1202
1202
 
1203
- declare interface BraintreePaypalButtonInitializeOptions {
1203
+ declare interface BraintreePaypalCreditButtonInitializeOptions {
1204
+ /**
1205
+ * A set of styling options for the checkout button.
1206
+ */
1207
+ style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
1208
+ /**
1209
+ * Address to be used for shipping.
1210
+ * If not provided, it will use the first saved address from the active customer.
1211
+ */
1212
+ shippingAddress?: Address | null;
1213
+ /**
1214
+ * A callback that gets called if unable to authorize and tokenize payment.
1215
+ *
1216
+ * @param error - The error object describing the failure.
1217
+ */
1218
+ onAuthorizeError?(error: BraintreeError | StandardError): void;
1219
+ /**
1220
+ * A callback that gets called if unable to submit payment.
1221
+ *
1222
+ * @param error - The error object describing the failure.
1223
+ */
1224
+ onPaymentError?(error: BraintreeError | StandardError): void;
1225
+ /**
1226
+ * A callback that gets called on any error instead of submit payment or authorization errors.
1227
+ *
1228
+ * @param error - The error object describing the failure.
1229
+ */
1230
+ onError?(error: BraintreeError | StandardError): void;
1231
+ }
1232
+
1233
+ declare interface BraintreePaypalV1ButtonInitializeOptions {
1204
1234
  /**
1205
1235
  * The ID of a container which the messaging should be inserted.
1206
1236
  */
@@ -1230,6 +1260,12 @@ declare interface BraintreePaypalButtonInitializeOptions {
1230
1260
  * @param error - The error object describing the failure.
1231
1261
  */
1232
1262
  onPaymentError?(error: BraintreeError | StandardError): void;
1263
+ /**
1264
+ * A callback that gets called on any error instead of submit payment or authorization errors.
1265
+ *
1266
+ * @param error - The error object describing the failure.
1267
+ */
1268
+ onError?(error: BraintreeError | StandardError): void;
1233
1269
  }
1234
1270
 
1235
1271
  declare interface BraintreeStoredCardFieldOptions extends BraintreeFormFieldOptions {
@@ -1624,12 +1660,17 @@ declare interface CheckoutButtonInitializeOptions extends CheckoutButtonOptions
1624
1660
  * The options that are required to facilitate Braintree PayPal. They can be
1625
1661
  * omitted unless you need to support Braintree PayPal.
1626
1662
  */
1627
- braintreepaypal?: BraintreePaypalButtonInitializeOptions;
1663
+ braintreepaypal?: BraintreePaypalV1ButtonInitializeOptions;
1664
+ /**
1665
+ * The options that are required to facilitate Braintree Credit. They can be
1666
+ * omitted unless you need to support Braintree Credit.
1667
+ */
1668
+ braintreepaypalcredit?: BraintreePaypalV1ButtonInitializeOptions;
1628
1669
  /**
1629
1670
  * The options that are required to facilitate Braintree Credit. They can be
1630
1671
  * omitted unless you need to support Braintree Credit.
1631
1672
  */
1632
- braintreepaypalcredit?: BraintreePaypalButtonInitializeOptions;
1673
+ braintreepaypalcreditv2?: BraintreePaypalCreditButtonInitializeOptions;
1633
1674
  /**
1634
1675
  * The options that are required to facilitate PayPal. They can be omitted
1635
1676
  * unless you need to support Paypal.
@@ -1787,6 +1828,7 @@ declare enum CheckoutButtonMethodType {
1787
1828
  BRAINTREE_PAYPAL = "braintreepaypal",
1788
1829
  BRAINTREE_VENMO = "braintreevenmo",
1789
1830
  BRAINTREE_PAYPAL_CREDIT = "braintreepaypalcredit",
1831
+ BRAINTREE_PAYPAL_CREDITV2 = "braintreepaypalcreditv2",
1790
1832
  GOOGLEPAY_ADYENV2 = "googlepayadyenv2",
1791
1833
  GOOGLEPAY_ADYENV3 = "googlepayadyenv3",
1792
1834
  GOOGLEPAY_AUTHORIZENET = "googlepayauthorizenet",
@@ -5449,6 +5491,8 @@ declare interface OrderPayment {
5449
5491
  amount: number;
5450
5492
  }
5451
5493
 
5494
+ declare type OrderPaymentInstrument = (CreditCardInstrument | HostedInstrument | HostedCreditCardInstrument | HostedVaultedInstrument | NonceInstrument | VaultedInstrument | CreditCardInstrument & WithDocumentInstrument | CreditCardInstrument & WithCheckoutcomFawryInstrument | CreditCardInstrument & WithCheckoutcomSEPAInstrument | CreditCardInstrument & WithCheckoutcomiDealInstrument | HostedInstrument & WithMollieIssuerInstrument | WithAccountCreation);
5495
+
5452
5496
  /**
5453
5497
  * An object that contains the payment information required for submitting an
5454
5498
  * order.
@@ -5466,7 +5510,7 @@ declare interface OrderPaymentRequestBody {
5466
5510
  * An object that contains the details of a credit card, vaulted payment
5467
5511
  * instrument or nonce instrument.
5468
5512
  */
5469
- paymentData?: CreditCardInstrument | HostedInstrument | HostedCreditCardInstrument | HostedVaultedInstrument | NonceInstrument | VaultedInstrument | CreditCardInstrument & WithDocumentInstrument | CreditCardInstrument & WithCheckoutcomFawryInstrument | CreditCardInstrument & WithCheckoutcomSEPAInstrument | CreditCardInstrument & WithCheckoutcomiDealInstrument | HostedInstrument & WithMollieIssuerInstrument | WithAccountCreation;
5513
+ paymentData?: OrderPaymentInstrument;
5470
5514
  }
5471
5515
 
5472
5516
  declare type OrderPayments = Array<GatewayOrderPayment | GiftCertificateOrderPayment>;
@@ -5799,12 +5843,32 @@ declare interface PaypalButtonInitializeOptions {
5799
5843
  onPaymentError?(error: StandardError): void;
5800
5844
  }
5801
5845
 
5846
+ declare enum PaypalButtonStyleColorOption {
5847
+ GOLD = "gold",
5848
+ BLUE = "blue",
5849
+ SIlVER = "silver",
5850
+ BLACK = "black"
5851
+ }
5852
+
5853
+ declare enum PaypalButtonStyleLabelOption {
5854
+ CHECKOUT = "checkout",
5855
+ PAY = "pay",
5856
+ BUYNOW = "buynow",
5857
+ PAYPAL = "paypal",
5858
+ CREDIT = "credit"
5859
+ }
5860
+
5861
+ declare enum PaypalButtonStyleLayoutOption {
5862
+ HORIZONTAL = "horizontal",
5863
+ VERTICAL = "vertical"
5864
+ }
5865
+
5802
5866
  declare interface PaypalButtonStyleOptions {
5803
- layout?: 'horizontal' | 'vertical';
5804
- size?: 'small' | 'medium' | 'large' | 'responsive';
5805
- color?: 'gold' | 'blue' | 'silver' | 'black';
5806
- label?: 'checkout' | 'pay' | 'buynow' | 'paypal' | 'credit';
5807
- shape?: 'pill' | 'rect';
5867
+ layout?: PaypalButtonStyleLayoutOption;
5868
+ size?: PaypalButtonStyleSizeOption;
5869
+ color?: PaypalButtonStyleColorOption;
5870
+ label?: PaypalButtonStyleLabelOption;
5871
+ shape?: PaypalButtonStyleShapeOption;
5808
5872
  tagline?: boolean;
5809
5873
  fundingicons?: boolean;
5810
5874
  height?: number;
@@ -5819,6 +5883,18 @@ declare interface PaypalButtonStyleOptions_2 {
5819
5883
  tagline?: boolean;
5820
5884
  }
5821
5885
 
5886
+ declare enum PaypalButtonStyleShapeOption {
5887
+ PILL = "pill",
5888
+ RECT = "rect"
5889
+ }
5890
+
5891
+ declare enum PaypalButtonStyleSizeOption {
5892
+ SMALL = "small",
5893
+ MEDIUM = "medium",
5894
+ LARGE = "large",
5895
+ RESPONSIVE = "responsive"
5896
+ }
5897
+
5822
5898
  declare interface PaypalCommerceButtonInitializeOptions {
5823
5899
  /**
5824
5900
  * A set of styling options for the checkout button.