Skip to content

Fix: load membership and customer with the correct helpers in PayPal Express IPN#1378

Open
vuckro wants to merge 1 commit into
Ultimate-Multisite:mainfrom
vuckro:fix/paypal-ipn-correct-loaders
Open

Fix: load membership and customer with the correct helpers in PayPal Express IPN#1378
vuckro wants to merge 1 commit into
Ultimate-Multisite:mainfrom
vuckro:fix/paypal-ipn-correct-loaders

Conversation

@vuckro

@vuckro vuckro commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

In PayPal_Gateway::process_webhooks() the IPN custom field is
payment_id|membership_id|customer_id, but all three ids were loaded with
wu_get_payment(). So $membership and $customer were the wrong object type
(or false), leading to wrong-object data handling and a fatal when the later
code calls Membership-only methods (is_active(), renew(), …).

Changes

  • Use wu_get_membership() and wu_get_customer() for the respective ids.
  • Guard the index count so a malformed custom value doesn't raise
    undefined-index warnings.

Affects the legacy PayPal Express (NVP) gateway IPN path only.

… Express IPN

In PayPal_Gateway::process_webhooks() the IPN `custom` field is
"payment_id|membership_id|customer_id", but all three ids were loaded with
wu_get_payment(), so $membership and $customer were either the wrong object
type or false — leading to wrong-object data corruption (and a fatal when the
later code calls Membership-only methods like is_active()/renew()). Also guard
the index count so a malformed `custom` value doesn't raise undefined-index
warnings.

Use wu_get_membership() and wu_get_customer() for the respective ids.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@vuckro, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 12 minutes and 12 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2619a203-b13e-4776-b0f2-142f2a5f74c7

📥 Commits

Reviewing files that changed from the base of the PR and between 1310078 and 2857e17.

📒 Files selected for processing (1)
  • inc/gateways/class-paypal-gateway.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant