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 Subscriptions API renewal order not created in WooCommerce (3677) #2612

Conversation

Dinamiko
Copy link
Contributor

@Dinamiko Dinamiko commented Sep 17, 2024

This PR introduces time based logic as a fallback when for some reason subscription _ppcp_is_subscription_renewal meta is not saved when receiving the first PAYMENT.SALE.COMPLETED webhook (for parent order).

Steps to reproduce

  • Go to “Standard Payments” tab and set “Subscriptions Mode” to “PayPal Subscriptions”
  • Create and connect a WC Subscriptions product
  • Purchase the subscription

(Developer only) Manually trigger a PAYMENT.SALE.COMPLETED webhook

  • Disable webhook verification:
    <?php const PAYPAL_WEBHOOK_REQUEST_VERIFICATION = false;
  • From subscription get ppcp_subscription meta and pass it as billing_agreement_id in the following request:
POST /wp-json/paypal/v1/incoming

{
    "id": "NOT-IMPORTANT",
    "event_type": "PAYMENT.SALE.COMPLETED",
    "resource": {
        "billing_agreement_id": "I-SVB40C9F6XL5",
        "id": "NOT-IMPORTANT"
    }
}

By following the above steps a developer could delete subscription _ppcp_is_subscription_renewal meta and trigger the webhook to see if the time based logic is executed correctly when no meta exist.

@Dinamiko Dinamiko marked this pull request as ready for review September 23, 2024 07:43
@InpsydeNiklas InpsydeNiklas added this to the 2.9.3 milestone Oct 3, 2024
@Dinamiko Dinamiko merged commit ff14d98 into trunk Oct 22, 2024
9 checks passed
@Dinamiko Dinamiko deleted the PCP-3677-pay-pal-subscriptions-api-renewal-order-not-created-in-woo-commerce branch October 22, 2024 10:42
@Dinamiko Dinamiko added the bug Something isn't working label Nov 5, 2024
@Dinamiko Dinamiko mentioned this pull request Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants