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;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | cart.module_0.patch | 676 bytes | sime |
| #4 | payment_4.patch | 447 bytes | neclimdul |
| #3 | cart_5.patch | 489 bytes | neclimdul |
| payment_2_0.patch | 1.21 KB | japerry@drupal.org |
Comments
Comment #1
japerry@drupal.org commentedI'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(),
);
Comment #2
gordon commentedThanks, I have commited to cvs
Comment #3
neclimdulI 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.
Comment #4
neclimdulput this back to CVS/4.7
And another place in payment.module
Comment #5
simeJames,
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_methodinstead..s
Comment #6
neclimdulOh 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.
Comment #7
simeSee: http://drupal.org/node/51852