magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

Return full credit card type in the CustomerPaymentTokens query.

Open github-jira-sync-bot opened this issue 3 years ago • 10 comments

While working on PWA-636 we realized that the CustomerPaymentTokens query is not returning the whole credit card type. For instance it returns VI which equates to VISA. Right now we are maintaining a mapper on the UI for codes and their respective full card types enumerated from https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js . It works but I am creating this feature request ticket to see if you guys can return the full type as well. If the UI is maintaining such a mapper, every-time a new type gets added or removed from the list, we need to publish a new change. It would be helpful if the GQL query returned that details.

Steps to reproduce  1. Configure Payflow Pro payment method with vault enabled from Magento Admin - Stores - Configuration - Sales - Payments methods - Paypal payflow pro.  2. Front end - login as customer  3. Add product to cart and make payment using credit card with use Save card option  4. Generate graphql customer token using generateCustomerToken mutation  5. Run the customerPaymentTokens query

Expected behavior UI and GraphQL behavior should be consistent.

Actual result card type displayed in the graphql response is not understandable. type: "card" is displayed in Graphql response. On UI - under Payment information: Credit Card and card type displayed as VISA

github-jira-sync-bot avatar Mar 04 '21 16:03 github-jira-sync-bot