Skip to content

Commit 17777db

Browse files
Mock payment chagnes
1 parent 011adaf commit 17777db

4 files changed

Lines changed: 29 additions & 21 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ This package helps you work with Setu's deeplink APIs.
88
from setu import deeplink
99
1010
dl = deeplink.Deeplink(
11-
"262c5ab6-60d9-464e-a584-af008a8d0437", // SchemeId
12-
"e056f034-9da3-47e6-ba84-6cd16ccce6a3", // Secret
13-
"378992706761786990", // Product instance ID
11+
"random-uuid-here", // SchemeId
12+
"another-uuid-here", // Secret
13+
"123123123123123", // Product instance ID
1414
)
1515
link = dl.generate_link(2300, 4, "gb", "1231243")
1616
print(link["paymentLink"], link["platformBillID"])

build/lib/setu/deeplink.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ def check_status(self, platformBillID=None):
6161
def mock_payment(self, amount, upiId):
6262
path = "/triggers/funds/addCredit"
6363
payload = {
64-
"amount": 0,
65-
"destinationAccount": {"accountID": 'Biller-66147538470438-001', "ifsc": "EXTERNALBRANCH001"},
66-
"sourceAccount": {"accountID": "123123123", "ifsc": "1231231"},
64+
"amount": amount,
65+
"destinationAccount": {"accountID": upiId},
66+
"sourceAccount": {"accountID": "customer@vpa"},
6767
"type": "UPI",
6868
}
6969

7070
headers = generate_setu_headers(
7171
self.schemeId, self.secret, self.productInstance
7272
)
73-
print("Coming soon!")
74-
# response = requests.post(self.url + path,json=payload, headers=headers)
75-
# data= response.json()
76-
# print('mock----',data)
73+
response = requests.post(self.url + path, json=payload, headers=headers)
74+
if response.status_code != 200:
75+
raise Exception("Failed to mock payment", )
76+
return "Mock success"

setu/deeplink.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ def check_status(self, platformBillID=None):
6161
def mock_payment(self, amount, upiId):
6262
path = "/triggers/funds/addCredit"
6363
payload = {
64-
"amount": 0,
65-
"destinationAccount": {"accountID": 'Biller-66147538470438-001', "ifsc": "EXTERNALBRANCH001"},
66-
"sourceAccount": {"accountID": "123123123", "ifsc": "1231231"},
64+
"amount": amount,
65+
"destinationAccount": {"accountID": upiId},
66+
"sourceAccount": {"accountID": "customer@vpa"},
6767
"type": "UPI",
6868
}
6969

7070
headers = generate_setu_headers(
7171
self.schemeId, self.secret, self.productInstance
7272
)
73-
print("Coming soon!")
74-
# response = requests.post(self.url + path,json=payload, headers=headers)
75-
# data= response.json()
76-
# print('mock----',data)
73+
response = requests.post(self.url + path, json=payload, headers=headers)
74+
if response.status_code != 200:
75+
raise Exception("Failed to mock payment", )
76+
return "Mock success"

setup.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
import pathlib
12
from setuptools import setup
23

4+
HERE = pathlib.Path(__file__).parent
5+
6+
README = (HERE / "README.md").read_text()
7+
38
setup(name='setu',
4-
version='0.2',
5-
description='Setu\'s deeplink pckage',
6-
url='https://gitlab.com/setu-lobby/setu-pypi',
7-
author='GB',
9+
version='0.4.1',
10+
url='https://gitlab.com/setu-lobby/seu-pypi',
11+
author='Gandharva B',
812
author_email='gandharva@setu.co',
13+
description="Setu's own SDK for faster integration",
14+
long_description=README,
15+
long_description_content_type="text/markdown",
916
license='MIT',
17+
install_requires=["requests", "uuid", "PyJWT"],
1018
packages=['setu'],
1119
zip_safe=False)

0 commit comments

Comments
 (0)