@soltech/fluid-common 1.9.2-sc23265.1 → 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
@@ -114,9 +114,12 @@ export interface DepositAmountsSettings {
114
114
  defaultDepositAmount: number;
115
115
  suggestedDepositAmounts: number[];
116
116
  }
117
+ export type TransactionStatusSource = 'gateway' | 'fluid';
117
118
  export interface TransactionStatusCheck {
118
119
  url: string;
119
120
  intervalSeconds: number;
121
+ /** Who answers the poll. Absent on wallets served by an API that predates this field. */
122
+ source?: TransactionStatusSource;
120
123
  }
121
124
  export interface AllPaymentMethods {
122
125
  recentPaymentMethods: RecentMethod[];
@@ -159,10 +162,20 @@ export interface EncryptionSettings {
159
162
  expiryDateEncryptionMode: ExpiryDateEncryptionMode;
160
163
  encryptCardholderName: boolean;
161
164
  }
162
- export interface HostedFieldsSettings {
165
+ export type HostedFieldsSettings = EncryptedFieldsSettings | CardTokenSettings;
166
+ interface HostedFieldsBase {
163
167
  url: string;
164
- protocol?: HostedFieldsProtocol;
165
- 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;
166
179
  }
167
180
  export declare enum HostedFieldsProtocol {
168
181
  ENCRYPTED_FIELDS = "EncryptedFields",
@@ -392,3 +405,4 @@ export interface Campaign {
392
405
  enableSuccessAnimation: boolean;
393
406
  customChatIcons?: CampaignChatIcons;
394
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.1",
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
@@ -129,9 +129,13 @@ export interface DepositAmountsSettings {
129
129
  suggestedDepositAmounts: number[];
130
130
  }
131
131
 
132
+ export type TransactionStatusSource = 'gateway' | 'fluid';
133
+
132
134
  export interface TransactionStatusCheck {
133
135
  url: string;
134
136
  intervalSeconds: number;
137
+ /** Who answers the poll. Absent on wallets served by an API that predates this field. */
138
+ source?: TransactionStatusSource;
135
139
  }
136
140
 
137
141
  export interface AllPaymentMethods {
@@ -179,13 +183,27 @@ export interface EncryptionSettings {
179
183
  encryptCardholderName: boolean;
180
184
  }
181
185
 
182
- 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.
183
190
  url: string;
191
+ }
192
+
193
+ export interface EncryptedFieldsSettings extends HostedFieldsBase {
184
194
  // 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>;
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;
189
207
  }
190
208
 
191
209
  // Which message contract the client must speak to the hosted fields, not which gateway