Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core Gateway] Return error if status code != 200 #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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