@soltech/fluid-common 1.11.1-sc23267.1 → 1.12.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.
@@ -48,6 +48,12 @@ export interface PaymentMethod {
48
48
  finalTransactionResultCheckEnabled?: boolean;
49
49
  encryptionSettings?: EncryptionSettings;
50
50
  hostedFields?: HostedFieldsSettings;
51
+ deviceProtection?: DeviceProtectionSettings;
52
+ }
53
+ /** Its presence is also how the client decides the gateway behind this method profiles at all. */
54
+ export interface DeviceProtectionSettings {
55
+ merchantId: string;
56
+ env: string;
51
57
  }
52
58
  export interface EncryptionSettings {
53
59
  encryptionType: EncryptionType;
@@ -68,7 +74,6 @@ export interface CardTokenSettings extends HostedFieldsBase {
68
74
  export interface CardTokenParams {
69
75
  merchantId: string;
70
76
  env: string;
71
- token?: string;
72
77
  }
73
78
  export declare enum HostedFieldsProtocol {
74
79
  CARD_VALUES = "CardValues",
@@ -9,7 +9,11 @@ export interface TransactionParams {
9
9
  amount: number;
10
10
  paymentMethodId: string;
11
11
  }
12
- export interface CreditcardTransactionParams extends TransactionParams {
12
+ /** Not on `TransactionParams`: `DynamicTransactionParams` adds an index signature this fails. */
13
+ export interface GatewayProtectionParams {
14
+ protectionHeaders?: Record<string, string>;
15
+ }
16
+ export interface CreditcardTransactionParams extends TransactionParams, GatewayProtectionParams {
13
17
  cardHolder?: string;
14
18
  cardNumber?: string;
15
19
  cvc: string;
@@ -17,7 +21,44 @@ export interface CreditcardTransactionParams extends TransactionParams {
17
21
  expiryYear?: string;
18
22
  expiryDate?: string;
19
23
  cardToken?: string;
20
- protectionHeaders?: Record<string, string>;
24
+ }
25
+ export interface ApplePayTransactionParams extends TransactionParams, GatewayProtectionParams {
26
+ /** The authorised `ApplePayPaymentToken`, serialised, opaque to everything but the gateway. */
27
+ token: string;
28
+ billingContact?: ApplePayContact;
29
+ /** Apple returns the payer's email here, not on the billing contact. */
30
+ shippingContact?: ApplePayContact;
31
+ }
32
+ /**
33
+ * What the cashier needs to open the sheet. Every field describes the merchant, not the payer —
34
+ * `countryCode` included, which is what Apple asks for here.
35
+ */
36
+ export interface ApplePayParams {
37
+ countryCode: string;
38
+ companyName: string;
39
+ supportedNetworks: string[];
40
+ /** Apple's `ApplePayMerchantCapability` values; a DOM type neither server can name. */
41
+ merchantCapabilities: string[];
42
+ merchantIdentifier?: string;
43
+ requiresContactDetails: boolean;
44
+ }
45
+ /**
46
+ * Apple's own `ApplePayPaymentContact` shape, carried through unchanged: a gateway that wants
47
+ * it expects the field names Apple uses. Only present when the method asks the sheet for it.
48
+ */
49
+ export interface ApplePayContact {
50
+ addressLines?: string[];
51
+ administrativeArea?: string;
52
+ country?: string;
53
+ countryCode?: string;
54
+ emailAddress?: string;
55
+ familyName?: string;
56
+ givenName?: string;
57
+ locality?: string;
58
+ phoneNumber?: string;
59
+ postalCode?: string;
60
+ subAdministrativeArea?: string;
61
+ subLocality?: string;
21
62
  }
22
63
  /** The request that concludes a deposit the payer had to act on away from the cashier, a 3DS challenge being the case that needs it. */
23
64
  export interface DepositContinuationParams {
@@ -32,14 +73,10 @@ export interface DepositContinuationParams {
32
73
  protectionHeaders?: Record<string, string>;
33
74
  /** A credential: carried on the challenge and handed back, never logged. */
34
75
  sessionKey?: string;
35
- /** The stored method the purchase began on, so the concluding charge keeps its endpoint. */
36
- accountId?: string;
37
76
  }
38
77
  /**
39
- * Transaction params for any payment method whose payload is keyed dynamically:
40
- * - CMS-defined input fields (bank transfer, crypto, e-wallet, voucher).
41
- * - Native flows like Apple Pay where the gateway-bound `token` is the only
42
- * extra key beyond the base TransactionParams.
78
+ * Transaction params for any payment method whose payload is keyed dynamically by
79
+ * CMS-defined input fields (bank transfer, crypto, e-wallet, voucher).
43
80
  * Field keys typically come from `PaymentMethod.inputFields[].paramName`.
44
81
  */
45
82
  export interface DynamicTransactionParams extends TransactionParams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soltech/fluid-common",
3
- "version": "1.11.1-sc23267.1",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "description": "Fluid frontend, API and AI common interfaces & enums",
6
6
  "main": "lib/index.js",
@@ -54,6 +54,13 @@ export interface PaymentMethod {
54
54
  finalTransactionResultCheckEnabled?: boolean;
55
55
  encryptionSettings?: EncryptionSettings;
56
56
  hostedFields?: HostedFieldsSettings;
57
+ deviceProtection?: DeviceProtectionSettings;
58
+ }
59
+
60
+ /** Its presence is also how the client decides the gateway behind this method profiles at all. */
61
+ export interface DeviceProtectionSettings {
62
+ merchantId: string;
63
+ env: string;
57
64
  }
58
65
 
59
66
  export interface EncryptionSettings {
@@ -82,8 +89,6 @@ export interface CardTokenSettings extends HostedFieldsBase {
82
89
  export interface CardTokenParams {
83
90
  merchantId: string;
84
91
  env: string;
85
- // Set only on a stored method, whose fields re-verify a card rather than collect a new one.
86
- token?: string;
87
92
  }
88
93
 
89
94
  // Which message contract the client must speak to the hosted fields, not which gateway
@@ -12,7 +12,12 @@ export interface TransactionParams {
12
12
  paymentMethodId: string;
13
13
  }
14
14
 
15
- export interface CreditcardTransactionParams extends TransactionParams {
15
+ /** Not on `TransactionParams`: `DynamicTransactionParams` adds an index signature this fails. */
16
+ export interface GatewayProtectionParams {
17
+ protectionHeaders?: Record<string, string>;
18
+ }
19
+
20
+ export interface CreditcardTransactionParams extends TransactionParams, GatewayProtectionParams {
16
21
  cardHolder?: string;
17
22
  cardNumber?: string;
18
23
  cvc: string;
@@ -20,7 +25,47 @@ export interface CreditcardTransactionParams extends TransactionParams {
20
25
  expiryYear?: string;
21
26
  expiryDate?: string;
22
27
  cardToken?: string;
23
- protectionHeaders?: Record<string, string>;
28
+ }
29
+
30
+ export interface ApplePayTransactionParams extends TransactionParams, GatewayProtectionParams {
31
+ /** The authorised `ApplePayPaymentToken`, serialised, opaque to everything but the gateway. */
32
+ token: string;
33
+ billingContact?: ApplePayContact;
34
+ /** Apple returns the payer's email here, not on the billing contact. */
35
+ shippingContact?: ApplePayContact;
36
+ }
37
+
38
+ /**
39
+ * What the cashier needs to open the sheet. Every field describes the merchant, not the payer —
40
+ * `countryCode` included, which is what Apple asks for here.
41
+ */
42
+ export interface ApplePayParams {
43
+ countryCode: string;
44
+ companyName: string;
45
+ supportedNetworks: string[];
46
+ /** Apple's `ApplePayMerchantCapability` values; a DOM type neither server can name. */
47
+ merchantCapabilities: string[];
48
+ merchantIdentifier?: string;
49
+ requiresContactDetails: boolean;
50
+ }
51
+
52
+ /**
53
+ * Apple's own `ApplePayPaymentContact` shape, carried through unchanged: a gateway that wants
54
+ * it expects the field names Apple uses. Only present when the method asks the sheet for it.
55
+ */
56
+ export interface ApplePayContact {
57
+ addressLines?: string[];
58
+ administrativeArea?: string;
59
+ country?: string;
60
+ countryCode?: string;
61
+ emailAddress?: string;
62
+ familyName?: string;
63
+ givenName?: string;
64
+ locality?: string;
65
+ phoneNumber?: string;
66
+ postalCode?: string;
67
+ subAdministrativeArea?: string;
68
+ subLocality?: string;
24
69
  }
25
70
 
26
71
  /** The request that concludes a deposit the payer had to act on away from the cashier, a 3DS challenge being the case that needs it. */
@@ -36,15 +81,11 @@ export interface DepositContinuationParams {
36
81
  protectionHeaders?: Record<string, string>;
37
82
  /** A credential: carried on the challenge and handed back, never logged. */
38
83
  sessionKey?: string;
39
- /** The stored method the purchase began on, so the concluding charge keeps its endpoint. */
40
- accountId?: string;
41
84
  }
42
85
 
43
86
  /**
44
- * Transaction params for any payment method whose payload is keyed dynamically:
45
- * - CMS-defined input fields (bank transfer, crypto, e-wallet, voucher).
46
- * - Native flows like Apple Pay where the gateway-bound `token` is the only
47
- * extra key beyond the base TransactionParams.
87
+ * Transaction params for any payment method whose payload is keyed dynamically by
88
+ * CMS-defined input fields (bank transfer, crypto, e-wallet, voucher).
48
89
  * Field keys typically come from `PaymentMethod.inputFields[].paramName`.
49
90
  */
50
91
  export interface DynamicTransactionParams extends TransactionParams {
@@ -1,7 +0,0 @@
1
- {
2
- "enabledMcpjsonServers": [
3
- "shortcut",
4
- "playwright"
5
- ],
6
- "enableAllProjectMcpServers": true
7
- }