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

Response struct should allow multiple tokens #127

Open
10 tasks
oyeb opened this issue Mar 20, 2018 · 1 comment
Open
10 tasks

Response struct should allow multiple tokens #127

oyeb opened this issue Mar 20, 2018 · 1 comment
Milestone

Comments

@oyeb
Copy link
Contributor

oyeb commented Mar 20, 2018

Motivation

To complete a single transaction (say, authorization) with some gateways, various tokens need to be created like customer_token, card_token, session_token, etc. Some tokens expire, some don't and we should return these tokens to the caller for possible re-use.

Proposed Solution

Rename the token field to tokens of the type: keyword.

If the following tokens are generated during an authorization: customer_token, card_token, then they can be returned like so:

%Response{
  ...
  tokens: [customer: "customer_token", card: "card-token"]
}

Todo

  • Make the requested change in response.ex
  • Update docs in response.ex
  • Fix tests that break due to this change.
  • Review affect of this new functionality for:
    • CAMS
    • Monei
    • Trexle
    • AuthorizeNet
    • Paymill
    • GlobalCollect
@oyeb oyeb added this to the 1.1.x milestone Jun 4, 2018
@barthr
Copy link
Contributor

barthr commented Oct 25, 2018

Should the value of tokens be a keyword list? I suppose those keys are unique. I think maybe a map would be more sufficient. Anyway, I could tackle this issue if no one else is working on it!

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

No branches or pull requests

2 participants