@clickaroo/checkout-ui 1.1.3-beta → 1.2.1-beta

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React$1, { ReactNode } from 'react';
3
- import { LayoutObject, Appearance } from '@stripe/stripe-js';
3
+ import { LayoutObject, Appearance, StripeExpressCheckoutElementOptions, ExpressPaymentType } from '@stripe/stripe-js';
4
4
  import { z } from 'zod';
5
5
  import { BrowserOptions } from '@sentry/react';
6
6
 
@@ -39,6 +39,7 @@ interface CheckoutPageProps {
39
39
  onOrderSubmit?: OnOrderSubmitCallback;
40
40
  onOrderSuccess?: OnOrderSuccessCallback;
41
41
  styles?: React.CSSProperties;
42
+ showExpressButtons?: boolean;
42
43
  }
43
44
  declare const CheckoutPage: (props: CheckoutPageProps) => react_jsx_runtime.JSX.Element;
44
45
 
@@ -93,6 +94,31 @@ interface PaymentMethodsProps {
93
94
  }
94
95
  declare const PaymentMethods: React$1.FC<PaymentMethodsProps>;
95
96
 
97
+ interface ClickarooInfo {
98
+ offer_code: string;
99
+ type: "one_off" | "subscription_schedules";
100
+ payment: {
101
+ type: "stripe";
102
+ data: ClickarooPaymentStripe;
103
+ };
104
+ subscription_schedules?: {
105
+ phase: number;
106
+ price_in_cents: number;
107
+ currency: string;
108
+ quantity: number;
109
+ period: string;
110
+ }[];
111
+ one_off?: {
112
+ price_in_cents: number;
113
+ currency: string;
114
+ quantity: number;
115
+ };
116
+ }
117
+ interface ClickarooPaymentStripe {
118
+ publishable_key: string;
119
+ account_id: string;
120
+ }
121
+
96
122
  declare enum OrderPaymentStatus {
97
123
  PENDING = "pending",
98
124
  PAID = "paid",
@@ -114,8 +140,8 @@ interface OrderShippingAddress {
114
140
  zip: string;
115
141
  }
116
142
  interface OrderPaymentData {
117
- confirmation_token_id: string;
118
- payment_method_types: string[];
143
+ confirmation_token_id?: string;
144
+ payment_method_types?: string[];
119
145
  }
120
146
  interface OrderPayment {
121
147
  type: 'stripe';
@@ -245,30 +271,13 @@ interface OrderDetail {
245
271
  updated_at: string;
246
272
  }
247
273
 
248
- interface ClickarooInfo {
249
- offer_code: string;
250
- type: "one_off" | "subscription_schedules";
251
- payment: {
252
- type: "stripe";
253
- data: ClickarooPaymentStripe;
254
- };
255
- subscription_schedules?: {
256
- phase: number;
257
- price_in_cents: number;
258
- currency: string;
259
- quantity: number;
260
- period: string;
261
- }[];
262
- one_off?: {
263
- price_in_cents: number;
264
- currency: string;
265
- quantity: number;
266
- };
267
- }
268
- interface ClickarooPaymentStripe {
269
- publishable_key: string;
270
- account_id: string;
274
+ interface ExpressButtonsProps {
275
+ styles?: React$1.CSSProperties;
276
+ options?: StripeExpressCheckoutElementOptions;
277
+ onOrderSubmit?: OnOrderSubmitCallback;
278
+ onOrderSuccess?: OnOrderSuccessCallback;
271
279
  }
280
+ declare const ExpressButtons: React$1.FC<ExpressButtonsProps>;
272
281
 
273
282
  interface ApiClientConfig {
274
283
  baseUrl: string;
@@ -331,6 +340,8 @@ interface CheckoutProviderProps {
331
340
  baseUrl: string;
332
341
  onCheckoutInit?: OnCheckoutInitCallback;
333
342
  metadata?: Record<string, string>;
343
+ locale?: string;
344
+ paymentMethodTypes?: string[];
334
345
  }
335
346
  declare const CheckoutProvider: React$1.FC<CheckoutProviderProps>;
336
347
 
@@ -421,10 +432,16 @@ interface UseOrderSubmissionOptions {
421
432
  /** handle 3DS authentication */
422
433
  on3DSAuthStart?: (action: ThreeDSAction) => Promise<OrderSubmissionResult>;
423
434
  }
435
+ interface SubmitOrderOverrides {
436
+ customerInfo?: Partial<CustomerInfo>;
437
+ deliveryAddress?: Partial<DeliveryAddress>;
438
+ expressPaymentType?: ExpressPaymentType;
439
+ }
424
440
  declare const useOrderSubmission: (options?: UseOrderSubmissionOptions) => {
425
441
  isSubmitting: boolean;
426
- submitOrder: () => Promise<OrderSubmissionResult>;
442
+ submitOrder: (overrides?: SubmitOrderOverrides | undefined) => Promise<OrderSubmissionResult>;
427
443
  retryOrder: () => Promise<OrderSubmissionResult>;
444
+ confirmPaymentStatus: (orderCode: string, tradeCode: string) => Promise<OrderSubmissionResult>;
428
445
  failedAdviceCode: AdviceCode | undefined;
429
446
  };
430
447
 
@@ -470,5 +487,5 @@ declare const getPricePointInfo: (baseUrl: string, offerPricePoints: string | st
470
487
  error?: PricePointApiError;
471
488
  }>;
472
489
 
473
- export { AdviceCode, ApiClient, SubmitButton as ButtonGroup, CheckoutPage, CheckoutProvider, ClickarooProvider, CustomInfo as CustomerInfo, DeliveryAddress$1 as DeliveryAddress, FulfillmentStatus, OrderPaymentStatus, OrderStatus, PaymentMethods, PaymentType, RefundStatus, createOrderWithToken as createOrder, getOrderDetail, getPricePointInfo, useCheckoutContextPublic as useCheckoutContext, useClickarooParams, useOrderDetail, useOrderSubmission };
490
+ export { AdviceCode, ApiClient, SubmitButton as ButtonGroup, CheckoutPage, CheckoutProvider, ClickarooProvider, CustomInfo as CustomerInfo, DeliveryAddress$1 as DeliveryAddress, ExpressButtons, FulfillmentStatus, OrderPaymentStatus, OrderStatus, PaymentMethods, PaymentType, RefundStatus, createOrderWithToken as createOrder, getOrderDetail, getPricePointInfo, useCheckoutContextPublic as useCheckoutContext, useClickarooParams, useOrderDetail, useOrderSubmission };
474
491
  export type { ApiClientConfig, ApiResponse, CartItem, CheckoutCartItem, ClickarooContextType, ClickarooInfo, ClickarooPaymentStripe, ClickarooProviderConfig, ClickarooSentryConfig, ConfirmPaymentData, CreateOrderItem, CreateOrderRequest, CreateOrderResponse, CustomerInfo as CustomerInfoType, DeliveryAddress as DeliveryAddressType, OnCheckoutInitCallback, OnOrderSubmitCallback, OnOrderSuccessCallback, OnPaymentInfoCompleteCallback, OrderAddress, OrderApiError, OrderCustomer, OrderCustomerInfo, OrderDetail, OrderDetailMetadata, OrderItem, OrderMetadata, OrderPayment, OrderPaymentData, OrderShippingAddress, RetryPaymentData, RetryPaymentRequest, UpdateOrderRequest, UseCheckoutContextPublic as UseCheckoutContext };