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
+
-`alg` (_optional_): Algorithm used to hash the fields. In case no algorithm is set, we'll be assumed that `sha256` was used.
29
+
-`fields` (_optional_): Fields that have been hashed.
30
+
-`hash` (_optional_): Result of hashing the fields appended in the given order, without any extra characters or whitespaces, using the given algorithm.
31
+
-`ip` (_optional_): User IP on partner's side that we should validate remains the same.
32
+
-`ipVersion` (_optional_): Version of IP value used on the hash.
33
+
-`user-agent` (_optional_): User agent used on partner's side that we should validate remains the same.
26
34
-`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
35
-`address`: Address to which the refund will be sent.
28
36
-`tag` (_optional_): Tag of the crypto transaction, used to complement the `address`.
@@ -83,6 +91,12 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
83
91
"displayName":"ACME",
84
92
"fee": {
85
93
"percentage":"1"
94
+
},
95
+
validation: {
96
+
device:{
97
+
ip:'1.2.3.4',
98
+
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'
99
+
}
86
100
}
87
101
},
88
102
"refund": {
@@ -118,6 +132,23 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
118
132
</TabItem>
119
133
</Tabs>
120
134
135
+
### Custom partner validation
136
+
137
+
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.
138
+
We accept this validation parameters as a plain string or as an hashed string. If you send us hashed parameters, we'll fetch the same parameters we receive from the user request, hash them and compare if both hashes are equal.
139
+
If you plan on using hashed validation, please check the example below to see how you should hash your data.
140
+
141
+
```js
142
+
import { createHash } from'node:crypto';
143
+
144
+
awaitcreateHash('sha256')
145
+
.update('1.2.3.4')
146
+
.digest('hex');
147
+
```
148
+
149
+
:::note
150
+
When validating user IP, if the IP versions mismatch, validation will be partially (plain string validation) or entirely (hashed validation) skipped.
151
+
121
152
## Events
122
153
123
154
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
+
-`alg` (_optional_): Algorithm used to hash the fields. In case no algorithm is set, we'll be assumed that `sha256` was used.
29
+
-`fields` (_optional_): Fields that have been hashed.
30
+
-`hash` (_optional_): Result of hashing the fields appended in the given order, without any extra characters or whitespaces, using the given algorithm.
31
+
-`ip` (_optional_): User IP on partner's side that we should validate remains the same.
32
+
-`ipVersion` (_optional_): Version of IP value used on the hash.
33
+
-`user-agent` (_optional_): User agent used on partner's side that we should validate remains the same.
26
34
-`partnerFee` (_deprecated_): Use `partner.fee` instead.
27
35
-`simulation` (_optional_): Simulation object.
28
36
-`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 +79,18 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
71
79
"sub":"b9fe022b-f436-49e1-bb89-6f2e8eabf336",
72
80
// highlight-start
73
81
"partner": {
82
+
"continueUrl":"https://example.com",
83
+
"continueUrlTarget":"new-tab",
74
84
"displayName":"ACME",
75
85
"fee": {
76
86
"percentage":"1"
77
87
},
78
-
"continueUrl":"https://example.com",
79
-
"continueUrlTarget":"new-tab"
88
+
validation: {
89
+
device:{
90
+
ip:'1.2.3.4',
91
+
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'
92
+
}
93
+
}
80
94
},
81
95
"simulation": {
82
96
"country":"US"
@@ -109,6 +123,23 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
109
123
</TabItem>
110
124
</Tabs>
111
125
126
+
### Custom partner validation
127
+
128
+
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.
129
+
We accept this validation parameters as a plain string or as an hashed string. If you send us hashed parameters, we'll fetch the same parameters we receive from the user request, hash them and compare if both hashes are equal.
130
+
If you plan on using hashed validation, please check the example below to see how you should hash your data.
131
+
132
+
```js
133
+
import { createHash } from'node:crypto';
134
+
135
+
awaitcreateHash('sha256')
136
+
.update('1.2.3.4')
137
+
.digest('hex');
138
+
```
139
+
140
+
:::note
141
+
When validating user IP, if the IP versions mismatch, validation will be partially (plain string validation) or entirely (hashed validation) skipped.
0 commit comments