Skip to content

Return full credit card type in the CustomerPaymentTokens query. #32368

Open
@github-jira-sync-bot

Description

@github-jira-sync-bot

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions