VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Payment VM 1.1 => PayPal / PayPal Pro VM 1.1 => Topic started by: newbii on February 05, 2011, 15:35:41 pm

Title: Paypal (new API) problems
Post by: newbii on February 05, 2011, 15:35:41 pm
Hi

I'm new to virtuemart and having some problems with paypal.

paypal is my only payment option.

When i checkout step 1-3 is ok, but when i enter step 4 I get some errors.

I'm never transferred to the paypal site where to commit the payment, instead at step 4 I get the messages:

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.

Why is that? Have I forgot to setup something at the Paypal module?
or...?

Hope someone know about this.

Thanks  ???

Title: Re: Paypal (new API) problems
Post by: JohnBerringer on February 05, 2011, 22:44:56 pm
you use "paypal (old)" module or new? if you use old have you set up settings?
If you use new one you should enable another payment module i think this is bug if you have just pay pal it does not work you must have at least 2 different like "cash on delivery" then you will see 3 choices

PayPal
Credit Card
Cash on Delivery

choose paypal. But i suggest using old module.
Title: Re: Paypal (new API) problems
Post by: newbii on February 07, 2011, 10:08:02 am
Hi, Thanks for your fast reply :-), but I'm still having the same problems.

Still when I choose paypal as payment method I get the same errors! I have to be send to the paypal site, but nothing happens except when finished step 4, the errors are shown!

And another question, why do I always have the option 'credit card' even though it has been disabled?

???

Title: Re: Paypal (new API) problems
Post by: Shibumi on February 08, 2011, 01:58:43 am
I have experienced the same problem, but in IE only... if I run the same product through the checkout process in Google Chrome, Safari, and Firefox with only PayPal (new API) it works fine and goes to the paypal payment page, but... if I run it through IE8, it will give me the error.  Paypal Express checkout works in all instances. I have tested on Google Chrome, Safari, and Firefox in OSX and they all work fine - IE8 gives the error, Google Chrome and IE9 did work in Windows 7.

I have tried with only PayPal (new API) and with other payment methods such as cash on delivery using ps_payment
Title: Re: Paypal (new API) problems
Post by: Hennie on March 05, 2011, 14:43:48 pm
Hi..,
did anyone has a solution yet? I experience the same errors. Tried some suggestions on this board but nothing so far.. :(
kind regards Hennie
Title: Re: Paypal (new API) problems
Post by: zanardi on March 05, 2011, 17:53:50 pm
Some fixes regarding this issue has been included in VirtueMart 1.1.8, which IS NOT RELEASED YET.

If you want, you may test a BETA VERSION (strictly for non-production environment) available at http://dev.virtuemart.net/issues/308.
Title: Re: Paypal (new API) problems
Post by: Hennie on March 05, 2011, 18:29:59 pm
thank you for your response  :)
I'm considering... have to check first with my iDeal-comp supplier.
Have just resolved an amount of troubles there...
kind regards,
Hennie
Title: Re: Paypal (new API) problems
Post by: skulldah on May 29, 2011, 01:32:36 am
I have experienced the same problem, but in IE only... if I run the same product through the checkout process in Google Chrome, Safari, and Firefox with only PayPal (new API) it works fine and goes to the paypal payment page, but... if I run it through IE8, it will give me the error.  Paypal Express checkout works in all instances. I have tested on Google Chrome, Safari, and Firefox in OSX and they all work fine - IE8 gives the error, Google Chrome and IE9 did work in Windows 7.

I have tried with only PayPal (new API) and with other payment methods such as cash on delivery using ps_payment

Everybody try to do this:

Open the file get_payment_method_paypal_ex.tpl.php in [JOOMLA_HOME]/components/com_virtuemart\themes\default\templates\checkout

Look for this code:

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />

and change for this

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="2" />

The problem in IE8 is that JavaScript Engine doesn't execute the code that puts the value 2 in input id paypalExpress_ecm.

Virtue Mart needs that value to bypass the traditional credit card type and number validation
               
               
Title: Re: Paypal (new API) problems
Post by: stAn99 on June 02, 2011, 17:28:47 pm
Hello everybody,
 today i found a bug in PayPal New Api when using direct payment and shipping tax together. Paypal will issue an error:

