Skip to content

Commit 84a2112

Browse files
committed
order id should be max 20 chars, handle succesfull spelling
1 parent 7a19ee2 commit 84a2112

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

corehq/apps/integration/payments/services.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def _get_transfer_details(payee_case: CommCareCase, config: MoMoConfig):
230230
pin=settings.ORANGE_CAMEROON_API_CREDS['channel_pin'],
231231
amount=case_json.get(PaymentProperties.AMOUNT),
232232
subscriberMsisdn=case_json.get(PaymentProperties.PHONE_NUMBER),
233-
orderId=case_json.get(PaymentProperties.USER_OR_CASE_ID),
233+
orderId=payee_case.case_id[:20],
234234
description=case_json.get(PaymentProperties.PAYER_MESSAGE),
235235
)
236236
else:
@@ -439,8 +439,11 @@ def make_orange_cameroon_payment_status_request(reference_id, config):
439439

440440

441441
def _get_status_details(status, error_code=None):
442+
# Orange Cameroon API returns 'successfull' instead of 'successful'
443+
if status == 'successfull':
444+
status = PaymentStatus.SUCCESSFUL
442445
# Just a future proofing measure in case API returns an unexpected status value
443-
if status not in (
446+
elif status not in (
444447
PaymentStatus.SUCCESSFUL,
445448
PaymentStatus.FAILED,
446449
PaymentStatus.PENDING_PROVIDER,

0 commit comments

Comments
 (0)