Kryptronic Software Support Forum

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.

#1 03-19-2012 17:39:16

polarize
Member
Registered: 11-15-2004
Posts: 293

Checkout Error Offline Credit Card

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 smile


Using Kryptronic K9! smile
Previous Versions:
ClickCartPro 8
ClickCartPro 7
ClickCartPro 6
ClickCartPro 5.1

Offline

 

#2 03-19-2012 17:43:13

polarize
Member
Registered: 11-15-2004
Posts: 293

Re: Checkout Error Offline Credit Card

I'm not sure if this helps but here's the display code....

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);

?>

Using Kryptronic K9! smile
Previous Versions:
ClickCartPro 8
ClickCartPro 7
ClickCartPro 6
ClickCartPro 5.1

Offline

 

#3 03-19-2012 23:01:19

polarize
Member
Registered: 11-15-2004
Posts: 293

Re: Checkout Error Offline Credit Card

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:

Code:

'Enter your credit card number.'));

to:

Code:

'Enter your credit card number without spaces or dashes.'));

Hopefully this will make it clear enough to the purchaser from here on out.


Using Kryptronic K9! smile
Previous Versions:
ClickCartPro 8
ClickCartPro 7
ClickCartPro 6
ClickCartPro 5.1

Offline

 

#4 03-20-2012 08:28:14

cyberws
Member
From: Atlanta, GA
Registered: 02-05-2004
Posts: 756

Re: Checkout Error Offline Credit Card

If this is what is happening CCP should remove all non numeric characters to avoid any errors.


Jeremy O

Production CCP .:. Version 6 w/QuickBuy and many in house hacks
Skills: PHP & Perl programming, Solaris & Linux server administration, Oracle OCP training and MySQL experience

Offline

 

#5 03-20-2012 16:19:51

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Checkout Error Offline Credit Card

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

 

#6 03-20-2012 18:02:04

polarize
Member
Registered: 11-15-2004
Posts: 293

Re: Checkout Error Offline Credit Card

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.


Using Kryptronic K9! smile
Previous Versions:
ClickCartPro 8
ClickCartPro 7
ClickCartPro 6
ClickCartPro 5.1

Offline

 

#7 03-21-2012 03:04:38

Dave
Member
Registered: 07-05-2003
Posts: 11233

Re: Checkout Error Offline Credit Card

polarize wrote:

I thought there was also something in the code to parse out spaces and dashes in version 7.

Nope.

Offline

 

#8 03-21-2012 09:04:50

cyberws
Member
From: Atlanta, GA
Registered: 02-05-2004
Posts: 756

Re: Checkout Error Offline Credit Card

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.

Code:

$creditcardnum=preg_replace('/[^0-9]/','',$creditcardnum);

Last edited by cyberws (03-21-2012 09:05:11)


Jeremy O

Production CCP .:. Version 6 w/QuickBuy and many in house hacks
Skills: PHP & Perl programming, Solaris & Linux server administration, Oracle OCP training and MySQL experience

Offline

 

#9 03-21-2012 09:33:58

jj1987
Member
From: Orlando, FL
Registered: 07-14-2008
Posts: 502
Website

Re: Checkout Error Offline Credit Card

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.



-James Garrett

Offline

 

#10 03-21-2012 10:56:32

cyberws
Member
From: Atlanta, GA
Registered: 02-05-2004
Posts: 756

Re: Checkout Error Offline Credit Card

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.

Code:

$cgi['ccnum']  = preg_replace('/[^0-9]/','',$cgi['ccnum']);
$cgi['ccnum']  = $this->CORE_Crypt->encrypt($cgi['ccnum']);

Jeremy O

Production CCP .:. Version 6 w/QuickBuy and many in house hacks
Skills: PHP & Perl programming, Solaris & Linux server administration, Oracle OCP training and MySQL experience

Offline

 

Board footer