This folder contains Python scripts for integrating various payment providers, including traditional gateways, local payment methods, and cryptocurrency payments. Each script provides functions for initiating and managing transactions with different payment providers.
- Braintree
- BTCPay
- Chargebee
- GetLago
- M-Pesa
- MTN MoMo
- Orange Money
- PayPal
- Paystack
- Razorpay
- Square
- Stripe
Braintree is a full-stack payment platform that makes it easy to accept payments online.
-
File:
braintree_payment.py
-
Setup:
- Install the Braintree SDK:
pip install braintree
. - Configure Braintree credentials (merchant ID, public key, private key).
- Install the Braintree SDK:
-
Example Usage:
from braintree_payment import create_transaction create_transaction(100, "USD", "payment_method_nonce")
BTCPay is a cryptocurrency payment processor that allows businesses to accept Bitcoin and other cryptocurrencies.
-
File:
btcpay_payment.py
-
Setup:
- Install requests:
pip install requests
. - Set up BTCPay server and API keys.
- Install requests:
-
Example Usage:
from btcpay_payment import create_invoice create_invoice(0.01, "BTC")
Chargebee is a subscription management and recurring billing software for SaaS businesses.
-
File:
chargebee_payment.py
-
Setup:
- Install Chargebee Python library:
pip install chargebee
. - Configure API key and site name.
- Install Chargebee Python library:
-
Example Usage:
from chargebee_payment import create_subscription create_subscription("plan_id", "customer_id")
GetLago is an open-source billing API for managing subscription billing and usage-based billing.
-
File:
getlago_payment.py
-
Setup:
- Install requests:
pip install requests
. - Configure API key.
- Install requests:
-
Example Usage:
from getlago_payment import create_invoice create_invoice("customer_id", 2000, "USD")
M-Pesa is a mobile money service that allows users to transfer money and make payments.
-
File:
mpesa_payment.py
-
Setup:
- Install requests:
pip install requests
. - Configure M-Pesa API credentials.
- Install requests:
-
Example Usage:
from mpesa_payment import initiate_payment initiate_payment("254700000000", 1000)
MTN MoMo provides mobile money services that allow users to make payments and transfers using mobile devices.
-
File:
mtn_momo_payment.py
-
Setup:
- Install requests:
pip install requests
. - Configure MTN MoMo API credentials.
- Install requests:
-
Example Usage:
from mtn_momo_payment import request_payment request_payment("256700000000", 500)
Orange Money is a mobile money service that allows users to send and receive money, pay bills, and more.
-
File:
orange_money_payment.py
-
Setup:
- Install requests:
pip install requests
. - Configure Orange Money API credentials.
- Install requests:
-
Example Usage:
from orange_money_payment import initiate_transaction initiate_transaction("237600000000", 1500)
PayPal is a widely used online payment platform for individuals and businesses.
-
File:
paypal_payment.py
-
Setup:
- Install PayPal SDK:
pip install paypalrestsdk
. - Configure PayPal client ID and secret.
- Install PayPal SDK:
-
Example Usage:
from paypal_payment import create_payment create_payment(50, "USD")
Paystack is a Nigerian payment gateway that makes it easy for businesses in Africa to accept payments.
-
File:
paystack_payment.py
-
Setup:
- Install requests:
pip install requests
. - Configure Paystack API key.
- Install requests:
-
Example Usage:
from paystack_payment import initialize_transaction initialize_transaction(10000, "NGN", "[email protected]")
Razorpay provides payment solutions for businesses to accept, process, and disburse payments.
-
File:
razorpay_payment.py
-
Setup:
- Install Razorpay SDK:
pip install razorpay
. - Configure Razorpay key ID and secret.
- Install Razorpay SDK:
-
Example Usage:
from razorpay_payment import create_order create_order(50000, "INR")
Square is a popular payment platform for accepting payments, managing invoices, and processing transactions.
-
File:
squareup_payment.py
-
Setup:
- Install Square SDK:
pip install squareup
. - Configure Square access token.
- Install Square SDK:
-
Example Usage:
from squareup_payment import create_payment create_payment(100, "USD", "nonce_from_card")
Stripe is a payment processor for online and in-person payments, supporting various currencies and payment methods.
-
File:
stripe_payment.py
-
Setup:
- Install Stripe SDK:
pip install stripe
. - Configure Stripe API key.
- Install Stripe SDK:
-
Example Usage:
from stripe_payment import charge_card charge_card(2000, "usd", "card_token")
- Clone the repository and navigate to the
payments
folder. - Install any required dependencies as mentioned in each section.
- Configure your credentials for each payment provider.
- Run the scripts to initiate transactions with the specified payment provider.
Contributions are welcome! If you’d like to add more payment providers or enhance existing implementations, please submit a pull request with a detailed description of your changes.