Mobile payments integrations made easy.
Project description
Mobile Payments
An easy way to integrate mobile payments into your web project.
Installation
pip install mobile-payments
Prerequisites
Python 3.6+
Examples
Customer to Business payment via vodacom m-pesa
# vodacom M-PESA
from mobile_payments.vodacom import MPESA
api_key = '<your-api-key>'
public_key = '<open-api-public-key>'
m_pesa = MPESA(api_key=api_key, public_key=public_key)
# Customer to Business payment
parameters = {
'input_Amount': 10, # amount to be charged
'input_Country': 'TZN',
'input_Currency': 'TZS',
'input_CustomerMSISDN': '000000000001',
'input_ServiceProviderCode': '000000',
'input_ThirdPartyConversationID': 'c9e794e10c63479992a8b08703abeea36',
'input_TransactionReference': 'T23434ZE3',
'input_PurchasedItemsDesc': 'Shoes',
}
response = m_pesa.c2b(parameters)
Sample response
'body': {'output_ResponseCode': 'INS-0',
'output_ResponseDesc': 'Request processed successfully',
'output_TransactionID': '79eKKNrYVfCj',
'output_ConversationID': 'c9e794e10c63479992a8b08703abeea36', 'output_ThirdPartyConversationID': 'asv02e5958774f7ba228d83d0d689761'}
License
Code released under MIT LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mobile-payments-0.1.1.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for mobile_payments-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da563d7a735f4fd61e53602e4358bbf34e49f6b30d49ae7244ec335fa3a597d4 |
|
MD5 | 900ad94b0f1d5070529ea9925c9eb383 |
|
BLAKE2b-256 | 1b5248b1c41ee20e0ff628afe95928ec9a2e51518437d08ad29b5b39619caf55 |