@bigcommerce/checkout-sdk 1.273.0 → 1.274.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 CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.274.0](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.273.0...v1.274.0) (2022-08-08)
6
+
7
+
8
+ ### Features
9
+
10
+ * **checkout:** CHECKOUT-6781 Point to interfaces extracted from integration packages ([d12f024](https://github.com/bigcommerce/checkout-sdk-js/commit/d12f024a3dc53db847900f8e3d87d8c4b88ee031))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **payment:** STRIPE-51 set a stored card as default during checkout ([#1498](https://github.com/bigcommerce/checkout-sdk-js/issues/1498)) ([d929a2d](https://github.com/bigcommerce/checkout-sdk-js/commit/d929a2d20cd424a4a88430a8571b7ab5e3dfff3d))
16
+
5
17
  ## [1.273.0](https://github.com/bigcommerce/checkout-sdk-js/compare/v1.272.3...v1.273.0) (2022-08-03)
6
18
 
7
19
 
@@ -129,103 +129,24 @@ declare interface ApplePayButtonInitializeOptions {
129
129
  onPaymentAuthorize(): void;
130
130
  }
131
131
 
132
- declare interface BraintreeError extends Error {
133
- type: 'CUSTOMER' | 'MERCHANT' | 'NETWORK' | 'INTERNAL' | 'UNKNOWN';
134
- code: string;
135
- details?: unknown;
136
- }
137
-
138
- declare interface BraintreePaypalButtonInitializeOptions {
139
- /**
140
- * The ID of a container which the messaging should be inserted.
141
- */
142
- messagingContainerId?: string;
143
- /**
144
- * A set of styling options for the checkout button.
145
- */
146
- style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
147
- /**
148
- * Address to be used for shipping.
149
- * If not provided, it will use the first saved address from the active customer.
150
- */
151
- shippingAddress?: Address | null;
152
- /**
153
- * A callback that gets called if unable to authorize and tokenize payment.
154
- *
155
- * @param error - The error object describing the failure.
156
- */
157
- onAuthorizeError?(error: BraintreeError | StandardError): void;
158
- /**
159
- * A callback that gets called if unable to submit payment.
160
- *
161
- * @param error - The error object describing the failure.
162
- */
163
- onPaymentError?(error: BraintreeError | StandardError): void;
164
- /**
165
- * A callback that gets called on any error instead of submit payment or authorization errors.
166
- *
167
- * @param error - The error object describing the failure.
168
- */
169
- onError?(error: BraintreeError | StandardError): void;
170
- }
171
-
172
- declare interface BraintreePaypalCreditButtonInitializeOptions {
173
- /**
174
- * A set of styling options for the checkout button.
175
- */
176
- style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
177
- /**
178
- * Address to be used for shipping.
179
- * If not provided, it will use the first saved address from the active customer.
180
- */
181
- shippingAddress?: Address | null;
182
- /**
183
- * A callback that gets called if unable to authorize and tokenize payment.
184
- *
185
- * @param error - The error object describing the failure.
186
- */
187
- onAuthorizeError?(error: BraintreeError | StandardError): void;
188
- /**
189
- * A callback that gets called if unable to submit payment.
190
- *
191
- * @param error - The error object describing the failure.
192
- */
193
- onPaymentError?(error: BraintreeError | StandardError): void;
132
+ /**
133
+ * A set of options that are required to initialize ApplePay in cart.
134
+ *
135
+ * When ApplePay is initialized, an ApplePay button will be inserted into the
136
+ * DOM. When a customer clicks on it, it will trigger Apple sheet.
137
+ */
138
+ declare interface ApplePayButtonInitializeOptions_2 {
194
139
  /**
195
- * A callback that gets called on any error instead of submit payment or authorization errors.
196
- *
197
- * @param error - The error object describing the failure.
140
+ * The class name of the ApplePay button style.
198
141
  */
199
- onError?(error: BraintreeError | StandardError): void;
200
- }
201
-
202
- declare interface BraintreeVenmoButtonInitializeOptions {
142
+ buttonClassName?: string;
203
143
  /**
204
- * A callback that gets called on any error.
205
- *
206
- * @param error - The error object describing the failure.
144
+ * A callback that gets called when a payment is successfully completed.
207
145
  */
208
- onError?(error: BraintreeError | StandardError): void;
209
- }
210
-
211
- declare enum ButtonColor {
212
- Default = "default",
213
- Black = "black",
214
- White = "white"
215
- }
216
-
217
- declare enum ButtonType {
218
- Long = "long",
219
- Short = "short"
220
- }
221
-
222
- declare class CheckoutButtonErrorSelector {
223
- private _checkoutButton;
224
- getInitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
225
- getDeinitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
146
+ onPaymentAuthorize(): void;
226
147
  }
227
148
 
228
- declare interface CheckoutButtonInitializeOptions extends CheckoutButtonOptions {
149
+ declare interface BaseCheckoutButtonInitializeOptions extends CheckoutButtonOptions {
229
150
  /**
230
151
  * The options that are required to initialize the ApplePay payment method.
231
152
  * They can be omitted unless you need to support ApplePay in cart.
@@ -322,6 +243,104 @@ declare interface CheckoutButtonInitializeOptions extends CheckoutButtonOptions
322
243
  paypalcommercevenmo?: PaypalCommerceVenmoButtonInitializeOptions;
323
244
  }
324
245
 
246
+ declare interface BraintreeError extends Error {
247
+ type: 'CUSTOMER' | 'MERCHANT' | 'NETWORK' | 'INTERNAL' | 'UNKNOWN';
248
+ code: string;
249
+ details?: unknown;
250
+ }
251
+
252
+ declare interface BraintreePaypalButtonInitializeOptions {
253
+ /**
254
+ * The ID of a container which the messaging should be inserted.
255
+ */
256
+ messagingContainerId?: string;
257
+ /**
258
+ * A set of styling options for the checkout button.
259
+ */
260
+ style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
261
+ /**
262
+ * Address to be used for shipping.
263
+ * If not provided, it will use the first saved address from the active customer.
264
+ */
265
+ shippingAddress?: Address | null;
266
+ /**
267
+ * A callback that gets called if unable to authorize and tokenize payment.
268
+ *
269
+ * @param error - The error object describing the failure.
270
+ */
271
+ onAuthorizeError?(error: BraintreeError | StandardError): void;
272
+ /**
273
+ * A callback that gets called if unable to submit payment.
274
+ *
275
+ * @param error - The error object describing the failure.
276
+ */
277
+ onPaymentError?(error: BraintreeError | StandardError): void;
278
+ /**
279
+ * A callback that gets called on any error instead of submit payment or authorization errors.
280
+ *
281
+ * @param error - The error object describing the failure.
282
+ */
283
+ onError?(error: BraintreeError | StandardError): void;
284
+ }
285
+
286
+ declare interface BraintreePaypalCreditButtonInitializeOptions {
287
+ /**
288
+ * A set of styling options for the checkout button.
289
+ */
290
+ style?: Pick<PaypalButtonStyleOptions, 'layout' | 'size' | 'color' | 'label' | 'shape' | 'tagline' | 'fundingicons' | 'height'>;
291
+ /**
292
+ * Address to be used for shipping.
293
+ * If not provided, it will use the first saved address from the active customer.
294
+ */
295
+ shippingAddress?: Address | null;
296
+ /**
297
+ * A callback that gets called if unable to authorize and tokenize payment.
298
+ *
299
+ * @param error - The error object describing the failure.
300
+ */
301
+ onAuthorizeError?(error: BraintreeError | StandardError): void;
302
+ /**
303
+ * A callback that gets called if unable to submit payment.
304
+ *
305
+ * @param error - The error object describing the failure.
306
+ */
307
+ onPaymentError?(error: BraintreeError | StandardError): void;
308
+ /**
309
+ * A callback that gets called on any error instead of submit payment or authorization errors.
310
+ *
311
+ * @param error - The error object describing the failure.
312
+ */
313
+ onError?(error: BraintreeError | StandardError): void;
314
+ }
315
+
316
+ declare interface BraintreeVenmoButtonInitializeOptions {
317
+ /**
318
+ * A callback that gets called on any error.
319
+ *
320
+ * @param error - The error object describing the failure.
321
+ */
322
+ onError?(error: BraintreeError | StandardError): void;
323
+ }
324
+
325
+ declare enum ButtonColor {
326
+ Default = "default",
327
+ Black = "black",
328
+ White = "white"
329
+ }
330
+
331
+ declare enum ButtonType {
332
+ Long = "long",
333
+ Short = "short"
334
+ }
335
+
336
+ declare class CheckoutButtonErrorSelector {
337
+ private _checkoutButton;
338
+ getInitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
339
+ getDeinitializeButtonError(methodId?: CheckoutButtonMethodType): Error | undefined;
340
+ }
341
+
342
+ declare type CheckoutButtonInitializeOptions = BaseCheckoutButtonInitializeOptions & WithApplePayButtonInitializeOptions;
343
+
325
344
  declare class CheckoutButtonInitializer {
326
345
  private _store;
327
346
  private _buttonStrategyActionCreator;
@@ -645,6 +664,10 @@ declare enum StyleButtonShape {
645
664
  rect = "rect"
646
665
  }
647
666
 
667
+ declare interface WithApplePayButtonInitializeOptions {
668
+ applepay?: ApplePayButtonInitializeOptions_2;
669
+ }
670
+
648
671
  /**
649
672
  * Creates an instance of `CheckoutButtonInitializer`.
650
673
  *