Skip to content

Commit 70c4f8c

Browse files
authored
Merge branch 'master' into master
2 parents b2e7e05 + 6975174 commit 70c4f8c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

kkiapay/core.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def __init__(self, public_key, private_key, secret, sandbox=False):
3434
def verify_transaction(self, transaction_id):
3535
self.url += "/api/v1/transactions/status"
3636
payload = {"transactionId": transaction_id}
37-
r = requests.post(self.url, data=payload, headers=self.headers)
37+
38+
try:
39+
r = requests.post(self.url, data=payload, headers=self.headers)
40+
except requests.exceptions.ConnectionError:
41+
return print('Sorry! There is a problem with your connection.')
3842

3943
return json.loads(
4044
r.text,
@@ -46,7 +50,11 @@ def verify_transaction(self, transaction_id):
4650
def refund_transaction(self, transaction_id):
4751
self.url += "/api/v1/transactions/revert"
4852
payload = {"transactionId": transaction_id}
49-
r = requests.post(self.url, data=payload, headers=self.headers)
53+
54+
try:
55+
r = requests.post(self.url, data=payload, headers=self.headers)
56+
except requests.exceptions.ConnectionError:
57+
return print('Sorry! There is a problem with your connection.')
5058

5159
return json.loads(
5260
r.text,

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Here's the plan for what's coming:
5858

5959
- [x] Sandbox and Live environments
6060
- [x] Verify Transaction
61-
- [x] Refund Transaction
61+
- [x] Refund Transaction - `Only available on Live`
6262
- [x] Schedule Payout
6363
- [ ] Add better errors and exceptions handling
6464
- [ ] Add tests.

0 commit comments

Comments
 (0)