Quote
Paypal did not complete the transaction - FAILURE - SHORTMESSAGE =Transaction refused because of an invalid argument. See additional error messages for details. -
ERRORCODE =10413 -
LONGMESSAGE =The totals of the cart item amounts do not match order amounts. -

Recommended solution:

edit \administrator\components\com_virtuemart\classes\payment\ps_paypal_api.php
function NVP_DoDirectPaymentRequest

after this line:
Code: [Select]
$ship_total = isset($d['shipping_total']) ? round($d['shipping_total'],2) : 0;

add:
Code: [Select]
if (!empty($d['order_shipping_tax'])) $ship_total += round($d['order_shipping_tax'],2);

The same error can occur for Paypal express or normal paypal redirect when your $ps_checkout->calc_order_totals returns incorrectly rounded values and the sum does not match order total. This is particularly problem when a price of a product is set to 1.123456 and you add 1000 quantities of the product and multiply it by a tax rate such as 19 percent.
Title: Re: Paypal (new API) problems
Post by: JFrehe on June 07, 2011, 16:05:59 pm
I have experienced the same problem, but in IE only... if I run the same product through the checkout process in Google Chrome, Safari, and Firefox with only PayPal (new API) it works fine and goes to the paypal payment page, but... if I run it through IE8, it will give me the error.  Paypal Express checkout works in all instances. I have tested on Google Chrome, Safari, and Firefox in OSX and they all work fine - IE8 gives the error, Google Chrome and IE9 did work in Windows 7.

I have tried with only PayPal (new API) and with other payment methods such as cash on delivery using ps_payment

Everybody try to do this:

Open the file get_payment_method_paypal_ex.tpl.php in [JOOMLA_HOME]/components/com_virtuemart\themes\default\templates\checkout

Look for this code:

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />

and change for this

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="2" />

The problem in IE8 is that JavaScript Engine doesn't execute the code that puts the value 2 in input id paypalExpress_ecm.

Virtue Mart needs that value to bypass the traditional credit card type and number validation
               
               

Thanks! that worked!
Title: Re: Paypal (new API) problems
Post by: upgrade on June 23, 2011, 14:26:58 pm
Hello everybody,
 today i found a bug in PayPal New Api when using direct payment and shipping tax together. Paypal will issue an error:

Quote
Paypal did not complete the transaction - FAILURE - SHORTMESSAGE =Transaction refused because of an invalid argument. See additional error messages for details. -
ERRORCODE =10413 -
LONGMESSAGE =The totals of the cart item amounts do not match order amounts. -

Recommended solution:

edit \administrator\components\com_virtuemart\classes\payment\ps_paypal_api.php
function NVP_DoDirectPaymentRequest

after this line:
Code: [Select]
$ship_total = isset($d['shipping_total']) ? round($d['shipping_total'],2) : 0;

add:
Code: [Select]
if (!empty($d['order_shipping_tax'])) $ship_total += round($d['order_shipping_tax'],2);

The same error can occur for Paypal express or normal paypal redirect when your $ps_checkout->calc_order_totals returns incorrectly rounded values and the sum does not match order total. This is particularly problem when a price of a product is set to 1.123456 and you add 1000 quantities of the product and multiply it by a tax rate such as 19 percent.

The method can't solve the problem: "Error: Credit Card Type not found" if upgrading to VirtueMart 1.1.9.
Title: Re: Paypal (new API) problems
Post by: jenkinhill on June 23, 2011, 15:13:43 pm
\administrator\components\com_virtuemart\classes\payment\ps_paypal_api.php is not changed in VM1.1.9 - it is the same as in 1.1.8
Title: Re: Paypal (new API) problems
Post by: upgrade on June 23, 2011, 15:54:41 pm
Hi jenkinhill,

Thank you for the reply first.

I'm sorry I should quote skulldah's post.
Because I found [JOOMLA_HOME]\components\com_virtuemart\themes\default\templates\checkout
\get_payment_method_paypal_ex.tpl.php didn't change , I update VirtueMart to 1.1.9.

But now, the error occurs in IE7, IE8 and IE9, while in VirtueMart 1.1.8, it only occurs in IE7 and IE8.
Title: Re: Paypal (new API) problems
Post by: ian999999 on July 05, 2011, 03:27:47 am
I am having this problem in Firefox 4 on OSX and Linux!

Using 1.9 and it is doing my head in!!!!

