CharlieFoxtrot
2009-09-01 11:25:40
NOTE: This bug may have been fixed in subsequent releases that I'm not qualified to receive... but if not, here's my quick-fix for it.
The Problem: MyVirtualMerchant requires that the transaction amount (ssl_amount) be in the following format: XXX.xx ... with only TWO digits beyond the decimal point. ~ It appears that this module sends the transaction amount as XXX.xxxx ... with FOUR digits beyond the decimal.
I can't tell if the value contains four decimal places because of something in the ISC code, or if it's a server configuration that's causing it. But even if it's due to a non-standard server configuration, the ISC script needs to handle it.
If the payment processor receives a number with four decimal places, the transaction is rejected. So we need to trim off any excess before submitting the data. Just below are the two minor changes that I made to the module.
INSTRUCTIONS: Open the file
Find (near line 91):
$amount = ($this->GetGatewayAmount());
$amount = substr($amount,0,-(strlen(strrchr($amount,'.'))-3));
Next... find (near line 117)
$myvPostData['ssl_amount'] = $this->GetGatewayAmount();
// $myvPostData['ssl_amount'] = $this->GetGatewayAmount();
$myvPostData['ssl_amount'] = $amount;
I like to comment-out the original lines (instead of deleting them). It's helpful to me in case I need to make some quick-fixes later on, and I can easily restore it without having to refer to a backup version.
Good luck!
Charlie
PS: When spell-checking this post, my browser didn't recognize "MyVirtualMerchant"... so it suggested "Befuddlement".