@authvia/payment-method-create 2.0.0 → 2.0.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.
@@ -1,10 +1,13 @@
1
1
  import { ApplePayBillingContactField, ApplePayPaymentRequest } from '../../types/applePay/sdk';
2
2
  import { ApplePayConfig } from '../../utils/applePayConfig';
3
3
  /**
4
- * Apple's encrypted `paymentData` carries no billing details, so they reach Authvia only when
5
- * requested here and forwarded from the plaintext `billingContact`.
4
+ * Host opt-in billing fields for the Apple Pay sheet. Default: none.
5
+ *
6
+ * When `applePay.requiredBillingContactFields` includes `postalAddress`, Apple may still return
7
+ * `givenName` / `familyName` with the address — platform behavior, not a separate host field.
8
+ * @see https://developer.apple.com/documentation/applepayontheweb/applepaypaymentrequest/requiredbillingcontactfields
6
9
  */
7
- export declare const DEFAULT_REQUIRED_BILLING_CONTACT_FIELDS: ApplePayBillingContactField[];
10
+ export declare function resolveRequiredBillingContactFields(applePay: boolean | ApplePayConfig | undefined): ApplePayBillingContactField[];
8
11
  /**
9
12
  * Normalized total amount. Apple requires a `total` on every request - there is no save-only
10
13
  * mode - so a card-on-file flow with no amount still sends one, as zero.
@@ -1,4 +1,4 @@
1
- import { ApplePayCardType, ApplePayRecurringInterval } from './common';
1
+ import { ApplePayBillingContactField, ApplePayCardType, ApplePayRecurringInterval } from './common';
2
2
  import { ApplePayPaymentRequest } from './sdk';
3
3
  export type { ApplePayAuthorizedPayment, ApplePayContact, ApplePayPaymentMethodCreatePayload, ApplePayPaymentToken, } from './payment';
4
4
  export type { ApplePayCardType } from './common';
@@ -49,6 +49,11 @@ export interface ApplePayConfig {
49
49
  recurring?: ApplePayRecurringConfig;
50
50
  acceptedCardTypes?: 'both' | 'credit' | 'debit';
51
51
  surcharge?: ApplePaySurchargeConfig;
52
+ /**
53
+ * Billing fields Apple must collect on the sheet. Omit or pass `[]` for none (default).
54
+ * Pass `['postalAddress']` when AVS or billing address is required on create.
55
+ */
56
+ requiredBillingContactFields?: ApplePayBillingContactField[];
52
57
  }
53
58
  /** Response from POST /v3/payment-method-providers/applepay/token. */
54
59
  export interface ApplePayMerchantSession {
@@ -5,8 +5,6 @@ export interface ApplePayContact {
5
5
  emailAddress?: string;
6
6
  givenName?: string;
7
7
  familyName?: string;
8
- phoneticGivenName?: string;
9
- phoneticFamilyName?: string;
10
8
  addressLines?: string[];
11
9
  subLocality?: string;
12
10
  locality?: string;