Register as a merchant on Quickteller
- Add the following line immediately after the line above:
We are adding the Quickteller.checkout() function to execute when the document loading completes. The Quickteller.checkout() function takes four parameters:
- A JSON object with the following properties: paymentCode: The payment code you got when you registered as a merchant on Quickteller. buttonSize: The size of the button you want to include. Valid options are: small, medium and large. redirectUrl: The URL where you want the response of the transaction submitted to. The response would be sent as a form submission, with POST method. The following parameters are what should be received:tx_ref, resp_desc, status and resp_code. amount: The amount of the item that you want to sell. customerId: Any unique ID which you want to use to use to identify the current customer making the transaction. MobileNumber: For sending the receipt sms. emailAddress: For email for emailing receipt to user.
- The ID of the container which you want to hold the button.
How to handle response from redirect URL
After the payment pop-up closes, Quickteller redirects to the URL you supplied, sending a number of parameters back via HTTP POST. The parameters passed to your redirect are as follows:
- tx_ref: This represent the transaction reference of the current transaction and is unique to each transaction.
- resp_desc: This represent description of the current transaction.
- status: This represents the status of the operation and it’s boolean: “True” for successful and “false” for failed.
- resp_code: This represent the response code from WebPAY. The code for successful transaction is “9000″ or “00″
After you get this response, you are required to do a service call to the URL: https://sandbox.interswitchng.com/quickteller.js/api/v2/<<tx_ref>>. The HTTP method is GET and the header must contain your two parameters:
- domain: The domain name where your request originated from. For instance: “example.com”
- hash: Use your mac key, given to you when you registered as a merchant and the tx_ref returned to compute a hash
Moving your SDK integration from Sandbox to Production
Also, change the service call URL to https://js.quickteller.com/api/v2/<<tx_ref>>
Try it out
E-mail: firstname.lastname@example.org. Password: password.