Welcome to VodaComPay’s documentation!¶
-
class
vodacash.
Vodacash
(username, password, server_ip='167.71.65.114', b2c_code='15058', c2b_code='8337', c2b_command_id='InitTrans_oneForallC2B', b2c_command_id='InitTrans_one4allb2c', callback_channel='2', serviceprovidername='ONE4ALL', language='EN', *args, **kwargs)[source]¶ Bases:
object
Create A Vodacash Object to be Used throughout your API Interaction
Arguments
- username:
- Username as provided by Vodacash Team
- password:
- Password as provided by Vodacash Team
- server_ip:
- Your whitelisted server IP,domain name where the intermediary server is deployed.
- b2c_code:
- Your B2C code as provided by Vodacom default=”15058”,
- c2b_code:
- Your C2B code as provided by Vodacom default=”8337”,
- c2b_command_id:
- Your C2B CommandID as provided default=”InitTrans_oneForallC2B”,
- b2c_command_id:
- Your B2C CommandID as provided default=”InitTrans_one4allb2c”,
- callback_channel:
- Your callback channel default=”2” for http url
- serviceprovidername:
- Your Provided ServiceProviderName default=”ONE4ALL”,
- language:
- Your chosen language default=”EN”,
-
authenticate
()[source]¶ Obtains and sets an authentication token by authenticating against the Vodacom UATG payment gateway.
-
b2c
(customer_msisdn, amount, currency='CDF', *args, **kwargs)[source]¶ - Takes:
- customer_msisdn:
- Customer PhoneNumber
- amount:
- Amount to transact
- Optional arguments:
client_callback_url: URL Where to receive json callback data. currency:
The currency code default CDF
And Returns a dict object like:
{ "Amount": "100", "CallBackChannel": "2", "CallBackDestination": "http://XX.XX.XX.XX/api/v1/b2c_callback", "CommandID": "InitTrans_one4allb2c", "Currency": "CDF", "CustomerMSISDN": "243800000000", "Insight_txid": "ilu6sebgpdrj68t2d9vqrd7c0gceelgs", "Language": "EN", "ResponseCode": "0", "ServiceProviderName": "ONE4ALL", "Shortcode": "15058", "ThirdPartyReference": "R20200727212753", "TransactionDateTime": "20200727182753", "code": "3", "description": "Processed", "detail": "Processed", "event_id": "12001" }
-
c2b
(customer_msisdn, amount, currency='CDF', initials='BMB', surname='BetModenge', *args, **kwargs)[source]¶ Required Arguments
- customer_msisdn:
- Customer PhoneNumber
- amount:
- Amount to transact
- Optional arguments
client_callback_url: URL Where to receive json callback data.
- currency:
- The currency code default CDF
- initials:
- The Business Initials default BMB
- surname:
- The Business Surname default BetModenge
And Returns a dict object like:
{ "Amount": "100", "CallBackChannel": "2", "CallBackDestination": "http://XX.XXX.XX.XX/api/v1/c2b_callback", "CommandId": "InitTrans_oneForallC2B", "Currency": "CDF", "CustomerMSISDN": "243800000000", "Date": "20200727182755", "Initials": "TMB", "InsightReference": "AB7158AA732221F8E054002128FBA42E", "Language": "EN", "ResponseCode": "0", "ServiceProviderCode": "8337", "Surname": "Surname", "ThirdPartyReference": "R20200727212755", "code": "3", "description": "Processed", "detail": "Processed", "event_id": "80049" }