PayPal fallback initializer fails to intercept PayPal payment requests when credentials are invalid/missing #9
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The config/initializers/paypal_fallback.rb initializer was created to gracefully handle conferences without PayPal credentials configured, allowing users to proceed without PayPal. However, the fallback is ineffective because:
Architectural issue: Using Module#prepend doesn't work for this use case because the original RegistrationControllerHelper module (bikecollectives_core) internally calls paypal_request (a private method) from within payment_form_step_update. Ruby module prepends only intercept external method calls (from the controller), not internal calls within the same module's inheritance chain. When super is called, the original module's internal paypal_request executes directly, bypassing any fallback logic.
Result: Users selecting PayPal as payment method encounter 'username', 'password', 'signature' required error when conference PayPal credentials are missing or invalid, despite the fallback initializer existing.
Recommended Fix: Refactor the fallback to either: