From bdd7921bc0511157b41594918e4dca7771133014 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Wed, 29 Dec 2021 19:21:05 +0000 Subject: [PATCH] Implement releasing funds --- handler/agora.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/handler/agora.py b/handler/agora.py index c82ec9e..b91ab98 100644 --- a/handler/agora.py +++ b/handler/agora.py @@ -283,4 +283,16 @@ class Agora(object): rtrn = self.create_ad(countrycode, currency) if not rtrn: return False - return True + yield rtrn + + def release_funds(self, contact_id): + """ + Release funds for a contact_id. + :param contact_id: trade/contact ID + :type contact_id: string + :return: response dict + :rtype: dict + """ + payload = {"tradeId": contact_id, "password": settings.Agora.Pass} + rtrn = self.agora._api_call(api_method=f"contact_release/{contact_id}", http_method="POST", query_values=payload) + return rtrn