You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`device`: (_optional_): Device parameters to validate.
28
+
-`ip` (_optional_): User IP on partner's side that we should validate remains the same.
29
+
-`user-agent` (_optional_): User agent used on partner's side that we should validate remains the same.
30
+
-`encrypted` (_optional_): Encrypted parameters to validate.
31
+
-`ip` (_optional_): Encrypted user IP on partner's side that we should validate remains the same.
32
+
-`user-agent` (_optional_): Encrypted user agent used on partner's side that we should validate remains the same.
26
33
-`refund` (_optional_): An object configuring the refund details. The asset and network of the refund will be the same as the source asset and network.
27
34
-`address`: Address to which the refund will be sent.
28
35
-`tag` (_optional_): Tag of the crypto transaction, used to complement the `address`.
@@ -83,6 +90,12 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
83
90
"displayName":"ACME",
84
91
"fee": {
85
92
"percentage":"1"
93
+
},
94
+
validation: {
95
+
device:{
96
+
ip:'1.2.3.4',
97
+
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'
98
+
}
86
99
}
87
100
},
88
101
"refund": {
@@ -118,6 +131,20 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
118
131
</TabItem>
119
132
</Tabs>
120
133
134
+
### Custom partner validation
135
+
136
+
To increase customer security we support an extra layer of validations that can be customizable by our partners. This layer includes validations from customer's device, like IP and user agent, that we ensure is the same as the one provided by you. In case of any mismatch, the user request to initiate a widget session will fail.
137
+
We accept this validation parameters as a plain string or as an encrypted string. If you send us encrypted parameters, we'll fetch the same parameters we receive from the user request, encrypt them and compare if both hashs are equal. For this the encryption secret will need to be shared between Topper and the partner.
138
+
If you plan on using encrypted validation, please check the example below to see how you should encrypt your data.
139
+
140
+
```js
141
+
import { createHmac } from'node:crypto';
142
+
143
+
awaitcreateHmac('sha256', <secretKey>)
144
+
.update(<parameter>)
145
+
.digest('hex');
146
+
```
147
+
121
148
## Events
122
149
123
150
Full information about the available events and their associated payloads can be found on the [events page](../events/crypto-offramp.mdx).
-`device`: (_optional_): Device parameters to validate.
28
+
-`ip` (_optional_): User IP on partner's side that we should validate remains the same.
29
+
-`user-agent` (_optional_): User agent used on partner's side that we should validate remains the same.
30
+
-`encrypted` (_optional_): Encrypted parameters to validate.
31
+
-`ip` (_optional_): Encrypted user IP on partner's side that we should validate remains the same.
32
+
-`user-agent` (_optional_): Encrypted user agent used on partner's side that we should validate remains the same.
26
33
-`partnerFee` (_deprecated_): Use `partner.fee` instead.
27
34
-`simulation` (_optional_): Simulation object.
28
35
-`country` (_optional_): Country to use during simulations, in alpha-2 code format; It will be ignored after the user is authenticated and the user's country will be used.
@@ -71,12 +78,18 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
71
78
"sub":"b9fe022b-f436-49e1-bb89-6f2e8eabf336",
72
79
// highlight-start
73
80
"partner": {
81
+
"continueUrl":"https://example.com",
82
+
"continueUrlTarget":"new-tab",
74
83
"displayName":"ACME",
75
84
"fee": {
76
85
"percentage":"1"
77
86
},
78
-
"continueUrl":"https://example.com",
79
-
"continueUrlTarget":"new-tab"
87
+
validation: {
88
+
device:{
89
+
ip:'1.2.3.4',
90
+
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'
91
+
}
92
+
}
80
93
},
81
94
"simulation": {
82
95
"country":"US"
@@ -109,6 +122,20 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
109
122
</TabItem>
110
123
</Tabs>
111
124
125
+
### Custom partner validation
126
+
127
+
To increase customer security we support an extra layer of validations that can be customizable by our partners. This layer includes validations from customer's device, like IP and user agent, that we ensure is the same as the one provided by you. In case of any mismatch, the user request to initiate a widget session will fail.
128
+
We accept this validation parameters as a plain string or as an encrypted string. If you send us encrypted parameters, we'll fetch the same parameters we receive from the user request, encrypt them and compare if both hashs are equal. For this the encryption secret will need to be shared between Topper and the partner.
129
+
If you plan on using encrypted validation, please check the example below to see how you should encrypt your data.
0 commit comments