All Projects → WilliamOtieno → python-flutterwave

WilliamOtieno / python-flutterwave

Licence: MIT license
Python Wrapper for interacting with the Flutterwave API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to python-flutterwave

laravel-pix
Uma solucão simples para integrar sua aplicação Laravel a API PIX do Banco Central do Brasil
Stars: ✭ 73 (+135.48%)
Mutual labels:  payment-gateway
sep-pay
Pay.ir Payment Package for Laravel 5.3+
Stars: ✭ 17 (-45.16%)
Mutual labels:  payment-gateway
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP
Stars: ✭ 43 (+38.71%)
Mutual labels:  payment-gateway
python-daraja
Python Wrapper for interacting with the MPESA Daraja API. More Features to be implemented
Stars: ✭ 20 (-35.48%)
Mutual labels:  payment-gateway
Documentations
Documentation to integrate PayU SDKs
Stars: ✭ 26 (-16.13%)
Mutual labels:  payment-gateway
tbc-credit-card-payment-gateway-php-lib
PHP library for the TBC credit card payment gateway API.
Stars: ✭ 80 (+158.06%)
Mutual labels:  payment-gateway
cybersource-sdk-java
Java SDK for CyberSource Simple Order API
Stars: ✭ 44 (+41.94%)
Mutual labels:  payment-gateway
stripe
Stripe integration with Magento 2
Stars: ✭ 58 (+87.1%)
Mutual labels:  payment-gateway
flutterwave-flutter
Flutterwave's Flutter library allows you to build a quick, simple, and excellent payment experience in your flutter applications. We provide a UI that can be used out-of-the-box to collect your users' payment details
Stars: ✭ 37 (+19.35%)
Mutual labels:  flutterwave
ThreeDPayment
Est altyapısına sahip tüm bankalarla uyumlu 3DPay model sanal pos örneği - ASP.NET Core 3.1 ile yazılan yeni version https://github.com/sefacan/3DPaymentAspNetCore
Stars: ✭ 29 (-6.45%)
Mutual labels:  payment-gateway
moneywave-nodejs
A client library for moneywave API
Stars: ✭ 16 (-48.39%)
Mutual labels:  flutterwave
PaymentCardView
Custom Credit/Debit card view
Stars: ✭ 62 (+100%)
Mutual labels:  payment-gateway
MugglePay
Make Crypto Payment Easy 让数字货币支付更简单
Stars: ✭ 176 (+467.74%)
Mutual labels:  payment-gateway
omnipay-2checkout
2Checkout driver for the Omnipay PHP payment processing library
Stars: ✭ 25 (-19.35%)
Mutual labels:  payment-gateway
iran-payment
a Laravel package to handle Internet Payment Gateways for Iran Banking System
Stars: ✭ 16 (-48.39%)
Mutual labels:  payment-gateway
borica-3ds
PHP Borica EMV 3DS library
Stars: ✭ 15 (-51.61%)
Mutual labels:  payment-gateway
Paynow-NodeJS-SDK
NodeJS SDK for Zimbabwe's leading payments gateway, Paynow
Stars: ✭ 23 (-25.81%)
Mutual labels:  payment-gateway
adyen-salesforce-commerce-cloud
Salesforce Commerce Cloud (formerly Demandware)
Stars: ✭ 63 (+103.23%)
Mutual labels:  payment-gateway
Node-js-functionalities
This repository contains very useful restful API's and functionalities in node-js containing many important tutorial code for mastering node-js, all tutorials have been published on medium.com, tutorials link is given below
Stars: ✭ 69 (+122.58%)
Mutual labels:  payment-gateway
adyen-python-api-library
Adyen API Library for Python
Stars: ✭ 41 (+32.26%)
Mutual labels:  payment-gateway

Python Flutterwave

Description

Python Wrapper for interacting with the Flutterwave API

Contribution

  • Before making any further steps (for interested contributors), please refer to the CONTRIBUTING GUIDE.

