Jump to content

How to make PayPal v1.4 goes directly on the CreditCard payment page


dpryszku
 Share

Recommended Posts

Hi,

I am using PrestaShop for a couple of month and after a branding process it comes pretty funky.
I am using PayPal as the main payment module and i would like to know if it is possible to change its "on clic" behaviour.
As the first page of PayPal that appears for the payment process shows the paypal logon bigger that the link for Credit Card payment without paypal account, i would like to change the Module behaviour by going directly to the page for Credit Card payment.

After a quick look at the URL called, the only difference is the # sign at the end.

Any Idea ?

Thanks for your help
DAviD


--https://www.paypal.com/ch/cgi-bin/webscr?cmd=_flow&SESSION=LDx-----de6

--https://www.paypal.com/ch/cgi-bin/webscr?cmd=_flow&SESSION=LDx-----de6#

7042_2CrWKBGZDpaJcNQO1JVX_t

7043_WgmCsLSukOyTkgwqpPB5_t

Share this post


Link to post
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

I know some web site where this paypal page is the one which opens. I don't know if they are based on Prestashop.. For example, that's the case for www.chateauonline.com
If someone knows how to do it I am really interested too.

Share this post


Link to post
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

After spending hours on the phone with the folks at PayPal, here's the deal (for all of us USA kids):

With a standard PayPal account:

A user will be taken directly to the page to enter their credit card info IF AND ONLY IF they DO NOT have a PayPal account associated with their email address. If PayPal recognizes the email address, they will be taken to the dreaded "PayPal login" page.

So for all of the countless people who used PayPal once a couple years ago for some eBay purchase, and have long forgotten their account information, this is a major problem.

The ONLY way around this is to get a PayPal Pro account, which sadly, PrestaShop does not seem to support for the good ol' US of A.

Really sux to have discovered this after hundreds of hours trying to get this shop up and running. My client is quite unhappy, and looks like we may have to ditch PrestaShop if a module isn't available...like...yesterday.


Sorry gang.


And hey. If I'm wrong (God, I hope I am), somebody pleeeease let me know!

Share this post


Link to post
Share on other sites

  • 1 month later...

Hi all,

It's even easyer then that.

It's simply a cookie system.

If you already have a PayPal account and you did not clean the cookies recently, you will not see the form where you can pay with the credit card.
PayPal will populate the page with your email address.

If you do not have a PayPal account or if you have cleared your cookies and cache, you will have access to the form.

Using the API (from Prestashop 1.2 ) you will be able to force the form to appear.

Share this post


Link to post
Share on other sites

  • 2 weeks later...
Hi all,

It's even easyer then that.

It's simply a cookie system.

If you already have a PayPal account and you did not clean the cookies recently, you will not see the form where you can pay with the credit card.
PayPal will populate the page with your email address.

If you do not have a PayPal account or if you have cleared your cookies and cache, you will have access to the form.

Using the API (from Prestashop 1.2 ) you will be able to force the form to appear.


Hi Jazz, Good find out. I was wondering this too. but how do you force the API (v1.0) to use credit card form? I am using v1.2.2. when cookie enable, my email is filled there and I can't see the credit card option. I am using API v1.0 with sandbox mode.

Thanks

Share this post


Link to post
Share on other sites

Hi AngelofHaovc,

You will be able to force the Credit card form to appear but you will never be able to hide the PayPal login box.

In order to force the Form to show you will need to modify the PayPal API module
basically you need to add the following code

$paymentType = 'Sale'
and
'&LANDINGPAGE;='.$landingPage



Follow the example bellow

1st you will modify the PayPalExpress.php that you will find here:
root\modules\paypalapi\payment\PaypalPayment.php

from line 29

       // Making request
       $returnURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/paypalapi/express/submit.php';
       $cancelURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'order.php';
       $paymentAmount = number_format(floatval($cart->getOrderTotal()), 2, '.', '');
       $currencyCodeType = strval($currency->iso_code);
       $paymentType = 'Sale';
       $landingPage = 'Billing';
       $request = '&Amt;='.urlencode($paymentAmount).'&PAYMENTACTION;='.urlencode($paymentType).'&ReturnUrl;='.urlencode($returnURL).'&CANCELURL;='.urlencode($cancelURL).'&CURRENCYCODE;='.urlencode($currencyCodeType).'&LANDINGPAGE;='.$landingPage;
       if ($this->_header) $request .= '&HDRIMG;='.urlencode($this->_header);


Then you will need to modify the same thing in the file PayPalPayment.php
you will find it here:
root\modules\paypalapi\payment\PaypalPayment.php
From line 18

// Making request
       $vars = '?fromPayPal=1';
       $returnURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/paypalapi/payment/submit.php'.$vars;
       $cancelURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'order.php';
       $paymentAmount = number_format(floatval($cart->getOrderTotal()), 2, '.', '');
       $currencyCodeType = strval($currency->iso_code);
       $paymentType = 'Sale';
       $landingPage = 'Billing';
       $request = '&Amt;='.urlencode($paymentAmount).'&PAYMENTACTION;='.urlencode($paymentType).'&ReturnUrl;='.urlencode($returnURL).'&CANCELURL;='.urlencode($cancelURL).'&CURRENCYCODE;='.urlencode($currencyCodeType).'&NOSHIPPING=1'.'&LANDINGPAGE;='.$landingPage;
       if ($this->_header)
           $request .= '&HDRIMG;='.urlencode($this->_header);



I would Have prefer to highlight the code in the example but i could not find a way to do it on the forum.
Let me know if this answer your question.

Share this post


Link to post
Share on other sites

Hm, I tried what you said jazz and i keep receiving this error message:



Please refer to logs:

1. Making new connection to 'api-3t.sandbox.paypal.com/nvp'
2. Connect with CURL method sucessfull
3. Sending this params:
4. METHOD=SetExpressCheckout&VERSION=53.0&PWD;=*********&USER=lifeisgrimey_api1.gmail.com&SIGNATURE;=*********&Amt=45.80&PAYMENTACTION=Sale&ReturnUrl=http://www.grimeylife.com/prestashop/modules/paypalapi/payment/submit.php?fromPayPal=1&CANCELURL=http://www.grimeylife.com/prestashop/order.php&CURRENCYCODE=USD&NOSHIPPING=1&LANDINGPAGE;=Billing
5. Send with CURL method sucessfull
6. PayPal response:
7. TIMESTAMP -> 2009-09-27T00:40:55Z
8. CORRELATIONID -> 85669d47c0367
9. ACK -> Failure
10. VERSION -> 53.0
11. BUILD -> 000000
12. L_ERRORCODE0 -> 10002
13. L_SHORTMESSAGE0 -> Security error
14. L_LONGMESSAGE0 -> Security header is not valid
15. L_SEVERITYCODE0 -> Error
16. PayPal returned error

« Back


Something about a security error. Any ideas?

Share this post


Link to post
Share on other sites

Hi,

this error means that your API signature is not correct.
Maybe are you using a live signature on the sandbox platform or the opposite

Checking my previous message, i'have seen some errors in the code posted
I tried to correct it but each time a full stop is added to the variable.
for example '&CURRENCYCODE;=' should be without the ";"

basically the code you need to add to your files are:
$landingPage = 'Billing';
and
.'&LANDINGPAGE;='.$landingPage;

without the ";" after LANDINGPAGE
Let me know if i'm not clear or if you have an idea how i can remove the ";"

Share this post


Link to post
Share on other sites

  • 3 weeks later...
  • 2 months later...
  • 3 months later...
  • 3 years later...

I was wondering about the same issue, and found a solution that worked for me. Using PS 1.4.9 and paypal module v. 3.0.11.

 

Find paypal_express_checkout.php (this folder: paypal/express_checkout) and change line 169:

 

$fields['LANDINGPAGE'] = 'Login';

 

to

 

$fields['LANDINGPAGE'] = 'billing';

Share this post


Link to post
Share on other sites

  • 5 months later...
  • 1 year later...

You can change the landing page in the file process.php located in /modules/paypal/express_checkout/process.php.

 

Change the login value of LANDINGPAGE to Billing. DONE

 

 

I use this solution on the last versione of paypal module on prestashop 1.6 but i got error when I try to pay with paypal..

 

Any Ideas?

Share this post


Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More