DengiOnline

2018-04-26 03:00:20

PAY action

Pay an invoice

This action pays an invoice created by preceding check action. Even if the CHECK action was successful (the response with all parameters was received), it doesn't mean that the PAY action will also be successful. Moreover, if the CHECK request is not followed by PAY reasonably soon, the system treats the invoice as obsolete and assigns to it the status 993 -  INVOICE_LIFETIME_EXPIRED.

Request Parameters

Apart from the basic parameters, request for paying an invoice requires the following tags in “params” node:

Parameter

Description

Format

Mandatory

invoice

Invoice ID from check action response

integer

no

txn_id

Transaction ID in project’s system

string(255)

yes

amount

Payment amount

Parameter is required if the amount was not specified in the check action.

If the amount has been specified in “check” action the new value is ignored in “pay” action.

integer /double(4)

no

currency

Payment request’s currency code

If the payment currency is not specified in this action request, the System uses main account currency as payment currency.

If the currency has been specified in “check” action the new value is ignored in “pay” action.

Payment currency cannot be changed!
If check_action and pay_action send different currencies, then error 21 - BAD_CURRENCY will be returned.

string / integer
ISO 4217 number-3

 

comment

Comment that payment receiver will see in his wallet

(only available for Qiwi and Webmoney)

string(255) no

Additional parameters

Several paysystems require some additional parameters for proceeding the payment or for security check. 
The parameters and specifications are listed in the params node of responce to the commissions action request.

If the request doesn't contain additional parameters, then error 20 - BAD_PARAM will be returned.
If additional parameters of the request do not pass the payment system security check, then error 37 - SANCTION_BLOCKED will be returned.

Please note: If “check” action request has had no payment amount and currency ("amount" and "currency" nodes), they are to be specified in “pay” action request as nodes “params\amount” and “params\currency” respectively.

Response Parameters

The GSG System response in XML format apart from the basic parameters contains the following nodes:

Parameter

Description

Format

income

Payment amount in request’s currency

decimal(11.4)  delimiter — dot

rate

Conversion rate

decimal(11.4)  delimiter — dot

amount

Payment amount in main account’s currency

decimal(11.4)  delimiter — dot

outcome

Payment amount in payment provider’s currency

decimal(11.4)  delimiter — dot

fee

Fee amount in payment recipient's currency

decimal(11.4)  delimiter — dot

Внимание!

There's only one PAY action request allowed per invoice. Use the PAY_STATUS action to check if the payment was successfully completed or resulted in a failure of any sort.

 In case of an error, send a new invoice with another txn_id. The old txn_id cannot be used.

    • Exception: In case of an internal error (code 1000), repeat the PAY action request with old parameters

Example request

<?xml version="1.0" encoding="UTF-8"?>
<request>
	<action>pay</action>
	<project>1234</project>
	<timestamp>1360928335</timestamp>
	<params>
		<txn_id>511e1e34d785b</txn_id>
	</params>
<sign>dc1917fbb55ffc6012b5b1558a628813</sign>
</request>

Example response (success)

<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>1</status>
	<reference>501583</reference>
	<timestamp>1360928334</timestamp>
	<invoice>30876</invoice>
	<income>12.34</income>
	<rate>1</rate>
	<amount>12.34</amount>
	<outcome>12.34</outcome>
	<fee>-0.617</fee>
</response>

Example response (fail)

 <?xml version="1.0" encoding="UTF-8"?>
<response>
    <status>18</status>
    <reference>25063</reference>
    <timestamp>1358265477</timestamp>
</response>