♥Smoky Barnable Posted February 23, 2019 Share Posted February 23, 2019 Today a customer brought to my attention that if he put spaces when entering his credit card number, which many people do - a space between every 4 numbers, an error is thrown: “This transaction cannot be processed. Please enter a valid credit card number and type.” The customer figured it out but I'm guessing some people would just give up and the sale would be lost. I'm sure this is an easy fix. I just thought I would mention it because I see it as a fairly serious bug. Now that I think about it, the box where you input payment information is pretty primitive....could do with an update. Quote The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence. - Rabindranath Tagore Link to comment Share on other sites More sharing options...
♥JcMagpie Posted February 23, 2019 Share Posted February 23, 2019 This is a problem with many paymet systems, some auto format as the customer types to fix issue many just give error, This artical covers this in some some detail. https://baymard.com/blog/credit-card-field-auto-format-spaces Smoky Barnable 1 Quote Link to comment Share on other sites More sharing options...
♥JcMagpie Posted February 23, 2019 Share Posted February 23, 2019 I'm no expert so this is probably best left to some one who understands the PayPal module fullly 😊 , but on a simple form input box you can just use a simple bit of js to auto format the customers input into 4 digit blocks as they input the number. You can test it in the fiddle box. https://jsfiddle.net/crb13rsd/ Smoky Barnable 1 Quote Link to comment Share on other sites More sharing options...
♥JcMagpie Posted February 23, 2019 Share Posted February 23, 2019 And as allways with these issues someone has already found a fix for the problem, this is for stripe payments but can be used for others https://github.com/stripe/jquery.payment or a simple js solution https://jsfiddle.net/pmrotule/217u7fru/ Smoky Barnable 1 Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted February 23, 2019 Share Posted February 23, 2019 (edited) Hello Eric, The easiest step could be to add a placeholder text to the input field saying something like "no blank spaces" If you are using PayPal direct payment, you would need to edit the payment module: includes/modules/payment/paypal_pro_dp.php find line 161 and modify to: ' <td>' . tep_draw_input_field('cc_number_nh-dns', '', 'id="paypal_card_num" placeholder="' . $this->_app->getDef('module_dp_field_card_number_placeholder') . '"') . '</td>' . then add the language definition to: includes/apps/paypal/languages/english/modules/DP/DP.php: its a bit different done in the paypal app than in other language files: module_dp_field_card_number_placeholder = no blank spaces Then the second step could be to add a pattern check to the input filed which will show an error message if blank spaces are used. This is a html5 input validation and shows if they try to hit the form submit ("Confirm Order" button). This would look like follows: ' <td>' . tep_draw_input_field('cc_number_nh-dns', '', 'id="paypal_card_num" placeholder="' . $this->_app->getDef('module_dp_field_card_number_placeholder') . '" pattern="^\S+$"') . '</td>' . Then if you wish to auto remove blank spaces, try: line 212: 'ACCT' => str_replace(' ', '', $HTTP_POST_VARS['cc_number_nh-dns']), Edited February 23, 2019 by raiwa Roaddoctor and Smoky Barnable 2 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥JcMagpie Posted February 23, 2019 Share Posted February 23, 2019 (edited) 5 hours ago, Smoky Barnable said: I'm guessing some people would just give up and the sale would be lost I'm sure this is true as it's not easy checking if you have enterd the corect number if it looks like this 5457623898234113 It'a all about making it easy for the customer. I personally find this much better to check. 5457 6238 9823 4113 , Also forms that automaticly show it in the 4 digit block are even better. Customer just enters the numbers and spacing is done automaticly making easy to enter and to check. Edited February 23, 2019 by JcMagpie Smoky Barnable 1 Quote Link to comment Share on other sites More sharing options...
♥raiwa Posted February 23, 2019 Share Posted February 23, 2019 Another way: Separate the input in 4 input fields, one for each group. Then concatenate them like this: 'ACCT' => $HTTP_POST_VARS['cc_number_nh-dns_1'] . $HTTP_POST_VARS['cc_number_nh-dns_2'] . $HTTP_POST_VARS['cc_number_nh-dns_3'] . $HTTP_POST_VARS['cc_number_nh-dns_4'], Smoky Barnable 1 Quote About Me: http://www.oscommerce.com/forums/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Link to comment Share on other sites More sharing options...
♥Smoky Barnable Posted February 23, 2019 Author Share Posted February 23, 2019 Thanks guys! Very helpful. I'm going to try out some of your ideas on my test site today. Quote The water in a vessel is sparkling; the water in the sea is dark. The small truth has words which are clear; the great truth has great silence. - Rabindranath Tagore Link to comment Share on other sites More sharing options...
monicajenner66 Posted March 12, 2019 Share Posted March 12, 2019 (edited) paypal is best payment method , I am using for my ecommerce. Edited March 12, 2019 by burt probable spam link removed Quote Link to comment Share on other sites More sharing options...
mcmannehan Posted March 13, 2019 Share Posted March 13, 2019 hmmm... why not use str_replace(' ','',$string); to remove all spaces. Quote The clever one learn from everything and from everybody The normal one learn from his experience The silly one knows everything better [socrates, 412 before Christ] Computers help us with the problems we wouldn't have without them! 99.9% of the bugs sit in front of the computer! My programmed add-ons: WDW EasyTabs 1.0.3, WDW Facebook Like 1.0.0 if(isset($this) || !isset($this)){ // that's the question... Link to comment Share on other sites More sharing options...
monicajenner66 Posted March 25, 2019 Share Posted March 25, 2019 (edited) stripe is another good payment method. my online customers pay with this . Edited March 26, 2019 by Dan Cole Another possible spam link removed...another stike and you're out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.