Skip to content

Commit 88d875d

Browse files
committed
Add additional value params
1 parent 8f8449d commit 88d875d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ mypayment.set_customer_info(name='John Doe', email='[email protected]', address1
2121

2222
mypayment.set_shipping_info(shipping_to='demo customer', address='demo address', city='Dhaka', postcode='1209', country='Bangladesh')
2323

24+
# If you want to post some additional values
25+
mypayment.set_additional_values(value_a='[email protected]', value_b='portalcustomerid', value_c='1234', value_d='uuid')
26+
2427
response_data = mypayment.init_payment()
2528
```
2629

sslcommerz_python/payment.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SSLCSession(SSLCommerz):
3535
def __init__(self, sslc_is_sandbox=True, sslc_store_id='', sslc_store_pass='') -> None:
3636
super().__init__(sslc_is_sandbox, sslc_store_id, sslc_store_pass)
3737

38-
def set_urls(self, success_url: str, fail_url: str, cancel_url: str, ipn_url: str='') -> None:
38+
def set_urls(self, success_url: str, fail_url: str, cancel_url: str, ipn_url: str = '') -> None:
3939
self.integration_data['success_url'] = success_url
4040
self.integration_data['fail_url'] = fail_url
4141
self.integration_data['cancel_url'] = cancel_url
@@ -70,6 +70,12 @@ def set_shipping_info(self, shipping_to: str, address: str, city: str, postcode:
7070
self.integration_data['ship_postcode'] = postcode
7171
self.integration_data['ship_country'] = country
7272

73+
def set_additional_values(self, value_a: str = '', value_b: str = '', value_c: str = '', value_d: str = '') -> None:
74+
self.integration_data['value_a'] = value_a
75+
self.integration_data['value_b'] = value_b
76+
self.integration_data['value_c'] = value_c
77+
self.integration_data['value_d'] = value_d
78+
7379
def init_payment(self):
7480
post_url = self.sslc_session_api
7581
post_data = self.integration_data
@@ -155,4 +161,4 @@ def key_check(data_dict, check_key):
155161

156162
@staticmethod
157163
def sort_keys(data_dict):
158-
return [(key, data_dict[key]) for key in sorted(data_dict.keys())]
164+
return [(key, data_dict[key]) for key in sorted(data_dict.keys())]

0 commit comments

Comments
 (0)