Skip to content

Commit c9732f6

Browse files
cast error code to string
1 parent 1cf28ac commit c9732f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/compact-connect/lambdas/python/purchases/purchase_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def _handle_api_error(self, response: apicontractsv1.transactionResponse) -> Non
239239
if hasattr(response, 'transactionResponse') and hasattr(response.transactionResponse, 'errors'):
240240
error_code = response.transactionResponse.errors.error[0].errorCode
241241
error_message = response.transactionResponse.errors.error[0].errorText
242-
if error_code in AUTHORIZE_NET_CARD_USER_ERROR_CODES:
242+
if str(error_code) in AUTHORIZE_NET_CARD_USER_ERROR_CODES:
243243
logger.warning(logger_message, transaction_error_code=error_code, transaction_error_message=error_message)
244244
raise CCInvalidRequestException('Duplicate transaction detected for previously successful transaction.')
245245
logger.error(logger_message, transaction_error_code=error_code, transaction_error_message=error_message)

0 commit comments

Comments
 (0)