Xsolla-logoXsolla Developers
前往发布商帐户

Declined paymentWebhook POST

If a transaction is declined by a payment system, Xsolla sends the transaction details in a webhook of the ps_declined type to your configured webhook URL. The webhook is sent during the authorization or payment processing stage. In this case, the payment\ order_paid webhook is not sent.

Typical reasons for payment system declines:

  • Card authorization failed (for example, the payment system could not complete the authorization process due to a technical error or no response from the bank) or was declined (for example, the bank responded but refused the transaction due to insufficient funds or invalid card details).
  • 3-D Secure verification failed, was not completed, or the user confirmation timed out.
  • The processor or acquiring bank is temporarily unavailable or returns a hard decline due to an irreversible error, such as a closed account or an invalid card number. Retrying without addressing the underlying issue will not result in a successful transaction.

Should not be confused with:

  • Anti-fraud rejections, which are reported via the afs_reject webhook.
  • Refunds and partial refunds after a successful payment, which are reported via the refund and partial_refund webhooks.

Note

To receive the ps_declined webhook, contact your Customer Success Manager or email csm@xsolla.com.

Request
Request Body schema: application/json
notification_type
required
string

通知类型。

required
object

交易ID。

dry_run
integer

测试交易。如为测试交易,该参数的值为1;如为真实交易,则不会发送该参数。

external_id
string

交易外部ID。

id
integer

交易ID。

payment_method
integer

付款方式ID。

object

退款详情(对象)。

author
string

退款发起人。根据下表传入字段值:

退款发起人 字段值
游戏(通过API)。 API
发布商帐户用户(自动退款)。 用户邮箱
发布商帐户用户(通过艾克索拉客户支持的帮助)。 support@xsolla.com
艾克索拉(通过艾克索拉客户支持的帮助)。 support@xsolla.com
code
integer

代码ID。

reason
string

退款原因。

object

带有自定义项目设置的对象。

merchant_id
integer

商户ID。

project_id
integer

项目编号。您可以在您的发布商帐户项目名称旁边。

object

User details (object).

id
required
string

用户ID。

country
string

用户所在国家/地区。使用ISO 3166-1 alpha-2 标准规定的2字母组合表示国家/地区。

email
string

用户电子邮件。

ip
string

用户 IP 地址。

name
string

用户名。

Responses
204

返回以指示处理成功。

400

提供的信息有错误(例如,缺少必需的参数、授权失败等)时返回。在这种情况下,用户的钱已扣,但是购买失败。要退款,请发送邮件至support@xsolla.com联系艾克索拉客户支持。

500

返回以指示您的服务器存在的暂时性错误。

Request samples
curl -v 'https://your.hostname/your/uri' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Signature 80543ba63e1e50cf05f15150fe75e7245da9a898' \
-d '{
  "notification_type": "ps_declined",
  "settings": {
    "project_id": "18404",
    "merchant_id": "2340"
  },
  "user": {
    "ip": "127.0.0.1",
    "email": "email@example.com",
    "id": "1234567",
    "country": "US"
  },
  "transaction": {
    "id": "1",
    "dry_run": "1",
    "payment_method": "1"
  },
  "refund_details": {
    "author": "support@xsolla.com",
    "code": "8",
    "reason": "Cancellation by the PS request",
    "reason_detail": "Insufficient funds"
  }
}'
Response samples
application/json
{
  • "error": {
    }
}