Author Topic: PayPal New API Adds Credit Card Payment Option that causes error  (Read 22396 times)

jdl777

  • Beginner
  • *
  • Posts: 24
PayPal New API Adds Credit Card Payment Option that causes error
« on: February 06, 2011, 21:46:57 pm »
When you select PayPal New API, it then adds "Credit Card" as a payment method option. If you select that as your payment method, then "Confirm Order", you get the following error:

  • Invalid Credit Card Number or Credit Card Verification Code.

    Error: Invalid Credit Card Number or Credit Card Verification Code.

    Error: Failure in Processing the Payment (ps_paypal_api)

    Invalid Credit Card Number or Credit Card Verification Code.


Obviously this error is because nobody entered any credit card information to check out! It should NOT have a Credit Card option to begin with.

How do we remove this Credit Card option when using PayPal New API? DO we go into the source files and delete the code that would call for that option?

Please advise. It makes little sense why it would do this.

jdl777

  • Beginner
  • *
  • Posts: 24
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #1 on: February 06, 2011, 22:14:04 pm »
SOLVED:

in the file: components/com_virtuemart/themes/(your theme)/templates/checkout/list_payment_methods.tpl.php

...I commented out line 113 s shown below:

   <div class="yagendoo_vm_checkout_payment_elements">
         <?php $ps_payment_method->list_nocheck($payment_method_id,  false); ?>
         <?php $ps_payment_method->list_bank($payment_method_id,  false); ?>
         <!--<?php $ps_payment_method->list_paypalrelated($payment_method_id,  false); ?>-->
      </div>

You can see that I have commented out the "paypal related" line. This removed the "Credit Card" option but left the other option intact.

Hope this helps someone who gets lost like I was!

newbii

  • Beginner
  • *
  • Posts: 5
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #2 on: February 07, 2011, 10:10:11 am »
Thanks, I had the same problem :-)

krofeta

  • Beginner
  • *
  • Posts: 33
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #3 on: February 11, 2011, 22:24:21 pm »
It's remove credit card radio button, but errors remain...

piperpilot

  • Beginner
  • *
  • Posts: 42
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #4 on: February 13, 2011, 04:27:54 am »
I'm working on this...I have narrowed it down to this...

When you have another payment option enabled, you get the option to choose "PayPal".  That choice triggers the checkout module to tell it that there is an express checkout in process.  It sets up some variables that tells the system how to handle everything from that point forward.

Now with ONLY paypal as your payment option, it skips over that choice and the proper variables aren't getting set.

If I can figure out what is telling it to skip over the payment choice screen, I can probably fix this, but VM is very confusing as to the flow.

If anyone has any pointers on where the code snippet that checks for multiple payment options is and skips that step, I'd appreciate it.

PiperPilot

piperpilot

  • Beginner
  • *
  • Posts: 42
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #5 on: February 13, 2011, 05:03:40 am »
Update:

Well I figured out where the code to bypass the payment type selection is.  Its in ps_checkout.php.

If you comment out the following section like I have shown here, it will always ask for a payment method.  This makes the module work properly, but isn't ideal because the selection of a payment type when there is only one is an unnecessary step.  I'm gonna work on figuring out how to bypass this and have the module still work.

Code: [Select]
        // Redirect to the last step when there's only one payment method
//              if( $VM_CHECKOUT_MODULES['CHECK_OUT_GET_PAYMENT_METHOD']['order$
//                      if ($count <= 1 && $cc_payments==false) {
//                              $vmLogger->debug("Only One Payment, skipping se$
//                              vmRedirect($sess->url(SECUREURL.basename($_SERV$
//                      }
//                      elseif( isset($order_total) && $order_total <= 0.00 ) {
//                              // In case the order total is less than or equa$
//                              vmRedirect($sess->url(SECUREURL.basename($_SERV$
//                      }
//              }


ozkart

  • Beginner
  • *
  • Posts: 5
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #6 on: February 15, 2011, 11:37:25 am »
What version of VM are you using. I'm on 1.1.7 and I'm also getting the

Invalid Credit Card Number or Credit Card Verification Code.
Error: Invalid Credit Card Number or Credit Card Verification Code.
Error: Failure in Processing the Payment (ps_paypal_api)
Invalid Credit Card Number or Credit Card Verification Code.

But when I opened the ps_checkout.php to comment out the code I found the string "Redirect to the last step when there's only one payment method" however the code under it is not the same as your post.

This is a frustrating bug.

