TeleAudio webbilling¶
Generating a transaction¶
The merchant generates a reqest for ‘set_transaction’. In the payment section the aa_id is set to the ID of the Teleaudio webbilling payment channel. The Teleaudio webbilling payment channel ID is provided by USP team. Creating the transaction is asynchronous, and after sending the set_transaction request there is only returned a status if the request has been accepted or not. If the request is accepted, the transaction is processed. It is required that a phone number is provided with customer’s data, otherwise creating the payment will not be possible.
1 2 3 4 5 6 | "payment":{ "channel_id":"<teleaudio-payment-channel-id>", "amount":"0", "currency":"PLN", "config":{} }, |
Confirming the payment with a teleaudio sms code¶
Upon the payment has been iniciated with previous set_transaction request, the user receives an sms from teleaudio with confirmation code. The user fills the code into a form provided by the merchant. When the code is submitted, the merchant use it to call confirm_teleaudio_payment method from pay_system api.
1 2 3 4 5 6 7 8 9 10 11 12 13 | curl -X POST \ http://paysystem.tms.onetapi.pl \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json-rpc' \ -d '{ "jsonrpc":"2.0", "id":"example", "method":"confirm_teleaudio_payment", "params":{ "trans_ext_id": "12345asdb", "code": "<teleaudio-code>" } } |
OK response
{
"status":"1",
"result": "",
"action_type": ""
}
ERROR response
{
"status":"-1",
"result": "400 - <ERROR-CODE>"
"action_type": ""
}
For code 400 there are available following error codes:
BADTRANSACTION : Provided transactionId not exists.
BADTOKEN : Invalid token.
TRYEXCEEDED : Too many tries. Wrong PIN was provided for the third time.
Activating the ordered service¶
Upon completing the payment and collecting money from the users phone, TeleAudio sends a callback to PaySystem, upon which PaySystem sends a callback to merchant using notifications service and new_payment request.