Anyone got a fix?
Title: Re: Paypal (new API) problems
Post by: ian999999 on July 05, 2011, 11:22:17 am
I do wonder if there is a fix for this... if not... Virtuemart is useless to me.
Title: Re: Paypal (new API) problems
Post by: ian999999 on July 06, 2011, 01:30:44 am
Well, I ended up butchering the code to get it working.

Anyone interested in it, I made the following butcher....

in file get_payment_method_ex.tpl.php

I just commented out

Code: [Select]
//echo ps_checkout::list_payment_methods( $payment_method_id );
at the end of the file.

So now:

You will need to select a couple of other payment options, but these will never show because the process will never display them.

I will say this, whilst it is appreciated someone has gone to the effort to make this component, it is NOT production ready and perhaps it shouldn't be included in the Virtuemart distribution until it is. If the original dev hasn't got time to work on it... scrap it.
Title: PayPal API Error if Less Than Two Other Payment Methods
Post by: rockbreaking on July 15, 2011, 01:41:34 am
Bug #230 (http://dev.virtuemart.net/issues/230 (http://dev.virtuemart.net/issues/230)) is entitled "PayPal API error if it's the only payment method available". 1.1.8

Unfortunately the Bug status is 'Closed' and incorrectly reported as fixed.  This may have been because its Description contained a link to the wrong Forum thread.  The correct forum thread is this one right here.

This issue remains in 1.1.9.

If the words "The PayPal (new API) module only works if you include at least two other payment modules with it" were added to the manual or the help menu, a lot of folks would be spared hours of trial-and-error.

In the mean time, a new bug report could be opened.
Title: Re: Paypal (new API) problems
Post by: m.iannozzi on July 18, 2011, 18:15:09 pm
Hello to all, I have finally solved it.
Problem is in VM 1.1.9 where is changed /administrator/components/com_virtuemart/classes/ps_checkout.php
This is not a a best way and you can use it if you use only paypal payment.

Open
/components/com_virtuemart/themes/simplecheckout/templates/checkout/get_payment_method_paypal_ex.tpl.php

and remove below code:

<?php

 echo ps_checkout::list_payment_methods( $payment_method_id );

?>

Then modify line below from
<input type="radio" id="paypalExpressID_ecm" name="payment_method_id" value="<?php echo ps_paypal_api::getPaymentMethodId();?>" />
to
<input type="radio" id="paypalExpressID_ecm" name="payment_method_id" value="<?php echo ps_paypal_api::getPaymentMethodId();?>" checked />

Best Regards.
Title: Re: Paypal (new API) problems
Post by: namfo on July 19, 2011, 10:03:07 am
Hi

I use the new pp_api and one additional Payment-Method. So I also had this bug. After searching a bit I found the bug.

The Bug is in  \administrator\components\com_virtuemart\classes\ps_checkout.php
All the Payment Methodes are counted. But in the PayPal API Part the counting is missing.
How to fix it?

Serach for
Code: [Select]

