Closed (fixed)
Project:
Ubercart Netbanx integration
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 May 2011 at 15:49 UTC
Updated:
17 Dec 2012 at 15:05 UTC
Jump to comment: Most recent file
Comments
Comment #1
alarcombe commentedHi there,
What sort of error are you receiving? Something as fundamental as checksum configuration shouldn't be broken... :-/
Comment #2
MarcusOaten commentedNetbanx say the checksum is in error because the nbx_payment_amount has a decimal in it, I am wondering if this is being caused by the VAT add 20% caculation before this module gets passed that value.
The following errors have occurred:
* Authorisation Denied (135)
Comment #3
MarcusOaten commentedeven with the tax and vat modules off there is still a 135 error,
Comment #4
MarcusOaten commentednetbanx say that the nbx_payment_amount needs to be an integrer without any decimal value, even .0
something like this has been suggested to remove all minor functions.
pseudo code.
sub str (variable amount,0,strpos(amount, ".'));
Comment #5
MarcusOaten commented$form['uc_netbanx_currency_factor'] = array(
'#type' => 'textfield',
'#title' => t('Minor currency unit multiplier'),
'#description' => t('Netbanx uses integer minor currency units, Ubercart uses decimal major currency units. This is the the multiplication factor to use to convert between them (usually 100).'),
'#default_value' => variable_get('uc_netbanx_currency_factor', 100),
could this be applied somewhere here.
sub str (variable amount,0,strpos(amount, ".'));
Comment #6
MarcusOaten commentededited 'nbx_payment_amount' => round($order->order_total * variable_get('uc_netbanx_currency_factor', 100)),
this has resolved the decimal major unit.
Comment #7
MarcusOaten commentedI have changed-
$checksum = _nbx_checksum_from_order($order);
With these lines of code
$amount = round($order->order_total *
variable_get('uc_netbanx_currency_factor', 100)) ;
$currency = "GBP";
$reference =$order->order_id;
$key = "SECRET KEY IN HERE... ";
$checksum = sha1($amount . $currency . $reference . $key);
This works but now the return is resolving to. The requested page could not be found. back at the merchant site.
with URL:
http://www.itdoesthejob.com/cart/netbanx/return/71/73bb4a3f87cc50d2b5cc6...
Comment #8
alarcombe commentedWhat's in the watchdog log? If it returns with an invalid order id or if the checksum returned by netbanx doesn't validate then you'll receive a 404 error.
Comment #9
MarcusOaten commentedNow working with following changes-
round order->order_total
and order_total->order_id
'nbx_payment_amount' => round($order->order_total * variable_get('uc_netbanx_currency_factor', 100)),
return sha1(($order->order_total * variable_get('uc_netbanx_currency_factor', 100)) . 'GBP' . ($order->order_id) . variable_get('uc_netbanx_secret_key', 'SECRETKEY'));
}
Comment #10
MarcusOaten commentedHere is my diff patch file.
Comment #11
MarcusOaten commentedComment #12
MarcusOaten commentedComment #13
MarcusOaten commentedThis is how you fix tax issue
Comment #14
alarcombe commentedThanks! Patched in new release 6.x-1.0