Fix: load membership and customer with the correct helpers in PayPal Express IPN#1378
Fix: load membership and customer with the correct helpers in PayPal Express IPN#1378vuckro wants to merge 1 commit into
Conversation
… 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>
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
In
PayPal_Gateway::process_webhooks()the IPNcustomfield ispayment_id|membership_id|customer_id, but all three ids were loaded withwu_get_payment(). So$membershipand$customerwere the wrong object type(or
false), leading to wrong-object data handling and a fatal when the latercode calls Membership-only methods (
is_active(),renew(), …).Changes
wu_get_membership()andwu_get_customer()for the respective ids.customvalue doesn't raiseundefined-index warnings.
Affects the legacy PayPal Express (NVP) gateway IPN path only.