Magento – Magento 1.6 – Paypal Standard is not taking to paypal Payment page

magento-1.6payment-gatewaypaypal

My Magento 1.6 settings with paypal is not working at all. I am trying to setup Website Payments Standard however its not working. Its taking me to https://www.sandbox.paypal.com/home instead of the Payment page (similar is the issue without sandbox, i.e. with live).

here is what is already done:

  1. I have setup the developer's account at the new https://developer.paypal.com
  2. created sellers and buyers test accounts there
  3. setup seller's needed basic info at https://www.sandbox.paypal.com/ (such as Page Style and IPN)..
  4. enabled mage_paypal at magento admin
  5. enabled 'Website Payments Standard' at Paypal section at magento admin and setup all the relevant settings as needed.

Now, I can see the paypal payment option at the checkout page (onepage), but when I click on "Place order" at Order Review section, it takes me to the black page and says that its redirecting me to paypal… then it takes me to https://www.sandbox.paypal.com/home instead of payment page.

I think this is due to new changes in Paypal system and also due to the magento system because we have used paypal standard so many times on regular custom websites but never seen this….


[UPDATES]
Here is the form on the redirect page:

<form action="https://www.sandbox.paypal.com/webscr" id="paypal_standard_checkout" 
name="paypal_standard_checkout" method="POST">
<input name="form_key" type="hidden" value="**********" />
</form>

As you can see, it not the regular form of paypal we are used to…. So either its an issue with magento, or maybe its suppose to be like this….


Can anyone tell me what to do?

Best Answer

The action for this form is set in the file Mage_Paypal_Block_Standard_Redirect::_toHtml. Here the form is created and the action is added via the following snippet:

$form->setAction($standard->getConfig()->getPaypalUrl())
    ->setId('paypal_standard_checkout')
    ->setName('paypal_standard_checkout')
    ->setMethod('POST')
    ->setUseContainer(true);

The function for getting the path to paypal will simply perform a sprintf and replace some items based on if you are using the sandbox or if you are passing in parameters.

public function getPaypalUrl(array $params = array())
{
    return sprintf('https://www.%spaypal.com/webscr%s',
        $this->sandboxFlag ? 'sandbox.' : '',
        $params ? '?' . http_build_query($params) : ''
    );
}

It appears that in newer versions of Magento this url has been changed, in Mage 1.9 the functions looks as follows.

public function getPaypalUrl(array $params = array())
{
    return sprintf('https://www.%spaypal.com/cgi-bin/webscr%s',
        $this->sandboxFlag ? 'sandbox.' : '',
        $params ? '?' . http_build_query($params) : ''
    );
}

What I would do firstly is try updating your system to use the url https://www.%spaypal.com/cgi-bin/webscr%s to see if that works.

Related Topic