Перейти к содержимому

Make a card payment

Это содержимое пока не доступно на вашем языке.

makePayment charges one of the payer’s stored cards through the payment processor of its owner. On success the amount is added to the balance of the account or customer as a card payment. This is what Make Payment does in the portal when the payer picks a card from Use Card.

The method supports trusted mode with i_wholesaler, the ID of the customer that owns the payer.

Name Type Required Description
i_account int one of ID of the account that pays
i_customer int one of ID of the customer that pays
amount double yes Amount to charge
currency string yes ISO 4217 code of the payment currency, for example USD. The panel sends the payer’s base currency
payer_ip_address string yes IP address of the payer. The panel sends the address of the browser that asked for the payment
i_debit_credit_card int no ID of the stored card to charge. Default: the payer’s primary card
Name Type Description
result string OK, PENDING or FAILED, see below
i_payment int ID of the payment. Pass it to getPaymentInfo for the details
result Meaning
OK The payment succeeded and the balance is topped up
PENDING The payment processor has not confirmed the payment yet. Check it later with getPaymentInfo
FAILED The payment failed. tx_error of getPaymentInfo has the processor’s message

A declined card is a FAILED result, not a fault. A fault means the payment could not be attempted.

request
call("makePayment", {
"i_account": 3092,
"amount": 20.0,
"currency": "USD",
"payer_ip_address": "198.51.100.23",
})
response
{"result": "OK", "i_payment": 88213}