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

PayPal Subscription initiated without a WooCommerce order (2415) #1907

Conversation

pedrosilva-pt
Copy link
Contributor

PR Description

This PR adds a reusable validateCheckoutForm function and uses in on subscription product order creation.

Issue Description

User reported that one of their clients bought a subscription through PayPal subscriptions and a WC order ID was not created. The logs show that for PayPal subscriptions involve using the PayPal API at https://api-m.paypal.com/v2/checkout/orders/*ORDERID*. This action happens three times as seen in the logs.

Steps To Reproduce

  • set up subscription with connection to PayPal
  • add it to cart & navigate to Checkout page
  • leave out any required field, like the terms checkbox or name
  • click the PayPal button
  • observe no form field validation
  • confirm PayPal payment in poup window
  • observe WooCommerce error message about missing fields
  • fill missing fields
  • click PayPal button again to confirm order
  • observe the user now has two active PayPal Subscriptions

Expected behaviour

The checkout form fields are validated with the early wc validation when clicking the PayPal button.

Possible cause

The early wc validation does not trigger when the buyer attempts the payment from the Checkout page.

Suggested solution

Implement early WC validation when clicking the button for a PayPal Subscriptions from the Checkout page.

@InpsydeNiklas InpsydeNiklas added this to the 2.4.3 milestone Dec 15, 2023
@InpsydeNiklas InpsydeNiklas merged commit 886a680 into trunk Dec 15, 2023
14 checks passed
@InpsydeNiklas InpsydeNiklas deleted the PCP-2415-pay-pal-subscription-initiated-without-a-woo-commerce-order branch December 15, 2023 17:07
@Dinamiko Dinamiko mentioned this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants