Skip to content

Commit 7a19ee2

Browse files
committed
nit: add response error if available when payment request fails
1 parent f7729cd commit 7a19ee2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

corehq/apps/integration/payments/services.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def request_payment(payment_case: CommCareCase, config: MoMoConfig):
7777
PaymentProperties.PAYMENT_ERROR: PaymentStatusErrorCode.PAYMENT_REQUEST_ERROR,
7878
PaymentProperties.PAYMENT_STATUS: PaymentStatus.REQUEST_FAILED,
7979
})
80-
details = _get_notify_error_details(config.domain, payment_case.case_id, str(e))
80+
error = e.response.text if hasattr(e, 'response') else str(e)
81+
details = _get_notify_error_details(config.domain, payment_case.case_id, error)
8182
notify_error("[MoMo Payments] Request error occurred while making payment", details=details)
8283
except Exception as e:
8384
# We need to know when anything goes wrong

0 commit comments

Comments
 (0)