Created
December 14, 2020 19:46
-
-
Save siumhossain/9185d4c2a4a0151a2324ed35392086c1 to your computer and use it in GitHub Desktop.
Bring up amar pay track id from server post request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import re | |
| url = " https://sandbox.aamarpay.com/index.php" | |
| myobj ={ | |
| 'store_id':'aamarpaytest', | |
| 'tran_id':'a8r4yjrhkflndcjs4', | |
| 'success_url':'www.succes.com', | |
| 'fail_url':'www.fail.com', | |
| 'cancel_url':'www.fail.com', | |
| 'amount':'10', | |
| 'currency':'BDT', | |
| 'signature_key':'dbb74894e82415a2f7ff0ec3a97e4183', | |
| 'desc':'yes,pls', | |
| 'cus_name':'sakin', | |
| 'cus_email':'[email protected]', | |
| 'cus_add2':'Dhaka', | |
| 'cus_city':'dhaka', | |
| 'cus_postcode':'dhaka', | |
| 'cus_country':'Bangladesh', | |
| 'cus_phone':'01905555555' | |
| } | |
| x = requests.post(url, data = myobj) | |
| p=x.text | |
| #preg=re.compile(r'track=(.*)') | |
| preg=re.compile(r'track=.*') | |
| find=preg.search(p) | |
| x=find.group() | |
| print(x[:-2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment