1
1
from sslcommerz_python_api import SSLCSession
2
2
from decimal import Decimal
3
3
4
+
4
5
def response ():
5
- mypayment = SSLCSession (sslc_is_sandbox = True , sslc_store_id = 'your_sslc_store_id' , sslc_store_pass = 'your_sslc_store_passcode' )
6
- mypayment .set_urls (success_url = 'example.com/success' , fail_url = 'example.com/failed' , cancel_url = 'example.com/cancel' , ipn_url = 'example.com/payment_notification' )
7
- mypayment .set_product_integration (total_amount = Decimal ('20.20' ), currency = 'BDT' , product_category = 'clothing' , product_name = 'demo-product' , num_of_item = 2 , shipping_method = 'YES' , product_profile = 'None' )
8
- mypayment .
set_customer_info (
name = 'John Doe' ,
email = '[email protected] ' ,
address1 = 'demo address' ,
address2 = 'demo address 2' ,
city = 'Dhaka' ,
postcode = '1207' ,
country = 'Bangladesh' ,
phone = '01711111111' )
9
- mypayment .set_shipping_info (shipping_to = 'demo customer' , address = 'demo address' , city = 'Dhaka' , postcode = '1209' , country = 'Bangladesh' )
10
- # If you want to post some additional values
11
- mypayment .
set_additional_values (
value_a = '[email protected] ' ,
value_b = 'portalcustomerid' ,
value_c = '1234' ,
value_d = 'uuid' )
12
- return mypayment .init_payment ()
6
+ mypayment = SSLCSession (sslc_is_sandbox = True , sslc_store_id = 'your_sslc_store_id' ,
7
+ sslc_store_pass = 'your_sslc_store_passcode' )
8
+ mypayment .set_urls (success_url = 'example.com/success' , fail_url = 'example.com/failed' ,
9
+ cancel_url = 'example.com/cancel' , ipn_url = 'example.com/payment_notification' )
10
+ mypayment .set_product_integration (total_amount = Decimal ('20.20' ), currency = 'BDT' , product_category = 'clothing' ,
11
+ product_name = 'demo-product' , num_of_item = 2 , shipping_method = 'YES' , product_profile = 'None' )
12
+ mypayment .
set_customer_info (
name = 'John Doe' ,
email = '[email protected] ' ,
address1 = 'demo address' ,
13
+ address2 = 'demo address 2' , city = 'Dhaka' , postcode = '1207' , country = 'Bangladesh' , phone = '01711111111' )
14
+ mypayment .set_shipping_info (shipping_to = 'demo customer' , address = 'demo address' ,
15
+ city = 'Dhaka' , postcode = '1209' , country = 'Bangladesh' )
16
+ # If you want to post some additional values
17
+ mypayment .set_additional_values (
18
+ value_a = '[email protected] ' ,
value_b = 'portalcustomerid' ,
value_c = '1234' ,
value_d = 'uuid' )
19
+ return mypayment .init_payment ()
20
+
13
21
14
22
def test_response ():
15
- assert test_response is not None
23
+ assert test_response is not None
0 commit comments