All Projects → omise → omise-python

omise / omise-python

Licence: MIT License
Omise Python Library

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to omise-python

bolt-magento2
Bolt plugin for magento2
Stars: ✭ 17 (-22.73%)
Mutual labels:  payment
midtrans-python-client
Official Midtrans Payment API Client for Python | https://midtrans.com
Stars: ✭ 24 (+9.09%)
Mutual labels:  payment
LolautruchePaylineBundle
Symfony integration for Payline payment system
Stars: ✭ 15 (-31.82%)
Mutual labels:  payment
svelte-stripe-js
Everything you need to add Stripe Elements to your Svelte project
Stars: ✭ 139 (+531.82%)
Mutual labels:  payment
magento2
Mollie Payments for Magento 2
Stars: ✭ 70 (+218.18%)
Mutual labels:  payment
one
🚥 Idempotency Handler, for making sure incoming requests are idempotent. Useful for payments, "at least once delivery" systems and more.
Stars: ✭ 18 (-18.18%)
Mutual labels:  payment
payjs-laravel
基于 PAYJS 微信支付个人接口开发的 Laravel Package,可直接用于生产环境
Stars: ✭ 57 (+159.09%)
Mutual labels:  payment
frames-android
Checkout API Client, Payment Form UI and Utilities
Stars: ✭ 26 (+18.18%)
Mutual labels:  payment
drf-stripe-subscription
An out-of-box Django REST framework solution for payment and subscription management using Stripe.
Stars: ✭ 42 (+90.91%)
Mutual labels:  payment
loan-payments-calculator
A small library for calculating loan payments using various configurations, works.
Stars: ✭ 13 (-40.91%)
Mutual labels:  payment
widgets
💸 Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion with state-of-the-art widgets.
Stars: ✭ 32 (+45.45%)
Mutual labels:  payment
laravel-viva-payments
A Laravel package for integrating the Viva Payments gateway
Stars: ✭ 29 (+31.82%)
Mutual labels:  payment
ex pesa
Payment Library For Most Public Payment API's in Kenya and hopefully Africa. Let us get this moneybag
Stars: ✭ 19 (-13.64%)
Mutual labels:  payment
awesome-payment
支付业务常用汇总
Stars: ✭ 24 (+9.09%)
Mutual labels:  payment
SwissPaymentSlip
A PHP library for creating Swiss Payment Slips
Stars: ✭ 18 (-18.18%)
Mutual labels:  payment
laravel-hyperpay
Laravel package for Hyperpay payment gateway in MENA.
Stars: ✭ 14 (-36.36%)
Mutual labels:  payment
crater
Open Source Invoicing Solution for Individuals & Businesses
Stars: ✭ 5,938 (+26890.91%)
Mutual labels:  payment
nagadApi
This is Bangladeshi nagad payment gateway api development library. This library can be used in any php application.
Stars: ✭ 20 (-9.09%)
Mutual labels:  payment
react-native-square-reader-sdk
React Native Plugin for Square Reader SDK
Stars: ✭ 94 (+327.27%)
Mutual labels:  payment
pix-payload-generator.net
Gerar payload para qrcode estático PIX. (Sistema de pagamento instantâneo do Brasil) Sem a necessidade de conexão com um PSP.
Stars: ✭ 23 (+4.55%)
Mutual labels:  payment

Omise Python Client

Build Status Python Versions PyPi Version

Please raise an issue or contact [email protected] if you have any question regarding this library and the functionality it provides.

Installation

If you simply want to use Omise Python client in your application, you can install it using pip:

pip install omise

Or easy_install in case your system do not have pip installed:

easy_install omise

The Omise Python client officially supports the following Python versions:

  • Python 2.7
  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9

Any versions not listed here may work but they are not automatically tested.

Usage

Please refer to examples in our API documentation. For basic usage, you can use the package in your application by importing omise and setting the secret key:

import omise
omise.api_secret = 'skey_test_4xsjvwfnvb2g0l81sjz'

After the secret key is set, you can use all APIs which use secret key authentication.

To create a new credit card charge, use Omise.js to create a new token and run the following:

token_id = "tokn_test_no1t4tnemucod0e51mo" # see https://www.omise.co/tokens-api#create
charge = omise.Charge.create(
    amount=100000,
    currency="THB",
    card=token_id,
    return_uri="https://www.omise.co/example_return_uri",
)
# <Charge id='chrg_test_5ktrim62oiosnrc1r41' at 0x105d6bf28>
charge.status
# 'successful'

To create a new customer without any cards associated to the customer, run the following:

customer = omise.Customer.create(
   description='John Doe',
   email='[email protected]'
)
# <Customer id='cust_test_4xtrb759599jsxlhkrb' at 0x7ffab7136910>

Then to retrieve, update, and destroy that customer, run the following:

customer = omise.Customer.retrieve('cust_test_4xtrb759599jsxlhkrb')
customer.description = 'John W. Doe'
customer.update()
# <Customer id='cust_test_4xtrb759599jsxlhkrb' at 0x7ffab7136910>
customer.destroy()
customer.destroyed
# True

In case of error (such as authentication failure, invalid card and others as listed in errors section in the documentation), the error of a subclass omise.errors.BaseError will be raised. Your application code should handle these errors appropriately.

API version

In case you want to enforce API version the application use, you can specify it by setting api_version. The version specified by this setting will override the version setting in your account. This is useful if you have multiple environments with different API versions (e.g. development on the latest but production on the older version).

import omise
omise.api_version = '2019-05-29'

It is highly recommended to set this version to the current version you're using.

Contributing

The Omise Python client uses tox and Docker for testing. All changes must be tested against all supported Python versions. You can run tests using the following instructions:

  1. Install Docker
  2. Run docker run -it -v $(pwd):/app --rm $(docker build -q .)

This command builds a Docker image using the Dockerfile, mounts the current directory to the container's /app directory, and runs the default entrypoint for the image: /app/run-tox.sh.

After you've made your changes and run the tests, please open a Pull Request.

License

See LICENSE.txt

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].