-
Notifications
You must be signed in to change notification settings - Fork 52
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
Redesign Response struct #1
Comments
pkrawat1
added
severity: high
hotlist: core-team
effort1: easy(hours)
and removed
severity: low
labels
Dec 21, 2017
@aviabird/all I'm reviving this issue, we've stashed it since way too long. |
oyeb
changed the title
Response module is not being used currently
Redesign Response struct
Jan 15, 2018
ashish173
pushed a commit
that referenced
this issue
Apr 22, 2018
* Fixes #1: Introducing `Response.t` with docs * [monei] Adapted for new `Response.t` * Refactored `commit`, `respond` for readability * [monei] Updated test cases * Corrected specs * [bogus] Adapted for Response.t
ashish173
pushed a commit
that referenced
this issue
Apr 22, 2018
* Fixes #1: Introducing `Response.t` with docs * [monei] Adapted for new `Response.t` * Refactored `commit`, `respond` for readability * [monei] Updated test cases * Corrected specs * [bogus] Adapted for Response.t
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current state of
Response
We can add arbitrary fields in a
Response
thanks toResponse.new()
.:success
:authorization
:status_code
:error_code
:message
:avs_result
tuple
of string{address_status, zip_code_status}
:cvc_result
:params
Improvements
:success
field seems redundant as all API calls return the usual{:ok, Response}
or{:error, Response}
:id
instead of:authorization
IMO.:token
(:authorization
is also fine).:ok
and:error
, but we could,:ok
,:error
,:declined
,:invalid
, etc.:ok
and:error
tuples, but also add areason
orerror_reason
field:"reason"
is the error msg string returned by the gateway.:params
to:raw
{:html, String.t}
,{:json, Map.t}
(already decoded),{:xml, ??}
:avs_result
is a tuple, a map would be better as the keys would be explicit,TL;DR
New definition:
:success
:authorization
id
:token
:status_code
:http_code
:error_code
:gateway_code
:reason
{:tag, string}
nil
otherwise) tags like:server_error
,:fraud_risk
,:avs_invalid
:message
:avs_result
%{address: string, zip_code: string}
:cvc_result
:params
:raw
{:tag, string}
,
{:json, map}`The text was updated successfully, but these errors were encountered: