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. |
Release files for gwx-payment 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gwx-payment-0.0.3.tar.gz | 5.8 kB | Details |
Release files / gwx-payment-0.0.3.tar.gz
| Download URL | gwx-payment-0.0.3.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bc3a5c6ebfb2978d1fdc2d8ea2781539cd81ed5bc53f1f4dbf32616472aa277
|
|
BLAKE2b-256 checksum How to use checksums |
37522bb9b3da415ad8e1accc9b1e74b7e7405072481465a2a4a2f7e401393eff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|