测试Webhook
测试付款
post
https://api.cryptomus.com/v1/test-webhook/payment
要从Webhook数据阵列验证签名,请使用付款API密钥。
为了确保您正确接收Webhooks并可以验证签名,您应该使用此方法来测试Webhooks付款。
请注意,没有将数据保存到数据库中,并且Webhook中接收到的任何数据仅存储在数组中以进行测试目的,以确保签名的正确性并测试我们从我们这里检索此数组的检索。
要使用现有发票测试Webhook,请提供其UUID或订单ID。如果未提供这些参数,则将使用测试发票发送Webhook。
要求
查询参数
姓名 | 参数类型 | 默认值 | 定义 |
---|---|---|---|
url_callback* | stringmin:6max:150url | 将发送具有付款状态的Webhooks的URL | |
currency* | string | 发票货币代码 | |
network* | string | 发票网络代码 | |
uuid | stringuuid | 随机UUID字符串 | 发票的UUID |
order_id | stringmin:1max:32alpha_dash | 随机字符串 | 发票的订单ID |
status* | string | paid | 支付状态可用选项:• process• check• paid• paid_over• fail• wrong_amount• cancel• system_fail• refund_process• refund_fail• refund_paid |
参数类型
stringmin:6max:150url定义
将发送具有付款状态的Webhooks的URL参数类型
string定义
发票货币代码参数类型
string定义
发票网络代码参数类型
stringuuid定义
发票的UUID参数类型
stringmin:1max:32alpha_dash定义
发票的订单ID参数类型
string定义
支付状态可用选项:- process- check- paid- paid_over- fail- wrong_amount- cancel- system_fail- refund_process- refund_fail- refund_paid
* - 强制性参数
您可以通过UUID或order_id参数之一,如果两者都通过,则该帐户将由UUID识别
请求示例
curl https://api.cryptomus.com/v1/test-webhook/payment \
-X POST \
-H 'merchant: 860166ce-478c-4087-9813-55cfb6c34580' \
-H 'sign: a466b82fad9415cdbf5f47802b8d376c' \
-H 'Content-Type: application/json' \
-d '{
"uuid": "e1830f1b-50fc-432e-80ec-15b58ccac867",
"currency": "ETH",
"url_callback": "https://your.site/callback",
"network": "eth",
"status": "paid"
}'
复制回复
响应示例
1{
2 "state": 0,
3 "result": []
4}
复制测试支出
post
https://api.cryptomus.com/v1/test-webhook/payout
要从Webhook数据阵列验证签名,请使用付款API密钥。
要求
查询参数
姓名 | 参数类型 | 默认值 | 定义 |
---|---|---|---|
url_callback* | stringmin:6max:150url | 将发送具有付款状态的Webhooks的URL | |
currency* | string | 支付货币代码 | |
network* | string | 支付网络代码 | |
uuid | stringuuid | 随机UUID字符串 | 支付的UUID |
order_id | stringmin:1max:32alpha_dash | 随机字符串 | 订购ID |
status* | string | paid | 支付状态可用选项:• process• check• paid• fail• cancel• system_fail |
参数类型
stringmin:6max:150url定义
将发送具有付款状态的Webhooks的URL参数类型
string定义
支付货币代码参数类型
string定义
支付网络代码参数类型
stringuuid定义
支付的UUID参数类型
stringmin:1max:32alpha_dash定义
订购ID参数类型
string定义
支付状态可用选项:- process- check- paid- fail- cancel- system_fail
* - 强制性参数
您可以通过UUID或order_id参数之一,如果两者都通过,则该帐户将由UUID识别
请求示例
curl https://api.cryptomus.com/v1/test-webhook/payout \
-X POST -H 'merchant: 860166ce-478c-4087-9813-55cfb6c34580' \
-H 'sign: a466b82fad9415cdbf5f47802b8d376c' \
-H 'Content-Type: application/json' \
-d '{
"uuid": "e1830f1b-50fc-432e-80ec-15b58ccac867",
"currency": "ETH",
"url_callback": "https://your.site/callback",
"network": "eth",
"status": "paid"
}'
复制回复
响应示例
1{
2 "state": 0,
3 "result": []
4}
复制测试钱包
post
https://api.cryptomus.com/v1/test-webhook/wallet
要从Webhook数据阵列验证签名,请使用付款API密钥。
要求
查询参数
姓名 | 参数类型 | 默认值 | 定义 |
---|---|---|---|
url_callback* | stringmin:6max:150url | 将发送具有付款状态的Webhooks的URL | |
currency* | string | 付款货币代码 | |
network* | string | 付款网络代码 | |
uuid | stringuuid | 随机UUID字符串 | 商业钱包 |
order_id | stringmin:1max:32alpha_dash | 随机字符串 | 发票的订单ID |
status* | string | paid | 支付状态可用选项:• process• check• paid• paid_over• fail• wrong_amount• cancel• system_fail• refund_process• refund_fail• refund_paid |
参数类型
stringmin:6max:150url定义
将发送具有付款状态的Webhooks的URL参数类型
string定义
付款货币代码参数类型
string定义
付款网络代码参数类型
stringuuid定义
商业钱包参数类型
stringmin:1max:32alpha_dash定义
发票的订单ID参数类型
string定义
支付状态可用选项:- process- check- paid- paid_over- fail- wrong_amount- cancel- system_fail- refund_process- refund_fail- refund_paid
* - 强制性参数
请求示例
curl https://api.cryptomus.com/v1/test-webhook/wallet \
-X POST -H 'merchant: 860166ce-478c-4087-9813-55cfb6c34580' \
-H 'sign: a466b82fad9415cdbf5f47802b8d376c' \
-H 'Content-Type: application/json' \
-d '{
"uuid": "e1830f1b-50fc-432e-80ec-15b58ccac867",
"currency": "ETH",
"url_callback": "https://your.site/callback",
"network": "eth",
"status": "paid"
}'
复制回复
响应示例
1{
2 "state": 0,
3 "result": []
4}
复制可能的错误
验证错误
代码 : 422
示例响应:
Payments.If you pass uuid or order_id and invoice/static wallet/payout is not found
1{
2 "state": 1,
3 "message": "Not found payment"
4}
复制
1{
2 "state": 1,
3 "message": "Not found payout"
4}
复制
1{
2 "state": 1,
3 "message": "Not found wallet"
4}
复制如果您没有传递所需的参数:
1{
2 "state": 1,
3 "errors": {
4 "currency": ["validation.required"]
5 }
6}
复制如果提供的货币和网络不受加密或不支持:
1{
2 "state": 1,
3 "message": "Payment service not found"
4}
复制
1{
2 "state": 1,
3 "message": "Payout service not found"
4}
复制