$db_pp->query($q);
if ($db_pp->next_record()) {
    $pp_payment=true;
    $first_payment_method_id = $db_pp->f("payment_method_id");

and add the line
Code: [Select]
   
$count += $db_pp->num_rows();

So the result looks like
Code: [Select]
   
$db_pp->query($q);
if ($db_pp->next_record()) {
    $pp_payment=true;
    $count += $db_pp->num_rows();
    $first_payment_method_id = $db_pp->f("payment_method_id");


Cheers Chrigu
Title: Re: Paypal (new API) problems
Post by: dougclark on July 20, 2011, 16:32:54 pm
Implemented this one but I am still getting the error...

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

I have 2 Payment methods in place: Paypal_api and WorldPay.

Any further advice welcome.
Regards
Title: Re: Paypal (new API) problems
Post by: seovisibly on August 03, 2011, 20:56:17 pm
i was hoping this thread would help my problem but it doesnt.

let me explain as clearly as possible:

firstly, let me say that everything works as it should on all browsers EXCEPT internet explorer (IE)

here is my problem with IE

i am using paypal api. i have 2 options with this for payment.
1. paypal - where it directs me to paypal to pay for product
2. credit option using paypal api - where i put all credit card information in and it processed it using paypal api in the background

right now, if i use the credit card option and enter all credit card info...it works!

however, if i click the paypal option and click next it gives me the "error: credit card number not found" as if i entered a bad credit card

AND if i do this

Open the file get_payment_method_paypal_ex.tpl.php in [JOOMLA_HOME]/components/com_virtuemart\themes\default\templates\checkout

Look for this code:

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />

and change for this

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="2" />

then paypal option works fine BUT now when i enter my credit card info and click next instead of taking me to the confirm page for the credit card it directs me to paypal instead as if i click the paypal radio button option.

it seems like IE cannot distinguish which radio button someone is choosing. it is either doing one or the other.

please help me fix asap. the site is live and this is driving me nuts.
Title: Re: Paypal (new API) problems
Post by: iio on August 09, 2011, 23:17:54 pm
Hi

I am pretty new to all this .... I have built a VM store and want to use Paypal as my only method - (using 1.5.23 & 1.17)

I have my PP merchant account set up nicely & am using the new_api

If I only have a single payment method the customer is never sent to the select payment method & then of course the sale fails as there are no credit card details

I have activated COD - which I don't support in practice & it has added a credit card option that is also not supported

I see there is plenty of discussion - but can anybody point me to an easy to implement solution (no coding skills but I can edit code if I have to..) that is 100% going to work

THANKS MILLIONS ;D in advance - this is mega frustrating - I would tear my hair out - but sadly that is no longer possible :)
Title: Re: Paypal (new API) problems
Post by: iio on August 11, 2011, 12:09:31 pm
Well, I ended up butchering the code to get it working.

Anyone interested in it, I made the following butcher....

in file get_payment_method_ex.tpl.php

I just commented out

Code: [Select]
//echo ps_checkout::list_payment_methods( $payment_method_id );
at the end of the file.

So now:
  • I can use the Paypal API on its own without any problems
  • I can use it as my sole payment method and still have it go through the cart steps without it throwing up credit card errors
  • I can actually get back to working on the rest of the store

You will need to select a couple of other payment options, but these will never show because the process will never display them.

I will say this, whilst it is appreciated someone has gone to the effort to make this component, it is NOT production ready and perhaps it shouldn't be included in the Virtuemart distribution until it is. If the original dev hasn't got time to work on it... scrap it.


What is the full path of this file - get_payment_method_ex.tpl.php _ I cant find it ......
Title: Re: Paypal (new API) problems
Post by: vijalesh on August 16, 2011, 09:26:50 am
Hi th path for this is

components/com_virtuemart/themes/default/templates/checkout/

as for ther updates i am still not sure if all these is going to work...
Title: Re: Paypal (new API) problems
Post by: iio on August 21, 2011, 13:08:10 pm
Hi th path for this is

components/com_virtuemart/themes/default/templates/checkout/

as for ther updates i am still not sure if all these is going to work...

Hi

Thanks for the path - I think that the butcher needs to happen in a different file in this path - get_payment_method_paypal_ex.tpl.php

The butcher is as described above - //echo ps_checkout::list_payment_methods( $payment_method_id );

Thanks for the help
Title: Re: Paypal (new API) problems
Post by: ewanvrooyen on September 08, 2011, 22:03:11 pm
this worked for me

http://forum.virtuemart.net/index.php?topic=84650.0
Title: Re: Paypal (new API) problems
Post by: ralfeez on September 10, 2011, 18:10:39 pm
I am trying to tag each of these discussion to hopefully follow any type of progress on this subject. Okay it looks like some people have found solutions that work for them. So far, I have not. I am using J1.5.23 and VM1.1.9. Nothing that I have seen so far will stop the dreaded "Error: Credit Card Number not found!" and still work with all of the other functions. I just want to use Paypal to collect funds. I also need Paypal to process a credit card without a Paypal account (but that is another subject). Someone needs to mark this as a bug and work on fixing it. If you need volunteers, let me know, but it has to be fixed to be able to use Virtuemart. I can't be the only one having this issue.
Thank you,
Ralph
Title: Re: Paypal (new API) problems
Post by: ATek on September 30, 2011, 07:52:44 am
Ralfeez - I have J1.5.23 and VM1.1.9 and I got it successfully working.  I am doing Paypal (New API) with NO other forms of payment.  Paypal Express Checkout DISABLED.  First check your settings with mine.  I have uploaded two pictures of what I have configured.  Obviously I blacked out my API Sig and other private details but you will get the basic idea.

I picked and chose two working fixes from the incredible amount of solutions out there.  Before doing the below solutions, IF you have a custom Virtuemart template such as VMJ Color your directories will have that name in them as opposed to "default". 

1. The first fix I did was:

Add this line of code ->
Code: [Select]
JHTML::script('joomla.javascript.js','includes/js/');
Here ->
Code: [Select]
/components/com_virtuemart/themes/default/templates/checkou/list_payment_methods.tpl.php 

2. Second fix I did was:

Comment out this line
Code: [Select]
echo ps_checkout::list_payment_methods( $payment_method_id );
From ->
Code: [Select]
components/com_virtuemart/themes/default/templates/checkout/
The result is now after step 2 in the checkout process it stops at step 3 and lets you choose Paypal, in my case it is the only choice so the buyer must simply click it.  Step 4 redirects them to Paypal where they finish the checkout, my secure header was also present on the Paypal website which is good, meaning the API is working.

Hope this helps someone out, was a pain to finally figure out but thanks to the bits and pieces on the web it finally was solved.  Good luck! Any more questions about my setup just ask.



[attachment cleanup by admin]
Title: Re: Paypal (new API) problems
Post by: DutchDisturbed on October 17, 2011, 21:18:19 pm
What if you do want other payment options? For example i'd like to allow a general bank transfer as well.

how come there is no solution yet, while the problem exists for so long? is it that difficult to solve?
Title: Re: Paypal (new API) problems
Post by: jinxyluv on October 25, 2011, 17:26:21 pm
i was hoping this thread would help my problem but it doesnt.

let me explain as clearly as possible:

firstly, let me say that everything works as it should on all browsers EXCEPT internet explorer (IE)

here is my problem with IE

i am using paypal api. i have 2 options with this for payment.
1. paypal - where it directs me to paypal to pay for product
2. credit option using paypal api - where i put all credit card information in and it processed it using paypal api in the background

right now, if i use the credit card option and enter all credit card info...it works!

however, if i click the paypal option and click next it gives me the "error: credit card number not found" as if i entered a bad credit card

AND if i do this

Open the file get_payment_method_paypal_ex.tpl.php in [JOOMLA_HOME]/components/com_virtuemart\themes\default\templates\checkout

Look for this code:

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />

and change for this

<input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="2" />

then paypal option works fine BUT now when i enter my credit card info and click next instead of taking me to the confirm page for the credit card it directs me to paypal instead as if i click the paypal radio button option.

it seems like IE cannot distinguish which radio button someone is choosing. it is either doing one or the other.

please help me fix asap. the site is live and this is driving me nuts.

Wahooooooooo!!!!! This worked! I use paypal api only and the paypal option was not showing up at step three of check out. I am not a programmer so I have been really confused at how to fix this. Thank You, Thank You!
BabyFull, LLC
Title: Re: Paypal (new API) problems
Post by: DutchDisturbed on October 25, 2011, 21:10:31 pm
I've found a solution that works for me! Go to
http://forum.virtuemart.net/index.php?topic=92068.0

to see my solution
Title: Paypal (new API) problems
Post by: ohonig on November 16, 2011, 15:19:36 pm
And the solution for paypal combined with other payments is:

javascript is since the beginning different in browsers. and the function window.addEvent("domready", function() with the 2cond click-listener does not work at least in IE8 correct. my solution was a simple old-stylish onclick="chMd()" in the radio-button:

               <input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />
               <input type="radio" onclick="chMd()" id="paypalExpressID_ecm" name="payment_method_id" value="4" />
               <img id="paypalLogo" src="https://www.paypal.com/de_DE/DE/i/logo/lockbox_150x47.gif" alt="PayPal Checkout Available" border="0" style="cursor:pointer;" /></a><script type="text/javascript">window.addEvent("domready", function() {
   $("paypalLogo").addEvent("click", function() {
      window.open('https://www.paypal.com/de/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=500');
      });   });function chMd() {
         if(document.getElementById("paypalExpressID_ecm").checked)
         {
            $("paypalExpress_ecm").value="2";
         }
         else
         {   
            $("paypalExpress_ecm").value="";
         }
}
 
   </script>

in get_payment_method_paypal_ex.tpl.php:

$html .= '<script type="text/javascript">window.addEvent("domready", function() {

   $("paypalLogo").addEvent("click", function() {

      window.open(\''.$paypal_infolink[$lang_iso].'\',\'olcwhatispaypal\',\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=500\');

      });
   });
function chMd() {
         if(document.getElementById("paypalExpressID_ecm").checked)

         {

            $("paypalExpress_ecm").value="2";

         }

         else

         {   

            $("paypalExpress_ecm").value="";

         }

}

   </script>';

?>

   <fieldset><legend><strong>PayPal</strong></legend>

      <table border="0" cellspacing="0" cellpadding="2" width="100%">

          <tr>

              <td>

               <input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />

               <input type="radio" onclick="chMd()" id="paypalExpressID_ecm" name="payment_method_id" value="<?php echo ps_paypal_api::getPaymentMethodId();?>" />
Title: Re: Paypal (new API) problems
Post by: paswan on November 17, 2011, 11:56:22 am
Here problem is that ,js is not  updating the value when paypal is checked.
So try this ,it works for me...........


 Replace all code of  get_payment_method_paypal_ex.tpl.php in [JOOMLA_HOME]/components/com_virtuemart\themes\yourTheme\templates\checkout             
 with the attached file code.



[attachment cleanup by admin]
Title: Re: Paypal (new API) problems
Post by: krofeta on November 19, 2011, 01:42:04 am
Here problem is that ,js is not  updating the value when paypal is checked.
So try this ,it works for me...........


 Replace all code of  get_payment_method_paypal_ex.tpl.php in [JOOMLA_HOME]/components/com_virtuemart\themes\yourTheme\templates\checkout             
 with the attached file code.



this is solution for 1.1.9
Title: Re: Paypal (new API) problems
Post by: marcel63 on November 19, 2011, 14:20:51 pm
I tried this and for me the error is still there. VM 1.1.9
Title: Re: Paypal (new API) problems
Post by: roblux on November 23, 2011, 06:58:23 am
Here problem is that ,js is not  updating the value when paypal is checked.
So try this ,it works for me...........


 Replace all code of  get_payment_method_paypal_ex.tpl.php in [JOOMLA_HOME]/components/com_virtuemart\themes\yourTheme\templates\checkout             
 with the attached file code.



Thank you Paswan. From error code credit card invaild to working like a treat.
Virtuemart 1.1.9


Its taken a huge amount of time to set the shop up with all prodducts and inf. to have to start looking around for another cart was almost beyond contemplation.

I hope this works as well for others.

Rob
Title: Re: Paypal (new API) problems
Post by: mvvessem on December 12, 2011, 17:35:39 pm
Is there still no solution for this?

Title: Re: Paypal (new API) problems
Post by: krofeta on December 18, 2011, 19:47:49 pm
And the solution for paypal combined with other payments is:

javascript is since the beginning different in browsers. and the function window.addEvent("domready", function() with the 2cond click-listener does not work at least in IE8 correct. my solution was a simple old-stylish onclick="chMd()" in the radio-button:

               <input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />
               <input type="radio" onclick="chMd()" id="paypalExpressID_ecm" name="payment_method_id" value="4" />
               <img id="paypalLogo" src="https://www.paypal.com/de_DE/DE/i/logo/lockbox_150x47.gif" alt="PayPal Checkout Available" border="0" style="cursor:pointer;" /></a><script type="text/javascript">window.addEvent("domready", function() {
   $("paypalLogo").addEvent("click", function() {
      window.open('https://www.paypal.com/de/cgi-bin/webscr?cmd=xpt/Marketing/popup/OLCWhatIsPayPal-outside','olcwhatispaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=500');
      });   });function chMd() {
         if(document.getElementById("paypalExpressID_ecm").checked)
         {
            $("paypalExpress_ecm").value="2";
         }
         else
         {   
            $("paypalExpress_ecm").value="";
         }
}
 
   </script>

in get_payment_method_paypal_ex.tpl.php:

$html .= '<script type="text/javascript">window.addEvent("domready", function() {

   $("paypalLogo").addEvent("click", function() {

      window.open(\''.$paypal_infolink[$lang_iso].'\',\'olcwhatispaypal\',\'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=500\');

      });
   });
function chMd() {
         if(document.getElementById("paypalExpressID_ecm").checked)

         {

            $("paypalExpress_ecm").value="2";

         }

         else

         {   

            $("paypalExpress_ecm").value="";

         }

}

   </script>';

?>

   <fieldset><legend><strong>PayPal</strong></legend>

      <table border="0" cellspacing="0" cellpadding="2" width="100%">

          <tr>

              <td>

               <input type="hidden" id="paypalExpress_ecm" name="payment_method_ppex" value="" />

               <input type="radio" onclick="chMd()" id="paypalExpressID_ecm" name="payment_method_id" value="<?php echo ps_paypal_api::getPaymentMethodId();?>" />


This code is a half of file? Please, provide full file in txt. Thanks!
Title: Re: Paypal (new API) problems
Post by: francisuan on December 23, 2011, 00:45:40 am
I found a very simple solution. In the "List payment methods" click on the paypal (new api) and use the "HTML-Form based (e.g. PayPal)" for the Payment method type.
Title: Re: Paypal (new API) problems
Post by: stAn99 on March 31, 2012, 16:38:15 pm
Hello, according to my experience: "Error: Credit Card Type not found" is a result of a conflicting configuration of paypal new api within VM payment class configuration. It seems that for paypal express to work together with direct payment some fictional credit card data must be sent to paypal. The problem with this method is much more complex and i generally recommend to use a commercial paypal pro extensions with full support. Another issue with paypal new api is when the userfields from paypal don't match the userfields within virtuemart (as VM uses more of them such fax, etc... ).

Best Regards,
Stan
Title: Re: Paypal (new API) problems
Post by: fbc on April 01, 2012, 18:43:17 pm
We may have fixed the credit card errors issue, but, currency problems still exist. When selecting EUR as a currency the API still charges them in USD. In the old API you just went in and changed:
Code: [Select]
// "currency_code" => $_SESSION['vendor_currency'],
"currency_code" => $db->f('order_currency'),

In the new API I don't think it's going to be that easy.
Title: Re: Paypal (new API) problems
Post by: lektrokuted on January 18, 2013, 19:11:05 pm
Hello to all, I have finally solved it.
Problem is in VM 1.1.9 where is changed /administrator/components/com_virtuemart/classes/ps_checkout.php
This is not a a best way and you can use it if you use only paypal payment.

Open
/components/com_virtuemart/themes/simplecheckout/templates/checkout/get_payment_method_paypal_ex.tpl.php

and remove below code:

<?php

 echo ps_checkout::list_payment_methods( $payment_method_id );

?>

Then modify line below from
<input type="radio" id="paypalExpressID_ecm" name="payment_method_id" value="<?php echo ps_paypal_api::getPaymentMethodId();?>" />
to
<input type="radio" id="paypalExpressID_ecm" name="payment_method_id" value="<?php echo ps_paypal_api::getPaymentMethodId();?>" checked />

Best Regards.

Hello, I only registered on the forum to say a big thank you for the solution!!! :-)
Title: Re: Paypal (new API) problems
Post by: lejeannotfr on May 11, 2013, 19:21:12 pm
has we use to say in France : "une belle usine à gaz"... qu'il faut débugguer version aprés version!  ::)
i have a similar problem since weeks without any solution, i've tried on about 4 forums to find help, i would need to pay a developer to find a solution.
my cart is in 3 steps, i use only paypal integral evolution with the standard html configuration of VM, and in the last step, when i click on the the button to go on the paypal payment, i have the single screen showing that the order is ok but the payment has not been done by the customer... not serious. This bug is on IE8, safari and chrome, either in http or https mode... impossible to solve, nobody knows where that bug can come from... incredible.


