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`.
@@ -86,6 +94,12 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
86
94
"displayName":"ACME",
87
95
"fee": {
88
96
"percentage":"1"
97
+
},
98
+
validation: {
99
+
device:{
100
+
ip:'1.2.3.4',
101
+
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'
102
+
}
89
103
}
90
104
},
91
105
"refund": {
@@ -121,6 +135,23 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
121
135
</TabItem>
122
136
</Tabs>
123
137
138
+
### Custom partner validation
139
+
140
+
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.
141
+
We accept this validation parameters as plain strings 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.
142
+
If you plan on using hashed validation, please check the example below to see how you should hash your data.
143
+
144
+
```js
145
+
import { createHash } from'node:crypto';
146
+
147
+
awaitcreateHash('sha256')
148
+
.update('1.2.3.4')
149
+
.digest('hex');
150
+
```
151
+
152
+
:::note
153
+
When validating user IP, if the IP versions mismatch, validation will be partially (plain string validation) or entirely (hashed validation) skipped.
154
+
124
155
## Events
125
156
126
157
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
-`reusableKYC` (_optional_): An object to provide a KYC shareable token.
28
36
-`provider` (_required_): Provider that issued the shareable token.
@@ -74,12 +82,18 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
74
82
"sub":"b9fe022b-f436-49e1-bb89-6f2e8eabf336",
75
83
// highlight-start
76
84
"partner": {
85
+
"continueUrl":"https://example.com",
86
+
"continueUrlTarget":"new-tab",
77
87
"displayName":"ACME",
78
88
"fee": {
79
89
"percentage":"1"
80
90
},
81
-
"continueUrl":"https://example.com",
82
-
"continueUrlTarget":"new-tab"
91
+
validation: {
92
+
device:{
93
+
ip:'1.2.3.4',
94
+
'user-agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)'
95
+
}
96
+
}
83
97
},
84
98
"simulation": {
85
99
"country":"US"
@@ -112,6 +126,23 @@ We recommend that you use `XRP` for testing purposes when integrating Topper sin
112
126
</TabItem>
113
127
</Tabs>
114
128
129
+
### Custom partner validation
130
+
131
+
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.
132
+
We accept this validation parameters as plain strings 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.
133
+
If you plan on using hashed validation, please check the example below to see how you should hash your data.
134
+
135
+
```js
136
+
import { createHash } from'node:crypto';
137
+
138
+
awaitcreateHash('sha256')
139
+
.update('1.2.3.4')
140
+
.digest('hex');
141
+
```
142
+
143
+
:::note
144
+
When validating user IP, if the IP versions mismatch, validation will be partially (plain string validation) or entirely (hashed validation) skipped.
0 commit comments