@evervault/js 2.18.0 → 2.19.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.
@@ -56,6 +56,30 @@ declare type ApplePayButtonOptions = {
56
56
  amount: number;
57
57
  lineItems?: TransactionLineItem[];
58
58
  }>;
59
+ /**
60
+ * Shipping type label on the Apple Pay sheet (shipping / delivery / pickup).
61
+ * Payment (one-off) transactions only — rejected for recurring and disbursement.
62
+ */
63
+ shippingType?: ApplePayShippingType;
64
+ /**
65
+ * Shipping methods shown as selectable options on the Apple Pay sheet.
66
+ * Requires `requestShipping: true` (auto-enabled when methods are provided).
67
+ * Payment (one-off) transactions only — rejected for recurring and disbursement.
68
+ *
69
+ * When the customer selects a method, totals are recomputed. Provide
70
+ * `onShippingMethodSelected` to control the amount/line items yourself;
71
+ * otherwise the SDK adjusts the total by the selected method's amount.
72
+ */
73
+ shippingMethods?: ApplePayShippingMethod[];
74
+ /**
75
+ * Called when the customer selects a shipping method on the sheet.
76
+ * Return updated totals. Maps to PaymentRequest `shippingoptionchange`.
77
+ * Requires `shippingMethods` (and shipping to be requested).
78
+ */
79
+ onShippingMethodSelected?: (shippingMethod: ApplePayShippingMethod) => Promise<{
80
+ amount: number;
81
+ lineItems?: TransactionLineItem[];
82
+ }>;
59
83
  /**
60
84
  * Show the coupon field on the Apple Pay sheet and receive updates when the
61
85
  * customer changes the code. Maps to ApplePayRequest.supportsCouponCode /
@@ -88,6 +112,16 @@ declare type ApplePayButtonOptions = {
88
112
  * transaction) — this field has no effect on disbursement-type transactions.
89
113
  */
90
114
  shippingContact?: PaymentContact;
115
+ /**
116
+ * Opaque merchant data included on the Apple Pay request
117
+ * (ApplePayRequest.applicationData). Must be a Base64-encoded string.
118
+ */
119
+ applicationData?: string;
120
+ /**
121
+ * Restrict payments to cards issued in these ISO 3166 country codes
122
+ * (ApplePayRequest.supportedCountries).
123
+ */
124
+ supportedCountries?: string[];
91
125
  prepareTransaction?: () => Promise<{
92
126
  amount?: number;
93
127
  lineItems?: TransactionLineItem[];
@@ -133,6 +167,25 @@ declare type ApplePayMerchantCapability =
133
167
  | "supportsDebit"
134
168
  | "supportsInstantFundsOut";
135
169
 
170
+ /**
171
+ * A shipping method the customer can pick on the Apple Pay sheet.
172
+ * Amounts use the same smallest-currency-unit convention as line items (e.g. cents).
173
+ * Maps to PaymentDetailsInit.shippingOptions / PaymentShippingOption.
174
+ */
175
+ declare interface ApplePayShippingMethod {
176
+ id: string;
177
+ label: string;
178
+ amount: number;
179
+ detail?: string;
180
+ selected?: boolean;
181
+ }
182
+
183
+ /**
184
+ * Shipping type shown on the Apple Pay sheet. Maps to PaymentOptions.shippingType
185
+ * (storePickup / servicePickup → "pickup" on the Payment Request bridge).
186
+ */
187
+ declare type ApplePayShippingType = "shipping" | "delivery" | "storePickup" | "servicePickup";
188
+
136
189
  declare type ApplePayTransactionType = "oneOff" | "recurring" | "disbursement";
137
190
 
138
191
  declare interface BaseTransactionDetails {
@@ -942,6 +995,16 @@ EncryptedDPAN<"apple">,
942
995
  emailAddress?: string;
943
996
  phoneNumber?: string;
944
997
  };
998
+ /**
999
+ * The shipping method the customer selected on the Apple Pay sheet.
1000
+ * Present when `shippingMethods` were configured on the web Apple Pay button.
1001
+ */
1002
+ shippingMethod?: {
1003
+ id: string;
1004
+ label: string;
1005
+ amount: number;
1006
+ detail?: string;
1007
+ };
945
1008
  };
946
1009
 
947
1010
  declare interface EncryptedDPAN<P> {
@@ -10568,8 +10631,16 @@ declare type TransactionDetailsWithDomain = TransactionDetails & {
10568
10631
  declare interface TransactionLineItem {
10569
10632
  amount: number;
10570
10633
  label: string;
10634
+ /**
10635
+ * Whether the line item amount is final or still pending (e.g. tax/shipping).
10636
+ * Maps to Apple Pay `ApplePayLineItem.type` / Payment Request `PaymentItem.pending`.
10637
+ * Defaults to `"final"` when omitted.
10638
+ */
10639
+ type?: TransactionLineItemType;
10571
10640
  }
10572
10641
 
10642
+ declare type TransactionLineItemType = "final" | "pending";
10643
+
10573
10644
  declare interface TranslationsObject {
10574
10645
  [key: string]: string | TranslationsObject | undefined;
10575
10646
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@evervault/js",
4
- "version": "2.18.0",
4
+ "version": "2.19.0",
5
5
  "description": "Evervault.js loader for client-side browser applications",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -20,9 +20,9 @@
20
20
  "typescript": "5.6.3",
21
21
  "vite": "^8.1.4",
22
22
  "vite-plugin-dts": "^5.0.2",
23
- "themes": "0.1.24",
24
- "@evervault/browser": "2.61.0",
23
+ "@evervault/browser": "2.62.0",
25
24
  "tsconfig": "0.1.0",
25
+ "themes": "0.1.24",
26
26
  "types": "0.23.1"
27
27
  },
28
28
  "scripts": {