Python client implementation for eWAY Rapid API v3
pip install eway-rapid-python + = Implemented
- = To be implemented in future versions
Transparent Redirect
Direct Connection
Responsive Shared Page
Refunds
Transaction Query
Pre-Auth
Token Payments
Settlement Search
Recurring Payments
Rapid API documentation: https://eway.io/api-v3
fromeway.rapid.clientimportRestClientfromeway.rapid.endpointimportSandboxEndpointfromeway.rapid.modelimportPayment, RequestMethod, TransactionTypefromeway.rapid.payment_method.transparent_redirectimportTransparentRedirect, CreateAccessCodeRequestpayment_method=TransparentRedirect(RestClient('api-key', 'api-password', SandboxEndpoint()))
# response is eway.rapid.payment_method.transparent_redirect.response.AccessCodeResponseresponse=payment_method.create_access_code(CreateAccessCodeRequest(
Payment(4200, 'AUD'),
RequestMethod.ProcessPayment,
TransactionType.Purchase,
'https://localhost/'
))
print(response.to_json())
# ... here client performs form submit in his browser# transaction is eway.rapid.payment_method.transparent_redirect.response.TransactionInfotransaction=payment_method.request_transaction_result(response.AccessCode)
print(transaction.to_json())For more complete example have a look at Transparent Redirect tests and the Snippets section of the wiki.
python -m unittest testsThe MIT License (MIT). Please see License File for more information.