You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hello,
We are having problems with Offline Credit Card Checkout on the payment screen which is returning an error....
"Unfortunately, we are unable to accept your transaction. There may be a problem with the payment information you entered, or our online processor may be experiencing technical difficulties at the present time. You can attempt to process your order again, or contact us to discuss other payment options."
This is only happening with this payment type yet Paypal, Google Checkout, and all check, money order, etc seem unaffected.
I ran the debug and there is much information just for this one event. I have no idea what I'm looking at.
Any Suggestions?
Thanks
Offline
I'm not sure if this helps but here's the display code....
<?php // +-- // | This processor integration references an internal URL // | for processing. All internal processing gateways // | work in the same manner. An order information array // | is made available globally under the the global name // | 'ecom.order_summary'. // | // | This must set a global variable named 'ecom.olpform' // | which contains the form information to be posted to // | an internal URL for processing. // | // | Anything printed within this code will be printed // | above the form instructions on the payment information // | page. // +-- // +-- // | Edit the credit cards accepted using this method below. // | If you do not wish to accept a particular card type, // | remove it from the array. // +-- $accepted_cards = array('VISA' => 'Visa', 'MASTERCARD' => 'Mastercard', 'AMEX' => 'American Express', 'DISCOVER' => 'Discover'); // +-- // | THERE IS NO NEED TO EDIT THE CODE BELOW THIS POINT TO // | ACTIVATE THIS INTEGRATION. ONLY EDIT THIS CODE TO MODIFY // | HOW THIS INTEGRATION WORKS. BE SURE YOU KNOW WHAT YOU'RE // | DOING! // +-- // +-- // | Get a few global variables. // +-- $eol = $this->globals('core.eol'); $order = $this->globals('ecom.order_summary'); // +-- // | Set up the olpform array. // +-- $olpform = array('namespace' => 'gwprocinternal', 'button' => 'Process Order', 'gateway' => $order['gateway']['id'], 'orderid' => $order['order']['id'], 'gwurl' => '', 'fields' => array()); // +-- // | Create the DISPLAY fields for the form. // +-- $olpform['fields']['DISPLAY'][] = array('type' => 'SELECTCUSTOM', 'params' => array('name' => 'cctype', 'required' => 1, 'display' => 'Card Type', 'desc' => 'Select the type of credit card you wish to use.', 'options' => $accepted_cards)); $olpform['fields']['DISPLAY'][] = array('type' => 'TEXTCUSTOM', 'params' => array('name' => 'ccnum', 'required' => 1, 'display' => 'Card Number', 'desc' => 'Enter your credit card number.')); $olpform['fields']['DISPLAY'][] = array('type' => 'TEXTCUSTOM', 'params' => array('name' => 'cvv2', 'required' => 0, 'display' => 'Card Verification Number', 'desc' => 'Enter your card verification number. Some cards do not contain verification numbers. Use the image presented below to locate your verification number.')); $olpform['fields']['DISPLAY'][] = array('type' => 'EXPCOMBO', 'params' => array('name' => 'ccexpire', 'required' => 1, 'display' => 'Card Expiration Date', 'desc' => 'Select your card expiration date from the list.', 'mformat' => 'MM', 'yformat' => 'YYYY', 'sepchar' => '/')); // +-- // | Set a global variable to display the card verification // | number image. // +-- $this->globals('ecom.olp_showimg_cvv2',1); // +-- // | Globalize the $olpform array and return. // +-- $this->globals('ecom.olpform',$olpform); ?>
Offline
I think we figured out that the customer was entering the credit card number with spaces like XXXX XXXX XXXX XXXX causing the error and we weren't using a mod10 card number to test it. We wound up modifying the field description
from:
'Enter your credit card number.'));
to:
'Enter your credit card number without spaces or dashes.'));
Hopefully this will make it clear enough to the purchaser from here on out.
Offline
If this is what is happening CCP should remove all non numeric characters to avoid any errors.
Offline
CCP does no checking or modifying of data entered into any fields on any forms (though for a CC field it does a simple mod10 as a basic sanity check). Cleaning up the CC field has been asked for since about day 2 of the V6 release.
Offline
I thought there was also something in the code to parse out spaces and dashes in version 7. The mod10 check is good though. Perhaps a good idea for the customer is if the field will change to red or something to alert the customer to what the error is as opposed to such a generalization error upon submit.
Offline
polarize wrote:
I thought there was also something in the code to parse out spaces and dashes in version 7.
Nope.
Offline
CCP should really except it either way and just strip out ALL none numeric characters using preg_replace.
Below is an example as the field name isn't right. But it does illustrate how easy it can be done with this code and proper variable name placed into the correct file.
$creditcardnum=preg_replace('/[^0-9]/','',$creditcardnum);
Last edited by cyberws (03-21-2012 09:05:11)
Offline
In private/ecom/ECOM_Olp\etc\offline.php
Change
$cgi['ccnum'] = $this->CORE_Crypt->encrypt($cgi['ccnum']);
to
$cgi['ccnum'] = preg_replace('/[^0-9]/','',$this->CORE_Crypt->encrypt($cgi['ccnum']));
I haven't tested it, but that should work.
Offline
The code above will run the encryption but then preg_replace will remove any none numeric characters and thus it will fail on decrypt.
So it should first remove all non numeric characters then the encrypt field so if non numeric characters are generated they won't be removed.
$cgi['ccnum'] = preg_replace('/[^0-9]/','',$cgi['ccnum']); $cgi['ccnum'] = $this->CORE_Crypt->encrypt($cgi['ccnum']);
Offline