Skip to main content

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

  1. Install the package using pip, by executing:
pip install -U gwx-payment
  1. Create the <your_config_name>.yaml file, 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


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 hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page