If for some reason the default credit card gateway is disabled, there is a form at /admin/store/orders/%/payments/select/credit to display the available gateways and let the admin choose one to make a payment. I suspect this has never even been used, as the default gateway will be set and never changed on 99.9% of all sites, so this should just be removed.

#2 1855986-remove-payment-gateway-select.patch4.25 KBlongwave
PASSED: [[SimpleTest]]: [MySQL] 2,773 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


longwave’s picture

Title: Remove payment gateway select feature » Remove disabled payment gateway select feature
longwave’s picture

Status: Active » Needs review
4.25 KB
PASSED: [[SimpleTest]]: [MySQL] 2,773 pass(es). View

After this patch is applied, I think we can simplify uc_payment_process_payment() further - at least the last parameter can be removed, which is TRUE to redirect after the payment is made - but this is never used in core, and should be the caller's responsibility anyway.

DanZ’s picture

When does this doomed form show up?

longwave’s picture

1. Enable at least three credit card payment gateways (Test Gateway, PayPal WPP, Authorize.Net, etc.)
2. Go to /admin/store/settings/payment/method/credit and select e.g. PayPal WPP as the default gateway
3. Disable the PayPal module, or whatever you selected in step 2
4. Find an order and edit the payment method to Credit card
5. View the order and click Process card
6. Enter some credit card details to attempt to charge the card
7. The payment gateway select page will be shown

This only ever shows up if you have selected a default gateway, then disabled the module that provides that gateway, still have at least two other gateways enabled, and then attempt to charge the card as an administrator. As this is such an unlikely set of circumstances I suspect this code has never been used, and I don't even think it works in 7.x at least as if I try this and attempt to charge Test Gateway I get a bunch of errors and "Credit card charge failed".

longwave’s picture

After applying the patch, instead you get "An error has occurred with your payment gateway. The charge function could not be found." which is a bit more sensible.

longwave’s picture

Status: Needs review » Fixed

Committed. I don't see the point in keeping this around when it doesn't work.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.