@funnelfox/billing 0.9.0 → 0.9.3-ffb-apple-pay-continue-button.33

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/src/types.d.ts CHANGED
@@ -74,10 +74,40 @@ export interface BillingCardOptions extends CheckoutCardOptions {
74
74
  emailAddress?: BillingCardEmailAddressOptions;
75
75
  }
76
76
 
77
+ /**
78
+ * Apple Pay button types (https://developer.apple.com/documentation/applepayontheweb/applepaybuttontype).
79
+ *
80
+ * The legacy 7 values (Primer's union) render through Primer's CSS approach.
81
+ * The newer values (e.g. 'continue') cannot be rendered by WebKit via CSS, so
82
+ * the SDK overlays Apple's official <apple-pay-button> element on top of the
83
+ * Primer button and forwards clicks (see utils/apple-pay-native-button.ts,
84
+ * PRD-1426). Payment flow stays fully Primer-driven either way.
85
+ */
86
+ export type ApplePayButtonType =
87
+ | NonNullable<ApplePayOptions['buttonType']>
88
+ | 'add-money'
89
+ | 'continue'
90
+ | 'contribute'
91
+ | 'order'
92
+ | 'pay'
93
+ | 'reload'
94
+ | 'rent'
95
+ | 'support'
96
+ | 'tip'
97
+ | 'top-up';
98
+
99
+ export type BillingApplePayOptions = Omit<
100
+ ApplePayOptions,
101
+ 'container' | 'buttonType'
102
+ > & {
103
+ buttonType?: ApplePayButtonType;
104
+ };
105
+
77
106
  export interface PrimerCheckoutConfig extends Pick<
78
107
  Partial<HeadlessUniversalCheckoutOptions>,
79
- 'paypal' | 'applePay' | 'googlePay' | 'style'
108
+ 'paypal' | 'googlePay' | 'style'
80
109
  > {
110
+ applePay?: BillingApplePayOptions;
81
111
  card?: BillingCardOptions;
82
112
  cardSelectors?: CardInputSelectors;
83
113
  paymentButtonSelectors?: PaymentButtonSelectors;
@@ -109,7 +139,11 @@ export interface PaymentButtonSelectors {
109
139
  applePay: string;
110
140
  }
111
141
 
112
- export interface CheckoutOptions extends Partial<HeadlessUniversalCheckoutOptions> {
142
+ export interface CheckoutOptions extends Omit<
143
+ Partial<HeadlessUniversalCheckoutOptions>,
144
+ 'applePay'
145
+ > {
146
+ applePay?: BillingApplePayOptions;
113
147
  onTokenizeSuccess: OnTokenizeSuccess;
114
148
  onResumeSuccess: OnResumeSuccess;
115
149
  onAvailablePaymentMethodsLoad?: (items: PaymentMethod[]) => void;
@@ -350,12 +384,13 @@ export interface InitMethodOptions
350
384
  Partial<
351
385
  Pick<
352
386
  HeadlessUniversalCheckoutOptions,
353
- 'style' | 'card' | 'applePay' | 'paypal' | 'googlePay'
387
+ 'style' | 'card' | 'paypal' | 'googlePay'
354
388
  >
355
389
  >,
356
390
  'card'
357
391
  >,
358
392
  InitMethodCallbacks {
393
+ applePay?: BillingApplePayOptions;
359
394
  card?: BillingCardOptions;
360
395
  orgId: string;
361
396
  baseUrl?: string;