@evervault/js 2.0.0 → 2.0.1

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.
@@ -18,6 +18,7 @@ declare class ApplePay {
18
18
  disbursementOverrides: {
19
19
  disbursementDetails?: PaymentDetailsInit;
20
20
  } | undefined;
21
+ requestPayerDetails: ("name" | "email" | "phone")[] | undefined;
21
22
  };
22
23
  };
23
24
  mount(selector: SelectorType): this;
@@ -26,6 +27,16 @@ declare class ApplePay {
26
27
  on<T extends keyof ApplePayEvents>(event: T, callback: ApplePayEvents[T]): () => void;
27
28
  }
28
29
 
30
+ declare class ApplePayButton {
31
+ #private;
32
+ client: EvervaultClient;
33
+ transaction: Transaction;
34
+ constructor(client: EvervaultClient, transaction: Transaction, options: ApplePayButtonOptions);
35
+ on(event: keyof ApplePayEvents_2, callback: ApplePayEvents_2[keyof ApplePayEvents_2]): () => void;
36
+ mount(selector: SelectorType): void;
37
+ unmount(): void;
38
+ }
39
+
29
40
  declare type ApplePayButtonLocale =
30
41
  | "ar-AB"
31
42
  | "ca-ES"
@@ -67,8 +78,38 @@ declare type ApplePayButtonLocale =
67
78
  | "zh-HK"
68
79
  | "zh-TW";
69
80
 
81
+ declare type ApplePayButtonLocale_2 = "ar-AB" | "ca-ES" | "cs-CZ" | "da-DK" | "de-DE" | "el-GR" | "en-AU" | "en-GB" | "en-US" | "es-ES" | "es-MX" | "fi-FI" | "fr-CA" | "fr-FR" | "he-IL" | "hi-IN" | "hr-HR" | "hu-HU" | "id-ID" | "it-IT" | "ja-JP" | "ko-KR" | "ms-MY" | "nb-NO" | "nl-NL" | "pl-PL" | "pt-BR" | "pt-PT" | "ro-RO" | "ru-RU" | "sk-SK" | "sv-SE" | "th-TH" | "tr-TR" | "uk-UA" | "vi-VN" | "zh-CN" | "zh-HK" | "zh-TW";
82
+
83
+ declare type ApplePayButtonOptions = {
84
+ type?: ApplePayButtonType_2;
85
+ style?: ApplePayButtonStyle_2;
86
+ locale?: ApplePayButtonLocale_2;
87
+ padding?: string;
88
+ borderRadius?: string;
89
+ size?: {
90
+ width: string | number;
91
+ height: string | number;
92
+ };
93
+ allowedCardNetworks?: ApplePayCardNetwork_2[];
94
+ requestPayerDetails?: ("name" | "email" | "phone")[];
95
+ requestBillingAddress?: boolean;
96
+ requestShipping?: boolean;
97
+ paymentOverrides?: {
98
+ paymentMethodData?: PaymentMethodData[];
99
+ paymentDetails?: PaymentDetailsInit;
100
+ };
101
+ disbursementOverrides?: {
102
+ disbursementDetails?: PaymentDetailsInit;
103
+ };
104
+ process: (data: unknown, helpers: {
105
+ fail: (error?: ApplePayError_2) => void;
106
+ }) => Promise<void>;
107
+ };
108
+
70
109
  declare type ApplePayButtonStyle = "black" | "white" | "white-outline";
71
110
 
111
+ declare type ApplePayButtonStyle_2 = "black" | "white" | "white-outline";
112
+
72
113
  declare type ApplePayButtonType =
73
114
  | "add-money"
74
115
  | "book"
@@ -88,6 +129,8 @@ declare type ApplePayButtonType =
88
129
  | "tip"
89
130
  | "top-up";
90
131
 
132
+ declare type ApplePayButtonType_2 = "add-money" | "book" | "buy" | "check-out" | "continue" | "contribute" | "donate" | "order" | "pay" | "plain" | "reload" | "rent" | "set-up" | "subscribe" | "support" | "tip" | "top-up";
133
+
91
134
  declare type ApplePayCardNetwork =
92
135
  | "amex"
93
136
  | "bancomat"
@@ -110,6 +153,12 @@ declare type ApplePayCardNetwork =
110
153
  | "visa"
111
154
  | "vPay";
112
155
 
