magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

[GraphQl] Return full credit card type in the CustomerPaymentTokens query

Open Usik2203 opened this issue 3 years ago • 16 comments

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)

  1. Fixes magento/magento2#32368

Usik2203 avatar Apr 14 '21 13:04 Usik2203

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:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. 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

m2-assistant[bot] avatar Apr 14 '21 13:04 m2-assistant[bot]

@magento run Functional Tests B2B , Integration Tests

dmytro-ch avatar Apr 16 '21 11:04 dmytro-ch

@magento run all tests

Usik2203 avatar Apr 26 '21 12:04 Usik2203

@magento run Functional Tests B2B , Functional Tests EE

dmytro-ch avatar Apr 26 '21 15:04 dmytro-ch

@magento run Functional Tests B2B

dmytro-ch avatar Apr 27 '21 07:04 dmytro-ch

No builds to run for your request.

@magento run all tests

dmytro-ch avatar Apr 27 '21 10:04 dmytro-ch

@magento run Functional Tests EE

dmytro-ch avatar Apr 27 '21 14:04 dmytro-ch

Hi @dmytro-ch, thank you for the review. ENGCOM-9051 has been created to process this Pull Request

magento-engcom-team avatar Apr 27 '21 18:04 magento-engcom-team

@magento run all tests

engcom-Lima avatar Jul 21 '23 09:07 engcom-Lima

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

engcom-Lima avatar Aug 25 '23 06:08 engcom-Lima

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

engcom-Delta avatar Dec 11 '23 16:12 engcom-Delta

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:

  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

Before: :heavy_multiplication_x: 

Screenshot 2023-12-12 at 3 17 35 PM Screenshot 2023-12-12 at 12 48 10 PM Screenshot 2023-12-12 at 11 29 02 AM

After: :heavy_check_mark:  

Screenshot 2023-12-12 at 3 17 35 PM Screenshot 2023-12-12 at 3 18 00 PM Screenshot 2023-12-12 at 3 13 05 PM Screenshot 2023-12-12 at 3 18 13 PM Screenshot 2023-12-12 at 3 13 15 PM

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.

engcom-Delta avatar Dec 12 '23 09:12 engcom-Delta

@magento run all tests

engcom-Charlie avatar Jul 03 '24 10:07 engcom-Charlie

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

engcom-Charlie avatar Jul 04 '24 08:07 engcom-Charlie

@magento run all tests

engcom-Charlie avatar Jul 04 '24 14:07 engcom-Charlie

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, WebAPI Tests

engcom-Charlie avatar Jul 05 '24 06:07 engcom-Charlie

@magento run all tests

engcom-Charlie avatar Jul 05 '24 09:07 engcom-Charlie