Jump to content
Smoky Barnable

Paypal payment pro credit card number issue

Recommended Posts

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.


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

Share this post


Link to post
Share on other sites

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/


 

Share this post


Link to post
Share on other sites

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 by raiwa

Share this post


Link to post
Share on other sites
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.

image.png.f0065c76027e1d3ea3061b6ce498ad27.png

 

research-media-file-12a64d8c5a2d656a34373afe11e75f83.gif

Edited by JcMagpie

 

Share this post


Link to post
Share on other sites

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'],

 

Share this post


Link to post
Share on other sites

Thanks guys! Very helpful. I'm going to try out some of your ideas on my test site today.


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

Share this post


Link to post
Share on other sites
Posted (edited)

paypal is best payment method , I am using for my ecommerce. 

Edited by burt
probable spam link removed

Share this post


Link to post
Share on other sites

hmmm... why not use

str_replace(' ','',$string);

to remove all spaces.


  • 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...

 

Share this post


Link to post
Share on other sites
Posted (edited)

stripe is another good payment method. my online customers pay with this . 

Edited by Dan Cole
Another possible spam link removed...another stike and you're out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×