Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PaypalExpressToken resolver to use correct input from GraphQL Schema. #35050

Merged

Conversation

liamjtoohey
Copy link
Contributor

@liamjtoohey liamjtoohey commented Feb 1, 2022

Description (*)

Update PaypalExpressToken resolver to use correct input from GraphQL Schema. Currently, adding the use_paypal_credit input defined in etc/schema.graphqls to createPaypalExpressToken requests does nothing, as the code is incorrectly checking for the presence of paypal_credit rather than use_paypal_credit.

Input defined in schema:

Manual testing scenarios (*)

  • Make request to createPaypalExpressToken mutation via GraphQL
  • Ensure use_paypal_credit field in request is set to true
  • From the mutation response, navigate to the start URL returned in the paypal_urls output
  • See that user is navigated to PayPal credit checkout - not standard PayPal checkout.

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)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Update PaypalExpressToken resolver to use correct input from GraphQL Schema. #35180: Update PaypalExpressToken resolver to use correct input from GraphQL Schema.

Update PaypalExpressToken resolver to use correct input from GraphQL Schema.
@m2-assistant
Copy link

m2-assistant bot commented Feb 1, 2022

Hi @liamjtoohey. 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

❗ 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

ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.

For more details, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@convenient
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@convenient
Copy link
Contributor

@magento run WebAPI Tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@bgorski bgorski self-requested a review February 1, 2022 19:00
Copy link
Contributor

@bgorski bgorski left a comment

Choose a reason for hiding this comment

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

Looks good - thank you for your contribution @liamjtoohey!

@magento-engcom-team
Copy link
Contributor

Hi @bgorski, thank you for the review.
ENGCOM-9395 has been created to process this Pull Request
✳️ @bgorski, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@bgorski bgorski added Award: bug fix Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests labels Feb 1, 2022
@sdzhepa sdzhepa added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Mar 10, 2022
@m2-community-project m2-community-project bot removed this from Ready for Testing in Pull Requests Dashboard Mar 10, 2022
@engcom-Alfa engcom-Alfa self-assigned this Mar 11, 2022
@engcom-Alfa engcom-Alfa moved this from Ready for Testing to Testing in Progress in High Priority Pull Requests Dashboard Mar 11, 2022
@engcom-Alfa
Copy link
Contributor

engcom-Alfa commented Mar 11, 2022

✔️ QA Passed

Preconditions:

  1. Have Magento latest instance installed
  2. Have Paypal express checkout configured in the admin side.
  3. Make sure to have a valid customer login.

Manual testing scenario:

  1. Request customer token using GraphQL request followed by create a cart and add product to the cart.

  2. Set billing and shipping addresses thru GraphQL requests and also set the Shipping mode.

  3. Request the below GraphQL mutation and check the paypal start url from the response.
    mutation { createPaypalExpressToken( input: { cart_id: "{{CustomerCart}}" code: "paypal_express" express_button: true use_paypal_credit: true urls: { return_url: "paypal/action/return.html" cancel_url: "paypal/action/cancel.html" } } ) { token paypal_urls { start edit } } }

Before: ✖️ With a valid Paypal login, the URL was redirecting to the below screenshot page.
image

After: ✔️ With a valid Paypal login, the URL is getting redirected to the below screenshot page.
image

Additional scenarios tested:

  1. Changed the request parameter value to use_paypal_credit: false and checked if the URL is again redirected to Paypal balance than the Credit page.
  2. Removed the use_paypal_credit paramater completely from the request, and checked if the URL is again redirected to Paypal balance than the Credit page.

@cpartica
Kindly cross verify and approve this PR since it is relevant to GraphQL, and accordingly move it to Merge In Progress.
Thanks

@engcom-Alfa engcom-Alfa moved this from Testing in Progress to To Approve in High Priority Pull Requests Dashboard Mar 11, 2022
@engcom-Alfa
Copy link
Contributor

@magento create issue

@cpartica
Copy link
Contributor

Approved. Please go ahead with the PR

@engcom-Alfa engcom-Alfa moved this from To Approve to Merge in Progress in High Priority Pull Requests Dashboard Apr 14, 2022
@magento-devops-reposync-svc magento-devops-reposync-svc merged commit f2c289b into magento:2.4-develop May 18, 2022
@liamjtoohey liamjtoohey deleted the patch-1 branch May 18, 2022 14:16
@ishakhsuvarov ishakhsuvarov moved this from Merge in Progress to Recently Merged in High Priority Pull Requests Dashboard May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: bug fix Component: PaypalGraphQl Partner: Ampersand partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Update PaypalExpressToken resolver to use correct input from GraphQL Schema.
9 participants