[attachment cleanup by admin]
Title: Re: Paypal (new API) problems
Post by: stinga on May 15, 2013, 13:56:03 pm
The redirect is not working, so it goes to this page rather than paypal.
Shouldn't be hard to fix.
Not sure if the new api uses the pp extra info fields or some other method. We use the old paypal method seems to work so why break it?! :-)
Title: Re: Paypal (new API) problems
Post by: lejeannotfr on May 22, 2013, 15:25:22 pm
hi, i'm not a developper i used all the codes i already found into this forum. What you're telling me is impossible to debug for me, i've never changed the code of my paypal configuration for payment, what i discovered is that this problem never happened in VM 1.1.6, it only happens since i update to 1.1.9 (joomla 1.5.26), then i don't see how i could discover a solution alone...  ???
Title: Re: Paypal (new API) problems
Post by: stinga on June 06, 2013, 12:12:04 pm
you will probably need a programmer to cast their beady eye over the code to determine what is going on.
Title: Re: Paypal (new API) problems
Post by: lejeannotfr on June 06, 2013, 16:48:32 pm
you will probably need a programmer to cast their beady eye over the code to determine what is going on.

Thanks for your answer...
You told that : "The redirect is not working, so it goes to this page rather than paypal. Shouldn't be hard to fix."
I said that the redirection was working, but before you get to paypal payment page, I begins with this page first. This problem happens only in "chrome", Safari and IE9, not with Firefox. And it happens since i'm in 1.1.9...Before that I did not have this problem.
I also said that my shopping in 3 steps, not 4 ... that he has consequences?

Now pay a developer for that, to be honest I prefer this : given the time spent managing problems and bugs with virtuemart (even for its updates) if I have to pay me a developer, it will migrate to another CMS more suited to e-commerce and more professional level monitoring. With Joomla and VM when a new version comes out, nobody wants to take support within 6 months. It is not possible at the level of sales professionals online, too many incompatibilities between all needed components and VM to run a store professionnaly. You must update all your website every week!! It's impossible to manage like this a live shop. Thank you for answering me but telling me to pay a developper, this one will meet the same problem and it won't read all your code to find the problem. So it is unwise to pay a professional to find a solution. ???

I work in the internet since 15 years, i wanted to start my first own shop with joomla and VM but since 2 years i work on it, I've never had the same sense of being powerless to operate correctly a store with joomla and all its components. Knowing that I lost a lot of time to get a proper layout with my template.

Profitability, VM is very questionable. Even paypal Support refuses to help VM users (the tell to see on this forum to find a solution).  :o
In my place what would you do? Becoming a developer to use correctly VM? Why using open source CMS?  :-\
Title: Re: Paypal (new API) problems
Post by: jenkinhill on June 06, 2013, 17:10:30 pm
I think you are stuck because you are using an old version of Joomla and VirtueMart rather than the current versions. Updates in browsers and then php versions on hosts can cause problems, and recently PayPal themselves changed their protocols which have cause some old eCommerce software to stop working properly. In the current VM2 version the PayPal issues have been dealt with but there are no longer developers working on the 1.1 series as the CMS platform, Joomla 1.5 is no longer supported by joomla.org

I can't offer solutions as I no longer have any VM1.1.9 sites to test on.

A programmer may be able to get the system running again for you, but after a while it becomes no longer something that can be fixed without updating to the current VM version or as you say, migrating to another platform. Magento (http://www.magentocommerce.com) is really good, but needs a lot of time spent to get working properly - and even then you will have updates to deal with every couple of months or so.
Title: Re: Paypal (new API) problems
Post by: AH on June 06, 2013, 20:34:41 pm
No matter what you choose, you have to be prepared to do some work on updates. We would all like the software to be stable and last for years but that is not going to happen!  E-commerce is changing relentlessly, we keep up or get out of the game.
Title: Re: Paypal (new API) problems
Post by: lejeannotfr on June 07, 2013, 10:38:56 am
This is a strange argument you are defending: It is as if Microsoft or Apple refused to provide any updates to Windows Vista or MacOSX under one pretext that a new version is available on the market? What do you do in anticipation of your applications? Prestashop for example offers a support for the 4 last versions of its CMS edited since 2 years! At the opposite, all the Joomla community and VM says : "no upgrade = no support".  ??? This reasoning can not be applied to e-commerce, e-shops have specific constraints. If you had yourself a VM shop to manage every day, you may realize that you couldn't waste weeks working on updates and debugs while the problem concerns only one page in your shop! I started 2 years ago with VM 1.1.2, i have spent many many many days to update to 1.1.9, and solve problem with other components, modules, plugins, and problems with the server, and with the hosting provider, and more. I saw that some bugs meet in the 1.1.6 were always existing in the update 1.1.9. :o  And then you can confirm that updagrading to V2 will solve all problems?

Your never considered that when your shop is running and must be upgraded at this stage, you must upgrade all your applications : Buy a new template, buy upgrades of commercial components, spend weeks to resolve all problems and debug the new version that is supposed to be up to date, etc etc. My version works fine except for this little issue i raised in this topic. Ultimately what you suggest is to redo an entire and complete, brand new shop from scratch, and so work weeks to do so. This is why even if i should do so, i would prefer switching to another CMS and avoid having this kind of issues in the future.

Thanks for your answers.