Top up an account with a voucher
Это содержимое пока не доступно на вашем языке.
rechargeVoucher redeems a top-up voucher for an account: the voucher’s value is converted to the account’s currency and added to its balance as a voucher payment. Use it to let accounts top up from your own website or app, as Make Payment with Top-up Voucher does in the portal.
The method supports trusted mode with i_customer, the ID of the customer that owns the account. In trusted mode you can also pass i_voucher instead of voucher_id and secret_pin.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | one of | ID of the account to top up |
username |
string | one of | User name of the account, used when i_account is not given |
voucher_id |
string | yes | Voucher ID printed on the voucher |
secret_pin |
string | no | Secret PIN of the voucher. Needed when the vouchers are issued with a PIN |
i_voucher |
int | no | Internal ID of the voucher, trusted mode only. Replaces voucher_id and secret_pin |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK when the voucher was redeemed. Any other value means it was not accepted: check the voucher ID and PIN |
value |
double | Value of the voucher, in voucher_currency |
voucher_currency |
string | ISO 4217 code of the voucher’s currency |
payer_amount |
double | Amount added to the balance, in the account’s currency |
Example
Section titled “Example”call("rechargeVoucher", { "username": "1001", "voucher_id": "7420019935", "secret_pin": "4815",}){ "result": "OK", "value": 10.0, "voucher_currency": "EUR", "payer_amount": 10.85,}Errors
Section titled “Errors”| faultCode | Cause |
|---|---|
410 |
The voucher payment cannot be processed now. The panel asks the payer to try again later |
Related
Section titled “Related”- Vouchers: creating top-up vouchers
- Payments: how a payer pays
- Get payment details:
by_voucherin the result - Make a card payment