Installation

  • pip install python-flutterwave

Usage

  • Create an account in Flutterwave here and obtain your Secret Key only.
from python_flutterwave import payment

payment.token = 'YOUR_SECRET_KEY'
Here are all the possible values for payment options available on Flutterwave:
0: "account"
1: "card"
2: "banktransfer"
3: "mpesa"
4: "mobilemoneyrwanda"
5: "mobilemoneyzambia"
6: "qr"
7: "mobilemoneyuganda"
8: "ussd"
9: "credit"
10: "barter"
11: "mobilemoneyghana"
12: "payattitude"
13: "mobilemoneyfranco"
14: "paga"
15: "1voucher"
16: "mobilemoneytanzania"
  • To trigger a standard payment that returns a redirect uri
uri = payment.initiate_payment(tx_ref="qwerty", amount=100, redirect_url='your_callback_url',
                               payment_options='mpesa', customer_email='[email protected]',
                               customer_phone_number='0123456789', currency='KES', customer_name='John Doe',
                               title='Demo Payment', description='Just pay me...')
print(uri)
  • Redirect the user to that uri where he/she will make the payment.

  • After payment is made, the user will be redirected to the redirect_url you declared but Flutterwave will append some info regarding the payment i.e. transaction_id and tx_ref. If your url is https://example.com/callback then it may be http://example.com/callback/?status=successful&tx_ref=qwerty&transaction_id=2784792

  • You should save the transaction_id to your DB as it will be used to query the transaction details.

  • To check the transaction details e.g. successful or not, grab the transaction_id from the previous step.

details = payment.get_payment_details(transaction_id)
print(details)
  • To trigger an automatic MPESA charge on your customer through STK push, first configure your Webhook url in the dashboard, it may be a simple server; Flutterwave will post some data regarding your transaction status in that url. This method call will return a Python dict object. You can decide what to do thereon.
mpesa_trans_details = payment.trigger_mpesa_payment(tx_ref="qwertyuio", amount=100, currency='KES', 
                                                    email='[email protected]', phone_number='1234567890', 
                                                    full_name='John Doe')
print(mpesa_trans_details)
  • To initiate a USSD payment to your customer, configure your webhook url in the dashboard where Flutterwave will post data regarding the transaction. This method call will return a Python Dict object from which you can extract the USSD code to show your customer for payment completion. For other banks, you may also need to extract the payment_code from the result.

    • By default, NGN is the only supported currency for USSD payments so this method automatically uses NGN
    • Only a number of banks support USSD so you have to refer to the docs to check your bank and its corresponding account_bank code.
At the moment, banks available for USSD payments (and their numeric codes) are:

Access Bank -- 044
Ecobank -- 050
Fidelity Bank -- 070
First Bank of Nigeria -- 011
First City Monument Bank (FCMB) -- 214
GTBank -- 058
Heritage Bank -- 030
Keystone Bank -- 082
Stanbic IBTC Bank -- 221
Sterling Bank -- 232
Union Bank -- 032
United Bank for Africa -- 033
Unity Bank -- 215
VFD Microfinance Bank -- 090110
Wema Bank -- 035
Zenith Bank -- 057
details = payment.initiate_ussd_payment(tx_ref="123erd", amount=100, email='[email protected]',
                                        phone_number='789456123', full_name='John Doe', account_bank='057')
print(details)
  • For bank transactions, it is important to first verify the details given to you by the customer before granting incentives according to the specifications of your application.
  • To verify bank details call the function below that returns a Python dictionary with the data...
details = payment.verify_bank_account_details(account_number= "0690000032", account_bank= "044")
print(details)
  • For card transactions, it is advisable to ascertain the customer's card details before granting incentives according to the specifications of your application.
  • This function call takes the card_bin (usually the first 4-6 digits in debit/credit cards) and returns info regarding the card. A Python dict object is returned, thence use it according to your needs.
details = payment.verify_card_details(card_bin=553188)
print(details)

Sponsor Python Flutterwave

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].