https://github.com/springload/eway-rapid-python
Python client implementation for eWAY Rapid API v3
https://github.com/springload/eway-rapid-python
eway python rapid
Last synced: 2 months ago
JSON representation
Python client implementation for eWAY Rapid API v3
- Host: GitHub
- URL: https://github.com/springload/eway-rapid-python
- Owner: springload
- License: mit
- Created: 2016-05-25T02:08:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-28T02:56:42.000Z (over 7 years ago)
- Last Synced: 2024-11-21T17:57:05.108Z (11 months ago)
- Topics: eway, python, rapid
- Language: Python
- Size: 486 KB
- Stars: 3
- Watchers: 21
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eway-rapid-python
Python client implementation for eWAY Rapid API v3# Installation
```bash
pip install eway-rapid-python
```# API parts implementation status:
```
+ = 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 v3
Rapid API documentation: https://eway.io/api-v3
# Basic usage
```python
from eway.rapid.client import RestClient
from eway.rapid.endpoint import SandboxEndpoint
from eway.rapid.model import Payment, RequestMethod, TransactionType
from eway.rapid.payment_method.transparent_redirect import TransparentRedirect, CreateAccessCodeRequestpayment_method = TransparentRedirect(RestClient('api-key', 'api-password', SandboxEndpoint()))
# response is eway.rapid.payment_method.transparent_redirect.response.AccessCodeResponse
response = 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.TransactionInfo
transaction = payment_method.request_transaction_result(response.AccessCode)print(transaction.to_json())
```For more complete example have a look at [Transparent Redirect tests](./tests/transparent_redirect.py) and the [Snippets](https://github.com/springload/eway-rapid-python/wiki#snippets) section of the wiki.
# Testing
```bash
python -m unittest tests
```# License
The MIT License (MIT). Please see [License File](LICENSE) for more information.