@soltech/fluid-common 1.9.2-sc23265.2 → 1.9.2-sc23265.4

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 CHANGED
@@ -118,7 +118,6 @@ export type TransactionStatusSource = 'gateway' | 'fluid';
118
118
  export interface TransactionStatusCheck {
119
119
  url: string;
120
120
  intervalSeconds: number;
121
- /** Who answers the poll. Absent on wallets served by an API that predates this field. */
122
121
  source?: TransactionStatusSource;
123
122
  }
124
123
  export interface AllPaymentMethods {
@@ -162,13 +161,23 @@ export interface EncryptionSettings {
162
161
  expiryDateEncryptionMode: ExpiryDateEncryptionMode;
163
162
  encryptCardholderName: boolean;
164
163
  }
165
- export interface HostedFieldsSettings {
164
+ export type HostedFieldsSettings = CardValuesSettings | CardTokenSettings;
165
+ interface HostedFieldsBase {
166
166
  url: string;
167
- protocol?: HostedFieldsProtocol;
168
- params?: Record<string, string>;
167
+ }
168
+ export interface CardValuesSettings extends HostedFieldsBase {
169
+ protocol?: HostedFieldsProtocol.CARD_VALUES;
170
+ }
171
+ export interface CardTokenSettings extends HostedFieldsBase {
172
+ protocol: HostedFieldsProtocol.CARD_TOKEN;
173
+ params: CardTokenParams;
174
+ }
175
+ export interface CardTokenParams {
176
+ merchantId: string;
177
+ env: string;
169
178
  }
170
179
  export declare enum HostedFieldsProtocol {
171
- ENCRYPTED_FIELDS = "EncryptedFields",
180
+ CARD_VALUES = "CardValues",
172
181
  CARD_TOKEN = "CardToken"
173
182
  }
174
183
  export declare enum EncryptionType {
@@ -395,3 +404,4 @@ export interface Campaign {
395
404
  enableSuccessAnimation: boolean;
396
405
  customChatIcons?: CampaignChatIcons;
397
406
  }
407
+ export {};
package/lib/index.js CHANGED
@@ -36,7 +36,7 @@ export var WindowRedirectType;
36
36
  // is behind them — the gateway's identity stays server-side.
37
37
  export var HostedFieldsProtocol;
38
38
  (function (HostedFieldsProtocol) {
39
- HostedFieldsProtocol["ENCRYPTED_FIELDS"] = "EncryptedFields";
39
+ HostedFieldsProtocol["CARD_VALUES"] = "CardValues";
40
40
  HostedFieldsProtocol["CARD_TOKEN"] = "CardToken";
41
41
  })(HostedFieldsProtocol || (HostedFieldsProtocol = {}));
42
42
  export var EncryptionType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soltech/fluid-common",
3
- "version": "1.9.2-sc23265.2",
3
+ "version": "1.9.2-sc23265.4",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend, API and AI common interfaces & enums",
6
6
  "main": "lib/index.js",
package/src/index.ts CHANGED
@@ -134,7 +134,6 @@ export type TransactionStatusSource = 'gateway' | 'fluid';
134
134
  export interface TransactionStatusCheck {
135
135
  url: string;
136
136
  intervalSeconds: number;
137
- /** Who answers the poll. Absent on wallets served by an API that predates this field. */
138
137
  source?: TransactionStatusSource;
139
138
  }
140
139
 
@@ -183,19 +182,32 @@ export interface EncryptionSettings {
183
182
  encryptCardholderName: boolean;
184
183
  }
185
184
 
186
- export interface HostedFieldsSettings {
185
+ export type HostedFieldsSettings = CardValuesSettings | CardTokenSettings;
186
+
187
+ interface HostedFieldsBase {
188
+ // Its presence is also how the client decides a method uses hosted fields at all.
187
189
  url: string;
188
- // Absent means EncryptedFields, so responses composed before this field existed keep working.
189
- protocol?: HostedFieldsProtocol;
190
- // Gateway-shaped values the client hands straight to the gateway's own component
191
- // without interpreting them. CardToken carries merchantId and env.
192
- params?: Record<string, string>;
190
+ }
191
+
192
+ export interface CardValuesSettings extends HostedFieldsBase {
193
+ // Absent selects this protocol, so responses composed before the field existed keep working.
194
+ protocol?: HostedFieldsProtocol.CARD_VALUES;
195
+ }
196
+
197
+ export interface CardTokenSettings extends HostedFieldsBase {
198
+ protocol: HostedFieldsProtocol.CARD_TOKEN;
199
+ params: CardTokenParams;
200
+ }
201
+
202
+ export interface CardTokenParams {
203
+ merchantId: string;
204
+ env: string;
193
205
  }
194
206
 
195
207
  // Which message contract the client must speak to the hosted fields, not which gateway
196
208
  // is behind them — the gateway's identity stays server-side.
197
209
  export enum HostedFieldsProtocol {
198
- ENCRYPTED_FIELDS = 'EncryptedFields',
210
+ CARD_VALUES = 'CardValues',
199
211
  CARD_TOKEN = 'CardToken'
200
212
  }
201
213
 
@@ -277,10 +289,7 @@ export interface CreditcardTransactionParams extends TransactionParams {
277
289
  expiryMonth?: string;
278
290
  expiryYear?: string;
279
291
  expiryDate?: string;
280
- // Set instead of cardNumber when the gateway tokenised the card in the browser.
281
292
  cardToken?: string;
282
- // Device and session signals the gateway's own form collected, which its fraud scoring
283
- // needs on the charge. Opaque: the client passes them through and never interprets them.
284
293
  protectionHeaders?: Record<string, string>;
285
294
  }
286
295