Python

Author: Semaka 59 views
				
					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': 'PHPSESSID=abk57kqs42fjpdfvv8a78ckfd7'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)