@soltech/fluid-common 1.11.1-sc23267.1 → 1.11.1-sc23267.2

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;
@@ -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 {
@@ -36,10 +77,8 @@ export interface DepositContinuationParams {
36
77
  accountId?: string;
37
78
  }
38
79
  /**
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.
80
+ * Transaction params for any payment method whose payload is keyed dynamically by
81
+ * CMS-defined input fields (bank transfer, crypto, e-wallet, voucher).
43
82
  * Field keys typically come from `PaymentMethod.inputFields[].paramName`.
44
83
  */
45
84
  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.11.1-sc23267.2",
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 {
@@ -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. */
@@ -41,10 +86,8 @@ export interface DepositContinuationParams {
41
86
  }
42
87
 
43
88
  /**
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.
89
+ * Transaction params for any payment method whose payload is keyed dynamically by
90
+ * CMS-defined input fields (bank transfer, crypto, e-wallet, voucher).
48
91
  * Field keys typically come from `PaymentMethod.inputFields[].paramName`.
49
92
  */
50
93
  export interface DynamicTransactionParams extends TransactionParams {