Hunting through the payment.module, I found that the invoking of a module using "$txn->payment_method" under the review case does not work if the Title on the previous screen (selecting a payment method) was different than the module name
Example: Authorize.net uses "Pay with Credit Card" as its title. When you goto the review section, you'll notice that there is no payment method.

Altered the payment.module to call a new hook called 'modulename_name', which returns the name of the module for its title. Attached is an altered payment.module. Here is a code snipet from the authorize.net invokation of authorize_net_name:

function authorize_net_name($title) {
if ($title == t('Pay with credit card')) //example for a statically set title.
//optionally you could do: if ($title == variable_get('cod_title','')) for CODs (which should happen)
return "authorize_net";
else
return false;
}

Comments

japerry@drupal.org’s picture

I've been running into this name issue all day.. I found a code snipet in store.inc that needs to change as well:
$form['overview']['payment_method'] = array(
'#type' => 'select',
'#title' => t('Payment method'),
'#default_value' => $edit->payment_method,
'#options' => payment_get_methods(),
);

TO:
$form['overview']['payment_method'] = array(
'#type' => 'select',
'#title' => t('Payment method'),
'#default_value' => payment_get_modulename($edit->payment_method),
'#options' => payment_get_methods(),
);

gordon’s picture

Status: Needs review » Fixed

Thanks, I have commited to cvs

neclimdul’s picture

Version: » 4.6.x-1.x-dev
Status: Fixed » Needs review
StatusFileSize
new489 bytes

I believe this is a problem in a couple other places as well. Almost anyplace that uses $txn->payment_method is actually looking for the function. Here's a patch for the one in cart.

neclimdul’s picture

Version: 4.6.x-1.x-dev » master
StatusFileSize
new447 bytes

put this back to CVS/4.7
And another place in payment.module

sime’s picture

StatusFileSize
new676 bytes

James,
I applied your patches and a slight change required for the cart patch. You have $txn->payment_method, which returns null in my installation. I've attached a patch that uses $edit->payment_method instead.
.s

neclimdul’s picture

Oh yeah. I was playing around with rewriting/cleaning up some of the cart module locally which is what brought this to my attention. Must have forgotten to fix the name when I made the patch.

sime’s picture

Status: Needs review » Closed (duplicate)