Skip to content

Commit b3ac9f1

Browse files
committed
feat: refund transaction
1 parent 256dab3 commit b3ac9f1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

kkiapay/core.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ def verify_transaction(self, transaction_id):
3737

3838
def refund_transaction(self, transaction_id):
3939
payload = {"transactionId": transaction_id}
40-
r = requests.post(self.revert_url, data=payload, headers=self.headers)
41-
return r.text
40+
r = requests.post(self.url, data=payload, headers=self.headers)
41+
42+
return json.loads(
43+
r.text,
44+
object_hook=lambda d: namedtuple("KkiapayTransaction", d.keys())(
45+
*d.values()
46+
),
47+
)
4248

4349
def setup_payout(self, options):
4450
r = requests.post(self.payout_url, data=options, headers=self.headers)

0 commit comments

Comments
 (0)