Payment gateway integration bridge for python, specifically flask based applications.
Project description
GWX Payment
Payment gateway integration bridge for python, specifically flask based applications.
Dependencies
- Python 3.7^
- PyYAML
- stripe
- Werkzeug 0.16^
Installation
- Install the package using pip, by executing:
pip install -U gwx-payment
- Create the
<your_config_name>.yamlfile, this MUST follow the following convention:
# This indicates the current `Active` payment service
provider: stripe
stripe:
api_url: <api_url>
public_key: <public_key>
api_key: <api_key>
success_url: <success_url>
cancel_url: <cancel_url>
paypal:
api_url: <api_url>
public_key: <public_key>
api_key: <api_key>
success_url: <success_url>
cancel_url: <cancel_url>
Quickstart
First import the Provider Service class
from gwx_payment.provider_service import ProviderService
Then instantiate the ProviderService class along with it's config dependencies:
payment_variable = ProviderService('/path/to/config/dir', 'your_config_name.yaml').get_payment_service()
The provider service accepts a .yaml file type as it's config file.
Viola! you can now use it for your payment transactions.
Usage
The following are the methods available within the AbstractPaymentService and their functionality.
| Method Name | Functionality |
|---|---|
| create_payment | Checkout method, this will initiate the payment transaction. |
| :param kwargs: the parameters for the payment creation. | |
| :return: structured value required for response composition. | |
| get_payment | Retrieve a specific payment record |
| :param payment_id: the primary id used to reference against an endpoint. | |
| :return: the retrieved record, null if none found. | |
| confirm_payment | Confirm the payment, this states that the payment has been accepted, |
| and sent to the vendor. | |
| :param kwargs: named payload parameters | |
| :return: structured value required for response composition. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gwx-payment-0.0.3.tar.gz
(5.8 kB
view details)
File details
Details for the file gwx-payment-0.0.3.tar.gz.
File metadata
- Download URL: gwx-payment-0.0.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bc3a5c6ebfb2978d1fdc2d8ea2781539cd81ed5bc53f1f4dbf32616472aa277
|
|
| MD5 |
544bfe420a83ed57d73406ede3c11610
|
|
| BLAKE2b-256 |
37522bb9b3da415ad8e1accc9b1e74b7e7405072481465a2a4a2f7e401393eff
|