Skip to content

Response struct should allow multiple tokens #127

@oyeb

Description

@oyeb

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions