Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error on cc_card_number input. help please?


Nathali

Recommended Posts

Hi,

 

Need help please..

 

I get this error when I enter:

credit card number = 2222

 

cvv2 = 1

 

Warning: str_repeat() [function.str-repeat]: Second argument has to be greater than or equal to 0. in /home/shakedtr/public_html/includes/modules/payment/netpay.php on line 153

 

line 152-153:

 

152 'field' => substr($this->cc_card_number, 0, 4) .

153 str_repeat('X', (strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),

 

Could someone help please to fix it ?

 

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

Because of this code:

 

(strlen($this->cc_card_number) - 8)

The CC number must be 8 or more digits in length.

 

The solution: Always enter an 8 (or more) digit CC number.

:thumbsup:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Because of this code:

 

(strlen($this->cc_card_number) - 8)

The CC number must be 8 or more digits in length.

 

The solution: Always enter an 8 (or more) digit CC number.

:thumbsup:

 

Thanks Jim for your reply !

 

Do you think I need to change the code to make a warnig info. box for the customer instead of breaking the software code??

 

Thanks Jim !

 

Nathali

Best Regards,

Nathali

Link to comment
Share on other sites

Thanks Jim for your reply !

 

Do you think I need to change the code to make a warnig info. box for the customer instead of breaking the software code??

 

Thanks Jim !

 

Nathali

The min length of a cc number is set in admin, ergo I do not think you need to do anything. Mine is set at 10.

Link to comment
Share on other sites

It may be more trouble than it's worth since all CC numbers are normally that long or longer.

 

You only got the error because you're "testing".

 

My opinion is that it's sloppy coding on whomever wrote netpay.php for not already coding the length check in the first place.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

You can check what Leslie just posted about.

 

Login to your Admin.

 

Click on Configuration

 

Click on Minimum Values

 

On that page set the value for Credit Card Number

 

Then save it.

 

The number you enter is the minimum number of characters in the CC number in osC.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...