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

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
@@ -162,10 +162,20 @@ export interface EncryptionSettings {
162
162
  expiryDateEncryptionMode: ExpiryDateEncryptionMode;
163
163
  encryptCardholderName: boolean;
164
164
  }
165
- export interface HostedFieldsSettings {
165
+ export type HostedFieldsSettings = EncryptedFieldsSettings | CardTokenSettings;
166
+ interface HostedFieldsBase {
166
167
  url: string;
167
- protocol?: HostedFieldsProtocol;
168
- params?: Record<string, string>;
168
+ }
169
+ export interface EncryptedFieldsSettings extends HostedFieldsBase {
170
+ protocol?: HostedFieldsProtocol.ENCRYPTED_FIELDS;
171
+ }
172
+ export interface CardTokenSettings extends HostedFieldsBase {
173
+ protocol: HostedFieldsProtocol.CARD_TOKEN;
174
+ params: CardTokenParams;
175
+ }
176
+ export interface CardTokenParams {
177
+ merchantId: string;
178
+ env: string;
169
179
  }
170
180
  export declare enum HostedFieldsProtocol {
171
181
  ENCRYPTED_FIELDS = "EncryptedFields",
@@ -395,3 +405,4 @@ export interface Campaign {
395
405
  enableSuccessAnimation: boolean;
396
406
  customChatIcons?: CampaignChatIcons;
397
407
  }
408
+ export {};
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.3",
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
@@ -183,13 +183,27 @@ export interface EncryptionSettings {
183
183
  encryptCardholderName: boolean;
184
184
  }
185
185
 
186
- export interface HostedFieldsSettings {
186
+ export type HostedFieldsSettings = EncryptedFieldsSettings | CardTokenSettings;
187
+
188
+ interface HostedFieldsBase {
189
+ // Its presence is also how the client decides a method uses hosted fields at all.
187
190
  url: string;
191
+ }
192
+
193
+ export interface EncryptedFieldsSettings extends HostedFieldsBase {
188
194
  // 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>;
195
+ protocol?: HostedFieldsProtocol.ENCRYPTED_FIELDS;
196
+ }
197
+
198
+ export interface CardTokenSettings extends HostedFieldsBase {
199
+ protocol: HostedFieldsProtocol.CARD_TOKEN;
200
+ // Handed straight to the gateway's own component, uninterpreted.
201
+ params: CardTokenParams;
202
+ }
203
+
204
+ export interface CardTokenParams {
205
+ merchantId: string;
206
+ env: string;
193
207
  }
194
208
 
195
209
  // Which message contract the client must speak to the hosted fields, not which gateway