magento2
magento2 copied to clipboard
[GraphQl] Return full credit card type in the CustomerPaymentTokens query
Description (*)
This PR add possibitity return full credit card type and fix issue #32368 Query
query { customerPaymentTokens { items { details public_hash payment_method_code type } } }
Before
Braintree
{ "data": { "customerPaymentTokens": { "items": [ { "details": "{\"type\":\"VI\",\"maskedCC\":\"1111\",\"expirationDate\":\"09\\/2022\"}", "public_hash": "377c1514e0...", "payment_method_code": "braintree", "type": "card" } ] } } }
Payflow Pro
{ "data": { "customerPaymentTokens": { "items": [ { "details": "{\"cc_type\":\"AE\",\"cc_exp_year\":2023,\"cc_exp_month\":3,\"cc_last_4\":\"8431\"}", "public_hash": "27f7503a714aa77cbdc4ab25fc8eb29b182905e969974bea893bcf6b3d41a87c", "payment_method_code": "payflowpro", "type": "card" } ] } } }
Actual result
Braintree
{ "data": { "customerPaymentTokens": { "items": [ { "details": "{\"type\":\"Visa\",\"maskedCC\":\"1111\",\"expirationDate\":\"09\\/2022\"}", "public_hash": "377c1514e0...", "payment_method_code": "braintree", "type": "card" } ] } } }
Payflow Pro
{ "data": { "customerPaymentTokens": { "items": [ { "details": "{\"cc_type\":\"American Express\",\"cc_exp_year\":2023,\"cc_exp_month\":3,\"cc_last_4\":\"8431\"}", "public_hash": "27f7503a714aa77cbdc4ab25fc8eb29b182905e969974bea893bcf6b3d41a87c", "payment_method_code": "payflowpro", "type": "card" } ] } } }
Fixed Issues (if relevant)
- Fixes magento/magento2#32368
Hi @Usik2203. Thank you for your contribution Here are some useful tips how you can test your changes using Magento test environment. Add the comment under your pull request to deploy test or vanilla Magento instance:
-
@magento give me test instance
- deploy test instance based on PR changes -
@magento give me 2.4-develop instance
- deploy vanilla Magento instance
:exclamation: Automated tests can be triggered manually with an appropriate comment:
-
@magento run all tests
- run or re-run all required tests against the PR changes -
@magento run <test-build(s)>
- run or re-run specific test build(s) For example:@magento run Unit Tests
<test-build(s)>
is a comma-separated list of build names. Allowed build names are:
-
Database Compare
-
Functional Tests CE
-
Functional Tests EE
, -
Functional Tests B2B
-
Integration Tests
-
Magento Health Index
-
Sample Data Tests CE
-
Sample Data Tests EE
-
Sample Data Tests B2B
-
Static Tests
-
Unit Tests
-
WebAPI Tests
-
Semantic Version Checker
You can find more information about the builds here
:information_source: Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.
For more details, please, review the Magento Contributor Guide documentation.
:warning: According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento run Functional Tests B2B , Integration Tests
@magento run all tests
@magento run Functional Tests B2B , Functional Tests EE
@magento run Functional Tests B2B
No builds to run for your request.
@magento run all tests
@magento run Functional Tests EE
Hi @dmytro-ch, thank you for the review. ENGCOM-9051 has been created to process this Pull Request
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
@magento run all tests
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please message the #magento-devops slack channel if they don't show in a reasonable amount of time and a representative will look into any issues.
:heavy_check_mark: QA Passed
Preconditions:
- Install fresh Magento **
2.4-develop
Manual testing scenario:
- Configure Payflow Pro payment method with vault enabled from Magento Admin - Stores - Configuration - Sales - Payments methods - Paypal payflow pro.
- Front end - login as customer
- Add product to cart and make payment using credit card with use Save card option
- Generate graphql customer token using generateCustomerToken mutation
- Run the customerPaymentTokens query
Before: :heavy_multiplication_x:
After: :heavy_check_mark:
In the GraphQL response in the details section it is now appearing as Visa instead of VI.So now both UI and graphql response are consistent.
Builds are failed. Hence, moving this PR to Extended Testing.
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE
@magento run all tests
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, WebAPI Tests
@magento run all tests