Get payment status

Once the payment is completed the user will be redirected to the error_url/pending_url/success_url depending on

vb.net

Dim rest As New Chilkat.Rest Dim success As Boolean ' URL: https://gateway.switch.tj/api/v1/payment-key Dim bTls As

Ruby

require "uri" require "net/http" url = URI("https://gateway.switch.tj/api/v1/payment-key") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request

PHP

Python

import requests url = "https://gateway.switch.tj/api/v1/payment-key" payload='merchant_reference=12312312312&amount=5.00&error_url=https%3A%2F%2Furl-to-your-success-page.co.za&success_url=https%3A%2F%2Furl-to-your-success-page.co.za&cancel_url=https%3A%2F%2Furl-to-your-success-page.co.za&notify_url=https%3A%2F%2Furl-to-your-success-page.co.za&payment_type=credit_card' headers = { 'Authorization': 'Basic V2hvb3NoRGVtb0FQSTpmZGZsa2RmZXVlbzM4Mzk4', 'Content-Type': 'application/x-www-form-urlencoded', 'Cookie':

Node.js

var request = require('request'); var options = { 'method': 'POST', 'url': 'https://gateway.switch.tj/api/v1/payment-key', 'headers': { 'Authorization':

Java

OkHttpClient client = new OkHttpClient().newBuilder().build(); MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); RequestBody body = RequestBody.create(mediaType, "merchant_reference=12312312312&amount=5.00&error_url=https://url-to-your-success-page.co.za&success_url=https://url-to-your-success-page.co.za&cancel_url=https://url-to-your-success-page.co.za&notify_url=https://url-to-your-success-page.co.za&payment_type=credit_card"); Request

C#

var client = new RestClient("https://gateway.switch.tj/api/v1/payment-key"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Basic

Create the payment form

NB: A SSL certificate is required to ensure compatibility with the frame. First you will

Generate Payment Key

A payment-key may be generated by running the below curl request. For reference on other