Skip to content

Commit

Permalink
tweaks (#3855)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Romaniak <[email protected]>
  • Loading branch information
domdinicola and johniak authored May 13, 2024
1 parent abb45d3 commit 464fc01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions backend/hct_mis_api/apps/payment/services/payment_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -391,15 +392,14 @@ 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,
Payment.STATUS_DISTRIBUTION_PARTIAL,
]:
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),
Expand Down
2 changes: 1 addition & 1 deletion backend/hct_mis_api/config/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
),
"MATOMO_TRACKER_URL": (
str,
"",
"https://unisitetracker.unicef.io/",
),
"MATOMO_SCRIPT_URL": (
str,
Expand Down

0 comments on commit 464fc01

Please sign in to comment.