@soltech/fluid-common 1.9.0 → 1.9.2-sc23265.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.
- package/lib/index.d.ts +24 -0
- package/lib/index.js +7 -0
- package/package.json +1 -1
- package/src/index.ts +34 -0
package/lib/index.d.ts
CHANGED
|
@@ -39,8 +39,11 @@ export interface WalletInitParams {
|
|
|
39
39
|
operatorId: number;
|
|
40
40
|
sessionId: string;
|
|
41
41
|
userId: string | number;
|
|
42
|
+
/** @deprecated Use browserInfo.userAgent instead */
|
|
42
43
|
userAgent: string;
|
|
44
|
+
/** @deprecated Use browserInfo.viewport instead */
|
|
43
45
|
viewport: Viewport;
|
|
46
|
+
browserInfo?: BrowserInfo;
|
|
44
47
|
userData?: UserData;
|
|
45
48
|
timestamp: string;
|
|
46
49
|
buildDate: string;
|
|
@@ -51,6 +54,19 @@ export interface Viewport {
|
|
|
51
54
|
innerWidth: number;
|
|
52
55
|
innerHeight: number;
|
|
53
56
|
}
|
|
57
|
+
export interface ScreenDimensions {
|
|
58
|
+
height: number;
|
|
59
|
+
width: number;
|
|
60
|
+
}
|
|
61
|
+
export interface BrowserInfo {
|
|
62
|
+
userAgent: string;
|
|
63
|
+
acceptHeader: string;
|
|
64
|
+
javaEnabled: boolean;
|
|
65
|
+
colorDepth: number;
|
|
66
|
+
screen: ScreenDimensions;
|
|
67
|
+
viewport: Viewport;
|
|
68
|
+
timezoneOffset: number;
|
|
69
|
+
}
|
|
54
70
|
export interface WalletConfig {
|
|
55
71
|
allowCustomAmount: boolean;
|
|
56
72
|
autofillCreditCardName: boolean;
|
|
@@ -145,6 +161,12 @@ export interface EncryptionSettings {
|
|
|
145
161
|
}
|
|
146
162
|
export interface HostedFieldsSettings {
|
|
147
163
|
url: string;
|
|
164
|
+
protocol?: HostedFieldsProtocol;
|
|
165
|
+
params?: Record<string, string>;
|
|
166
|
+
}
|
|
167
|
+
export declare enum HostedFieldsProtocol {
|
|
168
|
+
ENCRYPTED_FIELDS = "EncryptedFields",
|
|
169
|
+
CARD_TOKEN = "CardToken"
|
|
148
170
|
}
|
|
149
171
|
export declare enum EncryptionType {
|
|
150
172
|
NO_ENCRYPTION = "NO_ENCRYPTION",
|
|
@@ -215,6 +237,8 @@ export interface CreditcardTransactionParams extends TransactionParams {
|
|
|
215
237
|
expiryMonth?: string;
|
|
216
238
|
expiryYear?: string;
|
|
217
239
|
expiryDate?: string;
|
|
240
|
+
cardToken?: string;
|
|
241
|
+
forterToken?: string;
|
|
218
242
|
}
|
|
219
243
|
/**
|
|
220
244
|
* Transaction params for any payment method whose payload is keyed dynamically:
|
package/lib/index.js
CHANGED
|
@@ -32,6 +32,13 @@ export var WindowRedirectType;
|
|
|
32
32
|
WindowRedirectType["BROWSER_TAB"] = "browserTab";
|
|
33
33
|
WindowRedirectType["NONE"] = "none";
|
|
34
34
|
})(WindowRedirectType || (WindowRedirectType = {}));
|
|
35
|
+
// Which message contract the client must speak to the hosted fields, not which gateway
|
|
36
|
+
// is behind them — the gateway's identity stays server-side.
|
|
37
|
+
export var HostedFieldsProtocol;
|
|
38
|
+
(function (HostedFieldsProtocol) {
|
|
39
|
+
HostedFieldsProtocol["ENCRYPTED_FIELDS"] = "EncryptedFields";
|
|
40
|
+
HostedFieldsProtocol["CARD_TOKEN"] = "CardToken";
|
|
41
|
+
})(HostedFieldsProtocol || (HostedFieldsProtocol = {}));
|
|
35
42
|
export var EncryptionType;
|
|
36
43
|
(function (EncryptionType) {
|
|
37
44
|
EncryptionType["NO_ENCRYPTION"] = "NO_ENCRYPTION";
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -45,8 +45,11 @@ export interface WalletInitParams {
|
|
|
45
45
|
operatorId: number;
|
|
46
46
|
sessionId: string;
|
|
47
47
|
userId: string | number;
|
|
48
|
+
/** @deprecated Use browserInfo.userAgent instead */
|
|
48
49
|
userAgent: string;
|
|
50
|
+
/** @deprecated Use browserInfo.viewport instead */
|
|
49
51
|
viewport: Viewport;
|
|
52
|
+
browserInfo?: BrowserInfo;
|
|
50
53
|
userData?: UserData;
|
|
51
54
|
timestamp: string;
|
|
52
55
|
buildDate: string;
|
|
@@ -59,6 +62,21 @@ export interface Viewport {
|
|
|
59
62
|
innerHeight: number;
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
export interface ScreenDimensions {
|
|
66
|
+
height: number;
|
|
67
|
+
width: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface BrowserInfo {
|
|
71
|
+
userAgent: string;
|
|
72
|
+
acceptHeader: string;
|
|
73
|
+
javaEnabled: boolean;
|
|
74
|
+
colorDepth: number;
|
|
75
|
+
screen: ScreenDimensions;
|
|
76
|
+
viewport: Viewport;
|
|
77
|
+
timezoneOffset: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
62
80
|
export interface WalletConfig {
|
|
63
81
|
allowCustomAmount: boolean;
|
|
64
82
|
autofillCreditCardName: boolean;
|
|
@@ -163,6 +181,18 @@ export interface EncryptionSettings {
|
|
|
163
181
|
|
|
164
182
|
export interface HostedFieldsSettings {
|
|
165
183
|
url: string;
|
|
184
|
+
// Absent means EncryptedFields, so responses composed before this field existed keep working.
|
|
185
|
+
protocol?: HostedFieldsProtocol;
|
|
186
|
+
// Gateway-shaped values the client hands straight to the gateway's own component
|
|
187
|
+
// without interpreting them. CardToken carries merchantId and env.
|
|
188
|
+
params?: Record<string, string>;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Which message contract the client must speak to the hosted fields, not which gateway
|
|
192
|
+
// is behind them — the gateway's identity stays server-side.
|
|
193
|
+
export enum HostedFieldsProtocol {
|
|
194
|
+
ENCRYPTED_FIELDS = 'EncryptedFields',
|
|
195
|
+
CARD_TOKEN = 'CardToken'
|
|
166
196
|
}
|
|
167
197
|
|
|
168
198
|
export enum EncryptionType {
|
|
@@ -243,6 +273,10 @@ export interface CreditcardTransactionParams extends TransactionParams {
|
|
|
243
273
|
expiryMonth?: string;
|
|
244
274
|
expiryYear?: string;
|
|
245
275
|
expiryDate?: string;
|
|
276
|
+
// Set instead of cardNumber when the gateway tokenised the card in the browser.
|
|
277
|
+
cardToken?: string;
|
|
278
|
+
// Device signal the gateway's form returns with the token, forwarded on the charge.
|
|
279
|
+
forterToken?: string;
|
|
246
280
|
}
|
|
247
281
|
|
|
248
282
|
/**
|