Cart Error - Card Number Invalid - when first landing in cart

Started by gremaley, February 11, 2016, 00:18:41 AM

Previous topic - Next topic

gremaley

This seems like a simple error - yet I can not solve it.

I am using 2 payment methods - PayPal Pro and PayPal Express.
VM 3.0.12, Joomla 3.4.8 and the Diverse Shop theme

Whenever I add a product to the cart and then click the link to the cart this error appears.
After much testing it appears that the link to the cart is trying to submit the form - before giving you a chance to fill it out.
If I unpublish the credit card payment method and leave PayPal Express only - clicking the link to go to the cart actually bypasses the cart altogether and takes you to the PayPal website for checkout...

I am hoping someone has seen this issue before? Maybe a commercial plugin would fix this?
Thanks everyone in advance.


jenkinhill

To rule out template/theme issues switch to Protostar and test.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

gremaley

Thank you!
I ended spending the whole day yesterday working on this issue and finally got it working.

Not sure if it is a theme/template issue or not but I ended up gambling $45(usd) on a commercial plug-in for PayPal-Pro and the error went away. The cart landing page only returns that error box now if you try to submit an order with no credit card values entered. Which is the correct function.

So for my installation it appears the stock plug-in for PayPal-Pro just doesn't work.

Thanks again for weighing in.

gtelegadis

I have looked far and wide and finally discovered the fix for all of those using vm 3.0.10 and using stock virtuemart paypal module as your payment method.  The issue is that when using one page checkout with stock paypal as the payment module, when a customer clicks step 3 shipping method the cart refreshes and results in a series of credit card errors on the top of the page.  This comes from technically not having credit card details in the fields even though the customer has yet to get to that step.  The issue is the case both with stock virtuemart one page check out and other 3rd party one page checkout upgrades such as rupostel and virtueplanet one page checkout.  The fix is as follows:

1.   Open plugins/vmpayment/paypal/paypal.php

Find the following codes in line 1104:
Copy
Codes
   public function plgVmOnSelectCheckPayment(VirtueMartCart $cart, &$msg) {

Replace above by:
Copy
Codes
   public function plgVmOnSelectCheckPayment(VirtueMartCart $cart, &$msg) {

      if(!vRequest::getInt('virtuemart_paymentmethod_id', 0)) {
         return null;
      }

Similarly find the following codes in line 1301:
Copy
Codes
   function plgVmOnCheckoutCheckDataPayment(VirtueMartCart $cart) {


Replace above by:
Copy
Codes
   function plgVmOnCheckoutCheckDataPayment(VirtueMartCart $cart) {

      if(!vRequest::getInt('virtuemart_paymentmethod_id', 0)) {
         return null;
      }


shoper_06

Quote from: gtelegadis on April 16, 2016, 20:47:38 PM
I have looked far and wide and finally discovered the fix for all of those using vm 3.0.10 and using stock virtuemart paypal module as your payment method.  The issue is that when using one page checkout with stock paypal as the payment module, when a customer clicks step 3 shipping method the cart refreshes and results in a series of credit card errors on the top of the page.  This comes from technically not having credit card details in the fields even though the customer has yet to get to that step.  The issue is the case both with stock virtuemart one page check out and other 3rd party one page checkout upgrades such as rupostel and virtueplanet one page checkout.  The fix is as follows:

1.   Open plugins/vmpayment/paypal/paypal.php

Find the following codes in line 1104:
Copy
Codes
   public function plgVmOnSelectCheckPayment(VirtueMartCart $cart, &$msg) {

Replace above by:
Copy
Codes
   public function plgVmOnSelectCheckPayment(VirtueMartCart $cart, &$msg) {

      if(!vRequest::getInt('virtuemart_paymentmethod_id', 0)) {
         return null;
      }

Similarly find the following codes in line 1301:
Copy
Codes
   function plgVmOnCheckoutCheckDataPayment(VirtueMartCart $cart) {


Replace above by:
Copy
Codes
   function plgVmOnCheckoutCheckDataPayment(VirtueMartCart $cart) {

      if(!vRequest::getInt('virtuemart_paymentmethod_id', 0)) {
         return null;
      }


Used it to fix same problem with stripe , worked as Great Thank You

Jumbo!

Quote from: shoper_06 on April 17, 2016, 00:35:40 AM
Quote from: gtelegadis on April 16, 2016, 20:47:38 PM
I have looked far and wide and finally discovered the fix for all of those using vm 3.0.10 and using stock virtuemart paypal module as your payment method.  The issue is that when using one page checkout with stock paypal as the payment module, when a customer clicks step 3 shipping method the cart refreshes and results in a series of credit card errors on the top of the page.  This comes from technically not having credit card details in the fields even though the customer has yet to get to that step.  The issue is the case both with stock virtuemart one page check out and other 3rd party one page checkout upgrades such as rupostel and virtueplanet one page checkout.  The fix is as follows:

1.   Open plugins/vmpayment/paypal/paypal.php

Find the following codes in line 1104:
Copy
Codes
   public function plgVmOnSelectCheckPayment(VirtueMartCart $cart, &$msg) {

Replace above by:
Copy
Codes
   public function plgVmOnSelectCheckPayment(VirtueMartCart $cart, &$msg) {

      if(!vRequest::getInt('virtuemart_paymentmethod_id', 0)) {
         return null;
      }

Similarly find the following codes in line 1301:
Copy
Codes
   function plgVmOnCheckoutCheckDataPayment(VirtueMartCart $cart) {


Replace above by:
Copy
Codes
   function plgVmOnCheckoutCheckDataPayment(VirtueMartCart $cart) {

      if(!vRequest::getInt('virtuemart_paymentmethod_id', 0)) {
         return null;
      }


Used it to fix same problem with stripe , worked as Great Thank You


As I told you it is a problem of your payment plugin - http://forum.virtuemart.net/index.php?topic=133887.msg464713

ahsan.abbasi

Hi,
I also have this issue.
Using third Party 'one page check out plugin' and Pay 'Pall Payment pro' as payment module.
Try it with pro star template and disabled one page checkout but issue still there.
So i work with solution provided by 'gtelegadis' and work like a charm.

Thanks

communion

Hey are you seeing the card fields filled with 'garbage' character strings, or partial garbage characters? I'm wondering if I am having the same issue?

http://forum.virtuemart.net/index.php?topic=134109.0