Treat the new pmpro-paypal Add On as a no-billing gateway#100
Open
dparker1005 wants to merge 1 commit intostrangerstudios:devfrom
Open
Treat the new pmpro-paypal Add On as a no-billing gateway#100dparker1005 wants to merge 1 commit intostrangerstudios:devfrom
dparker1005 wants to merge 1 commit intostrangerstudios:devfrom
Conversation
The pmpro-paypal Add On (1.1+) registers `paypal` as a checkout gateway and redirects offsite for payment, so the donation script's billing-fields UI should treat it the same as paypalexpress: no billing address or payment information fields are needed when paypal is selected. Add `paypal` to both the PHP-side initial pmpro_gateway_billing decision and the runtime no_billing_gateways list so the donation field's show/hide logic works correctly when a member picks PayPal at checkout via the new Add On. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The new pmpro-paypal Add On (released as 1.1) registers
paypalas a checkout gateway and redirects offsite for payment, so no billing address or payment information fields are needed when a member picks PayPal at checkout. Without this change, the donation script's show/hide logic doesn't recognize thepaypalslug, so it leaves#pmpro_billing_address_fieldsand#pmpro_payment_information_fieldsvisible while the user is being redirected offsite.This adds
paypalto both:pmpro_gateway_billing(includes/checkout.php:133), so the page-load state is correct when?gateway=paypalis set or when paypal is the primary gateway, andno_billing_gatewaysarray (includes/checkout.php:186), so picking the PayPal radio toggles the fields off correctly at runtime.The existing
'check' !== gatewaycarve-out is unaffected — when the user picks PayPal, we fall into that branch and both billing/payment field groups get hidden, which is the desired behavior for an offsite redirect.Test plan
#pmpro_billing_address_fieldsand#pmpro_payment_information_fields. Switching back to the primary radio restores them.paypalexpress,twocheckout,check, andpaypalstandardis unchanged.🤖 Generated with Claude Code