Xsolla-logoXsolla Developers
ou
Vers le Compte éditeur

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

Type de notification.

required
object

Détails de la transaction (objet).

dry_run
integer

Transaction test. Le paramètre a la valeur 1 s'il s'agit d'une transaction test ou n'est pas envoyé si la transaction est réelle.

external_id
string

External ID de la transaction.

id
integer

ID de transaction.

payment_method
integer

ID de mode de paiement.

object

Détails du remboursement (objet).

author
string

Initiateur du remboursement. La valeur du champ est passée conformément au tableau :

Initiateur du remboursement Valeur du champ
Jeu (via API). API
Utilisateur du Compte éditeur (remboursement automatique). Adresse e-mail de l'utilisateur
Utilisateur du Compte éditeur (avec l'assistance du service client Xsolla). support@xsolla.com
Xsolla (avec l'assistance du service client Xsolla). support@xsolla.com
code
integer

ID de code.

reason
string

Motif de remboursement.

object

Custom project settings (object).

merchant_id
integer

ID de commerçant.

project_id
integer

ID de projet. Ce paramètre se trouve dans le Compte éditeur à côté du nom du projet.

object

Informations sur l'utilisateur (objet).

id
required
string

ID utilisateur.

country
string

Pays de l'utilisateur. Code pays à deux lettres majuscules selon la norme ISO 3166-1 alpha-2.

email
string

Adresse e-mail de l'utilisateur.

ip
string

IP de l'utilisateur.

name
string

Nom d'utilisateur.

Responses
204

Renvoyez pour indiquer un traitement réussi.

400

Renvoyez en cas d'erreur dans les informations fournies (par exemple, un paramètre requis manquant, une autorisation échouée, etc.). Dans ce cas, l'utilisateur est débité, mais l'achat échoue. Pour procéder au remboursement, contactez le service client Xsolla à support@xsolla.com.

500

Renvoyez pour indiquer des erreurs temporaires liées à vos serveurs.

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": {
    }
}