Skip to content

Conversation

@mychaelgo
Copy link
Contributor

Here i want to propose returning error message in err instead of nil if status_code != 200 in core gateway

@rizdaprasetya please review

@rizdaprasetya
Copy link
Contributor

Hi @mychaelgo thanks, but not sure about this one, because status_code other than 200, can also be considered as success. Like 201 is for successfully created transaction, but the transaction is in pending state and need further payment from customer, in case of Bank Transfer, Gopay, etc.

Also API may response 406 if order_id is duplicated, but it means the API call is success, but the request contains invalid data. So it is not entirely error state.

@mychaelgo
Copy link
Contributor Author

@rizdaprasetya hm okay, so for example i want to change status transaction to expired.
the approach to check wether the transaction is success changed to expire or not based on what?

@rizdaprasetya
Copy link
Contributor

In that case you should refer to the response body "transaction_status": "expire"

or the "status_code": "407" (only if needed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants