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

Return response from SnappPay::eligible #255

Merged

Conversation

amirzpr
Copy link
Contributor

@amirzpr amirzpr commented Aug 11, 2024

Currently, all SnappPay endpoints except /oauth/token have a specific JSON structure in their response as below:

{
    "response": {},
    "successful": true
}

The SnappPay driver implemented in this project has followed this structure and is checking the successful boolean property first (throwing an exception if it's false), then returning the response property as result in all public methods. But this convention has been ignored in the eligible method. The successful property check is absent, and it's returning the entire json body instead of the response property.

I submitted this PR to follow the same convention for returning results in all public methods. I am aware that this change may introduce a breaking change, so please let me know how you handle these kind of inconsistencies.

@khanzadimahdi khanzadimahdi merged commit c7bf2e8 into shetabit:master Aug 12, 2024
2 checks passed
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