From d70710afe68cc68abdcdec68948e198267c15ebd Mon Sep 17 00:00:00 2001 From: Domenico Date: Mon, 13 May 2024 11:17:09 +0200 Subject: [PATCH] tweaks (#3856) --- .../hct_mis_api/apps/payment/services/payment_gateway.py | 8 ++++---- backend/hct_mis_api/config/env.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/hct_mis_api/apps/payment/services/payment_gateway.py b/backend/hct_mis_api/apps/payment/services/payment_gateway.py index 155daf63f1..8551c5683d 100644 --- a/backend/hct_mis_api/apps/payment/services/payment_gateway.py +++ b/backend/hct_mis_api/apps/payment/services/payment_gateway.py @@ -117,7 +117,7 @@ def get_payload(self, obj: Payment) -> Dict: destination_currency: str # "USD" """ return { - "amount": int(obj.entitlement_quantity * 100), + "amount": obj.entitlement_quantity, "phone_no": str(obj.collector.phone_no), "last_name": obj.collector.family_name, "first_name": obj.collector.given_name, @@ -145,7 +145,8 @@ class PaymentRecordData(FlexibleArgumentsDataclassMixin): parent: str status: str hope_status: str - extra_data: dict + auth_code: str + payout_amount: float fsp_code: str message: Optional[str] = None @@ -391,7 +392,7 @@ def update_payment( _payment.reason_for_unsuccessful_payment = matching_pg_payment.message update_fields.append("reason_for_unsuccessful_payment") - delivered_quantity = matching_pg_payment.extra_data.get("delivered_quantity", None) + delivered_quantity = matching_pg_payment.payout_amount if _payment.status in [ Payment.STATUS_SUCCESS, Payment.STATUS_DISTRIBUTION_SUCCESS, @@ -399,7 +400,6 @@ def update_payment( ]: update_fields.extend(["delivered_quantity", "delivered_quantity_usd"]) try: - delivered_quantity = int(delivered_quantity) / 100 _payment.delivered_quantity = delivered_quantity _payment.delivered_quantity_usd = get_quantity_in_usd( amount=Decimal(delivered_quantity), diff --git a/backend/hct_mis_api/config/env.py b/backend/hct_mis_api/config/env.py index aef3ca842b..4c291e862c 100644 --- a/backend/hct_mis_api/config/env.py +++ b/backend/hct_mis_api/config/env.py @@ -102,7 +102,7 @@ ), "MATOMO_TRACKER_URL": ( str, - "", + "https://unisitetracker.unicef.io/", ), "MATOMO_SCRIPT_URL": ( str,