156
+ declare type ApplePayCardNetwork_2 = "amex" | "bancomat" | "bancontact" | "cartesBancaires" | "chinaUnionPay" | "dankort" | "discover" | "eftpos" | "electron" | "elo" | "girocard" | "interac" | "jcb" | "mada" | "maestro" | "masterCard" | "mir" | "privateLabel" | "visa" | "vPay";
157
+
158
+ declare interface ApplePayError_2 {
159
+ message: string;
160
+ }
161
+
113
162
  declare interface ApplePayErrorMessage {
114
163
  message: string;
115
164
  }
@@ -121,6 +170,12 @@ declare interface ApplePayEvents {
121
170
  cancel: () => void;
122
171
  }
123
172
 
173
+ declare interface ApplePayEvents_2 {
174
+ success: () => void;
175
+ error: (message?: string) => void;
176
+ cancel: () => void;
177
+ }
178
+
124
179
  declare interface ApplePayOptions {
125
180
  process: (
126
181
  data: EncryptedApplePayData,
@@ -143,6 +198,7 @@ declare interface ApplePayOptions {
143
198
  disbursementOverrides?: {
144
199
  disbursementDetails?: PaymentDetailsInit;
145
200
  };
201
+ requestPayerDetails?: ("name" | "email" | "phone")[];
146
202
  }
147
203
 
148
204
  declare interface BaseTransactionDetails {
@@ -851,7 +907,8 @@ declare interface DisbursementTransactionDetails extends BaseTransactionDetails
851
907
  requiredRecipientDetails?: RequiredRecipientDetail[];
852
908
  }
853
909
 
854
- declare type EncryptedApplePayData = EncryptedDPAN<"apple"> & {
910
+ declare type EncryptedApplePayData = Omit<EncryptedDPAN<"apple">, "token"> & {
911
+ networkToken: PaymentToken<"apple"> & { rawExpiry: string };
855
912
  billingContact?: {
856
913
  givenName?: string;
857
914
  familyName?: string;
@@ -859,17 +916,18 @@ declare type EncryptedApplePayData = EncryptedDPAN<"apple"> & {
859
916
  phoneNumber?: string;
860
917
  address?: unknown;
861
918
  };
919
+ paymentDataType: string;
920
+ deviceManufacturerIdentifier: string;
921
+ shippingContact?: {
922
+ givenName?: string;
923
+ familyName?: string;
924
+ emailAddress?: string;
925
+ phoneNumber?: string;
926
+ };
862
927
  };
863
928
 
864
929
  declare interface EncryptedDPAN<P> {
865
- token: {
866
- tokenServiceProvider: P;
867
- number: string;
868
- expiry: {
869
- month: string;
870
- year: string;
871
- };
872
- };
930
+ token: PaymentToken<P>;
873
931
  card: {
874
932
  brand: string;
875
933
  };
@@ -2541,6 +2599,15 @@ declare interface ObsoleteProperties<TLength = (string & {}) | 0, TTime = string
2541
2599
  WebkitScrollSnapPointsY?: Property.ScrollSnapPointsY | undefined;
2542
2600
  }
2543
2601
 
2602
+ declare interface PaymentToken<P> {
2603
+ tokenServiceProvider: P;
2604
+ number: string;
2605
+ expiry: {
2606
+ month: string;
2607
+ year: string;
2608
+ };
2609
+ }
2610
+
2544
2611
  declare interface PaymentTransactionDetails extends BaseTransactionDetails {
2545
2612
  type: "payment";
2546
2613
  }
@@ -10396,6 +10463,7 @@ declare class UIComponents {
10396
10463
  threeDSecure(session: string, opts?: ThreeDSecureOptions): ThreeDSecure;
10397
10464
  googlePay(tx: Transaction, opts: GooglePayOptions): GooglePay;
10398
10465
  applePay(tx: Transaction, opts: ApplePayOptions): ApplePay;
10466
+ applePayButton(tx: Transaction, opts: ApplePayButtonOptions): ApplePayButton;
10399
10467
  }
10400
10468
 
10401
10469
  declare interface VendorLonghandProperties<TLength = (string & {}) | 0, TTime = string & {}> {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@evervault/js",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "Evervault.js loader for client-side browser applications",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -20,10 +20,10 @@
20
20
  "typescript": "5.5.4",
21
21
  "vite": "^5.4.11",
22
22
  "vite-plugin-dts": "^4.3.0",
23
- "@evervault/browser": "2.40.1",
23
+ "@evervault/browser": "2.42.2",
24
+ "themes": "0.1.13",
24
25
  "tsconfig": "0.1.0",
25
- "themes": "0.1.11",
26
- "types": "0.11.0"
26
+ "types": "0.13.0"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "vite build",