We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Welcome to the eway-rapid-python wiki!
By Devendra Kavthekar
import requests environment = 'test' environment = 'production' _api_key = 'xxxxxxxxxxxxxxxx' #Eway - API Key _api_password = 'zzzz' #Eway - API Password trans_type = 'Refund' refund_amount = 100 # Refund amount refund_payload = { "TotalAmount": refund_amount, "InvoiceNumber": "Inv 21540", "InvoiceDescription": "Individual Invoice Description", "InvoiceReference": "513456", "CurrencyCode": "AUD" } transaction_id = 17799963 #Refund against which eway transaction if environment == 'test': refund_url = r'https://api.sandbox.ewaypayments.com/Transaction/'+ transaction_id +'/Refund' else: refund_url = r'https://api.ewaypayments.com/Transaction/'+ transaction_id +'/Refund' json_payload = { 'Customer': 'XYZ Customer', 'Refund': refund_payload, 'ShippingAddress': 'ShippingAddress', } response = requests.post(refund_url, auth=(_api_key, _api_password), data=json_payload, headers={'Content-Type': 'application/json'}) return {'response': response}