2

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?

2
  • Open html code of paypal redirect page. Check if redirect url is correct or nor, check if post form parameters are standard or nor. Maybe your Paypal module version required updating.
    – mageUz
    Jun 12, 2013 at 6:01
  • ok. see the updates in the question.. I have added it there Jun 12, 2013 at 8:19

3 Answers 3

1

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.

1

Find app / design / frontend / (your template name) / template / checkout / onepage / review / info.phtml and around line number 60 replace...

<script type="text/javascript">
    //<![CDATA[
        review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder') ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
    //]]>
</script>

..with this...

<script type="text/javascript">
//<![CDATA[
    review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
//]]>
</script>

if it is not working please try to replace the code from the base theme to your custom theme..i hope this time your problem will be solved.

1
0

Login into your adminpanel..

goto: system->configuration->advanced->advanced enable this "Mage_Paypal" option

i hope this will solve you issue.

5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.