t523d: Add payee.merchant_id to purchase_units in create_order()#735
t523d: Add payee.merchant_id to purchase_units in create_order()#735superdav42 merged 2 commits intomainfrom
Conversation
PayPal partner model requires payee.merchant_id in each purchase_unit to ensure payments route to the correct merchant account when using OAuth (PPCP) mode. Previously only the PayPal-Auth-Assertion header was set; this adds the explicit payee field as PayPal requires. The field is only added when $this->merchant_id is non-empty (OAuth mode). Manual-credentials mode is unaffected. Closes #730. Part of the t523 PayPal PPCP compliance series.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 17 minutes and 47 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ 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 |
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
|
Performance Test Results Performance test results for f52793e are in 🛎️! Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown. URL:
|
Summary
payee.merchant_idtopurchase_units[0]increate_order()when$this->merchant_idis set (OAuth/PPCP mode)PayPal-Auth-Assertionheader was setmerchant_id) is unaffectedChanges
inc/gateways/class-paypal-rest-gateway.phppurchase_unitarray into a local variable before building$order_datapayee.merchant_idinjection when$this->merchant_idis non-emptytests/WP_Ultimo/Gateways/PayPal_REST_Gateway_Test.phpcreate_order_test_fixtures()helper to create user/customer/membership/paymentinvoke_create_order_and_capture()helper usingwu_paypal_rest_order_datafilter to capture order data before the API calltest_create_order_includes_payee_merchant_id_when_set— assertspayee.merchant_idpresent in OAuth modetest_create_order_omits_payee_when_merchant_id_empty— assertspayeeabsent in manual-credentials modeTest Results
Closes #730
aidevops.sh v3.5.556 plugin for OpenCode v1.3.0 with claude-sonnet-4-6 spent 15h 14m and 13,232 tokens on this as a headless worker.