mcongosto2

  • Beginner
  • *
  • Posts: 28
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #7 on: February 15, 2011, 16:10:07 pm »
I am having this problem too with 1.1.6. I wonder how urgently this bug is eing adressed because is a nasty one, or I am missing something of the preretended use or design of ot.

regards,

mcongosto2

  • Beginner
  • *
  • Posts: 28
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #8 on: February 15, 2011, 19:35:19 pm »
Sorry the double posting

If I use New Paypal i get this:

Invalid Credit Card Number or Credit Card Verification Code.
Error: Invalid Credit Card Number or Credit Card Verification Code.
Error: Failure in Processing the Payment (ps_paypal_api)
Invalid Credit Card Number or Credit Card Verification Code.

And if i use t he old one I get this

500 - No valid database connection

Using latest VM 1.1.7

So i cannot sell. I am 100% stuck. I cannot believe this, so frustrating. How come such basic features does not work out of the box??? is this the leading ecommerce application for Joomla??

piperpilot

  • Beginner
  • *
  • Posts: 42
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #9 on: February 15, 2011, 19:44:48 pm »
But when I opened the ps_checkout.php to comment out the code I found the string "Redirect to the last step when there's only one payment method" however the code under it is not the same as your post.

I am on 1.1.7 I thought.  Post that section and I'll take a look.  I also found the fix to still bypass it but have it work properly.

ssaarroo

  • Beginner
  • *
  • Posts: 3
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #10 on: February 15, 2011, 21:31:35 pm »
hi,
piperpilot
I am trying to sort it out the problem too.
Actually I am trying to do that just doing files back up and then by copying and past whatever I find in the web web. :P   ;D
I am doing that because my php skills gets a 0 rate ( or under 0)
I found your line code but to me it seems that I can see ( and also do my magic copy and past) only the left half part of the code.
So the right side is missing if I am not wrong.
It is like I can watch only half part of the pic.
I am using VM 1.1.6 and last version of joomla
Thanks to piperlot for your help and to everybody who can participate to this post.

4lane

  • Beginner
  • *
  • Posts: 24
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #11 on: February 15, 2011, 22:30:20 pm »
I had the same problem on 1.1.6, and due to a flaw in that build, updated to 1.1.7. In both versions I get the following error when trying to pay by credit card. Note: paying by paypal works fine.

"Error: Error - Paypal did not complete the transaction. Please try again in a little while.
Error: Failure in Processing the Payment (ps_paypal_api)"

ssaarroo

  • Beginner
  • *
  • Posts: 3

piperpilot

  • Beginner
  • *
  • Posts: 42
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #13 on: February 17, 2011, 02:46:18 am »
OOPS...sorry about the cut and paste problem.  I was copying from a terminal window so it got truncated.  Here is the whole section:

Code: [Select]
        // Redirect to the last step when there's only one payment method
if( $VM_CHECKOUT_MODULES['CHECK_OUT_GET_PAYMENT_METHOD']['order'] != $VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'] ) {
if ($count <= 1 && $cc_payments==false) {
$vmLogger->debug("Only One Payment, skipping selection");
vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order']."&payment_method_ppex=2", false, false ),"");
}
elseif( isset($order_total) && $order_total <= 0.00 ) {
// In case the order total is less than or equal zero, we don't need a payment method
vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order'], false, false),"");
}
}


If you look at this line here:

Code: [Select]
vmRedirect($sess->url(SECUREURL.basename($_SERVER['PHP_SELF'])."?page=checkout.index&payment_method_id=$first_payment_method_id&ship_to_info_id=$ship_to_info_id&shipping_rate_id=".urlencode($shipping_rate_id)."&checkout_stage=".$VM_CHECKOUT_MODULES['CHECK_OUT_GET_FINAL_CONFIRMATION']['order']."&payment_method_ppex=2", false, false ),"");
You will see that I added:

Code: [Select]
."&payment_method_ppex=2"
If you only have Paypal as your payment option, this will fix it so that it uses the express checkout option properly. 

Hope this helps everyone and that the devs might pick this up.  I'll see if I can figure out how to submit a bug and fix to the project when I have time.

Just to re-iterate, you can remove the comment // from my original post and this works fine.

PiperPilot

4lane

  • Beginner
  • *
  • Posts: 24
Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #14 on: February 17, 2011, 22:39:39 pm »
Nice job - works well. I'll just need to get in a Paypal logo w/ credit card icons so users know that they'll be paying via Paypal only.

VirtueMart Forum

Re: PayPal New API Adds Credit Card Payment Option that causes error
« Reply #14 on: February 17, 2011, 22:39:39 pm »