openpay python sdk
Python Openpay SDK
This module is created to achieve payment via. Openpay from any web based platform created by Python. Every merchant can use admit his SDK for his clients to handle order creation to complete payment.
pip install openpay-py
Creation of Merchant and Client
Create object of the Merchant class passing at least "JamAuthToken" . If you are using Django then
is the best place to instantiate the Client
from openpay import Client, Merchant merchant= Merchant(jam_auth_token='your jam auth token')
to set Merchant's success, cancel and failure url call set_call_back_url and to set user's info call the next function
merchant.set_callback_url(callback_url, cancel_url, failure_url)
create client aka user in your desired module, send merchant to attach this with client
client = Client(order_id=100, first_name='Abhisek', family_name='Roy', email@example.com', address_1='15/520 Collins Street', suburb='Melbourne', state='Victoria', postcode=3000, dob='06 Jan 1985', merchant=merchant)
%b Month as locale’s abbreviated name. Jan, Feb, …, Dec.
So the date format should be like '06 Jan 1985'.
Sending merchant as argument when creating Client object is strictly required in the above code, to proceed further.
Call new_online_order method to create new order
To create online plan call
To check order capture & order status you should call below function respectively
Note: You will get plan id from the very first call of
To create refund you've to supply plan_id, new_purchase_price(which is previous price - refund price)
In case of full refund, pass
full_refund=True in place of new_purchase_price so the code will be like
If you want to give full refund, you just set the full refund to True, There is no need to pass the price, otherwise just passing the price is fine for partial refund
To check order dispatch plan
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size python_openpay-0.4-py3-none-any.whl (6.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size python-openpay-0.4.tar.gz (4.9 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for python_openpay-0.4-py3-none-any.whl