From d05e5516be2085aa9e7ed77930314223cddb2aee Mon Sep 17 00:00:00 2001 From: TralahM Date: Thu, 8 Oct 2020 02:58:15 +0300 Subject: [PATCH] added option as an additional keyword argument to specify where on the clients server to receive the json callback from the intermediary server. --- setup.py | 2 +- tests/test_Vodacash_module.py | 5 ++++- vodacash/__init__.py | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index aa3e666..535629c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="vodacompay", - version="3.0", + version="3.0.1", author="Tralah M Brian", author_email="briantralah@gmail.com", description="A library to interface with vodacom's Payment System using an intermediary server.", diff --git a/tests/test_Vodacash_module.py b/tests/test_Vodacash_module.py index 2ea3376..736331b 100644 --- a/tests/test_Vodacash_module.py +++ b/tests/test_Vodacash_module.py @@ -11,6 +11,7 @@ def Vodacash_obj(): username="thirdpartyc2bw", password="thirdpartyc2bw", server_ip="64.225.75.98", + # server_ip="127.0.0.1", b2c_code="15058", c2b_code="8337", c2b_command_id="InitTrans_oneForallC2B", @@ -44,7 +45,9 @@ def test_vodacash_c2b_transaction(Vodacash_obj, printer): def test_vodacash_b2c_transaction(Vodacash_obj, printer): result = Vodacash_obj.b2c( - customer_msisdn="243814447581", amount="700", currency="CDF", + customer_msisdn="243814447581", + amount="700", + currency="CDF", ) printer(result) logger.debug(result) diff --git a/vodacash/__init__.py b/vodacash/__init__.py index ad2bf4c..4bf7938 100644 --- a/vodacash/__init__.py +++ b/vodacash/__init__.py @@ -162,6 +162,7 @@ def c2b( Amount to transact *Optional arguments* + client_callback_url: URL Where to receive json callback data. currency: The currency code default CDF @@ -207,6 +208,7 @@ def c2b( "serviceprovidercode": self.C2B_Number, "token": str(self.token), "callback_url": str(self.C2B_CB_URL), + "client_callback_url": kwargs.get("client_callback_url"), "command_id": self.C2B_CommandID, "callback_channel": self.Callback_Channel, "currency": currency, @@ -229,6 +231,7 @@ def b2c(self, customer_msisdn, amount, currency="CDF", *args, **kwargs): amount: Amount to transact Optional arguments: + client_callback_url: URL Where to receive json callback data. currency: The currency code default CDF @@ -268,6 +271,7 @@ def b2c(self, customer_msisdn, amount, currency="CDF", *args, **kwargs): "shortcode": self.B2C_Number, "token": str(self.token), "callback_url": str(self.B2C_CB_URL), + "client_callback_url": kwargs.get("client_callback_url"), "command_id": self.B2C_CommandID, "callback_channel": self.Callback_Channel, "serviceprovidername": self.ServiceProviderName,