测试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发票网络代码
uuidstringuuid随机UUID字符串发票的UUID
order_idstringmin:1max:32alpha_dash随机字符串发票的订单ID
status*stringpaid支付状态可用选项:processcheckpaidpaid_overfailwrong_amountcancelsystem_failrefund_processrefund_failrefund_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支付网络代码
uuidstringuuid随机UUID字符串支付的UUID
order_idstringmin:1max:32alpha_dash随机字符串订购ID
status*stringpaid支付状态可用选项:processcheckpaidfailcancelsystem_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付款网络代码
uuidstringuuid随机UUID字符串商业钱包
order_idstringmin:1max:32alpha_dash随机字符串发票的订单ID
status*stringpaid支付状态可用选项:processcheckpaidpaid_overfailwrong_amountcancelsystem_failrefund_processrefund_failrefund_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}
复制