Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

GraphQL-60: Manage Stored Payment Methods #228

Closed

Conversation

pfantini
Copy link
Contributor

@pfantini pfantini commented Oct 29, 2018

Description

#60

  1. Create query to list customer payment tokens.
  2. Create mutation to add/delete payment token.
  3. Create functional test.

Manual testing scenarios

  1. Run the following request in GraphQL to get customer payment token list:
query {
  paymentTokens {
    public_hash
    payment_method_code
    type
    created_at
    expires_at
    details {
      code
      value
    }
  }
}
  1. Run the following request in GraphQL to add new payment token:
mutation {
  paymentTokenAdd(input: {
    public_hash : "5555555"
    payment_method_code: "braintree"
    type: card
    expires_at: "2020-01-01 23:59:59"
    gateway_token: "ABC-123"
    details: [
          {
            code: "type",
            value: "DI"
          },
          {
            code: "maskedCC",
            value: "9876"
          },
          {
            code: "expirationDate",
            value: "12/2020"
          }
        ]
  }) {
    public_hash
    payment_method_code
    type
    created_at
    expires_at
    details {
      code
      value
    }
  }
}
  1. Run the following request in GraphQL to delete payment token:
mutation {
  paymentTokenDelete(public_hash: "5555555")
}

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@pfantini pfantini changed the title 60 manage stored payment methods GraphQL-60: Manage Stored Payment Methods Oct 29, 2018
@YevSent
Copy link
Contributor

YevSent commented Oct 31, 2018

The current implementation of Checkout storefront doesn't use token id, the public hash is used instead. I would recommend avoiding the usage of entity id field.

Copy link
Contributor

@paliarush paliarush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfantini thanks for the contribution, please address review comments above.

@YevSent
Copy link
Contributor

YevSent commented Nov 6, 2018

I don't see the point to create GraphQL request to add a new token, most of the payment integrations allow storing the token after authorization transaction and the token might be received only in a server-server call.

Copy link
Contributor

@paliarush paliarush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfantini All changes after the initial CR look good, thank you.
Please address @joni-jones 's concern and we can merge this PR.

@pfantini pfantini force-pushed the 60-manage-stored-payment-methods branch from e3724aa to 28017ce Compare November 15, 2018 14:41
@naydav
Copy link
Contributor

naydav commented Feb 27, 2019

Functionality was merged with #330 and #307

@naydav naydav closed this Feb 27, 2019
@ghost
Copy link

ghost commented Feb 27, 2019

Hi @pfantini, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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

Successfully merging this pull request may close these issues.

5 participants