Permalink
Browse files

Change PayPal API URL include cgi-bin before webscr

Test if fix suggested in forum works
http://forum.oxid-esales.com/showthread.php?t=27881
  • Loading branch information...
stasiukaitis-saulius committed Oct 16, 2015
1 parent a55f886 commit d93fecd8d864f6cd599616628dfb84d6b2961513
@@ -50,14 +50,14 @@ class oePayPalConfig
*
* @var string
*/
protected $_sPayPalSandboxUrl = 'https://www.sandbox.paypal.com/webscr';
protected $_sPayPalSandboxUrl = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
/**
* PayPal Url where user must be redirected after his session gets PayPal token.
*
* @var string
*/
protected $_sPayPalUrl = 'https://www.paypal.com/webscr';
protected $_sPayPalUrl = 'https://www.paypal.com/cgi-bin/webscr';
/**
* PayPal sandbox API url.
@@ -129,7 +129,7 @@ public function testSetExpressCheckout_onSuccess()
$oResult = new oePayPalResponseSetExpressCheckout();
$oResult->setData(array('TOKEN' => 'token'));
$sUrl = "https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=token";
$sUrl = "https://www.sandbox.paypal.com/cgi-bin/webscr&cmd=_express-checkout&token=token";
//utils
$oUtils = $this->getMock("oxUtils", array("redirect"));
@@ -313,7 +313,7 @@ public function testGetPayPalSandboxUrl_setWithSetter_setValue()
public function testGetPayPalSandboxUrl_default_definedClassAttribute()
{
$oConfig = new oePayPalConfig();
$this->assertEquals('https://www.sandbox.paypal.com/webscr', $oConfig->getPayPalSandboxUrl());
$this->assertEquals('https://www.sandbox.paypal.com/cgi-bin/webscr', $oConfig->getPayPalSandboxUrl());
}
public function testGetPayPalSandboxUrl_overrideWithConfig_configValue()
@@ -334,7 +334,7 @@ public function testGetPayPalUrl_setWithSetter_setValue()
public function testGetPayPalUrl_default_definedClassAttribute()
{
$oConfig = new oePayPalConfig();
$this->assertEquals('https://www.paypal.com/webscr', $oConfig->getPayPalUrl());
$this->assertEquals('https://www.paypal.com/cgi-bin/webscr', $oConfig->getPayPalUrl());
}
public function testGetPayPalUrl_overrideWithConfig_configValue()
@@ -347,10 +347,10 @@ public function testGetPayPalUrl_overrideWithConfig_configValue()
public function providerGetPayPalCommunicationUrl()
{
return array(
array(true, null, null, 'TestToken', 'continue', 'https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=TestToken&useraction=continue'),
array(false, null, null, 'TestToken', 'commit', 'https://www.paypal.com/webscr&cmd=_express-checkout&token=TestToken&useraction=commit'),
array(true, null, 'paypalApiUrl', 'TestToken1', 'commit', 'https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=TestToken1&useraction=commit'),
array(false, 'sandboxApiUrl', null, 'TestToken1', 'continue', 'https://www.paypal.com/webscr&cmd=_express-checkout&token=TestToken1&useraction=continue'),
array(true, null, null, 'TestToken', 'continue', 'https://www.sandbox.paypal.com/cgi-bin/webscr&cmd=_express-checkout&token=TestToken&useraction=continue'),
array(false, null, null, 'TestToken', 'commit', 'https://www.paypal.com/cgi-bin/webscr&cmd=_express-checkout&token=TestToken&useraction=commit'),
array(true, null, 'paypalApiUrl', 'TestToken1', 'commit', 'https://www.sandbox.paypal.com/cgi-bin/webscr&cmd=_express-checkout&token=TestToken1&useraction=commit'),
array(false, 'sandboxApiUrl', null, 'TestToken1', 'continue', 'https://www.paypal.com/cgi-bin/webscr&cmd=_express-checkout&token=TestToken1&useraction=continue'),
array(true, 'sandboxApiUrl', 'paypalApiUrl', 'TestToken2', 'action', 'sandboxApiUrl&cmd=_express-checkout&token=TestToken2&useraction=action'),
array(false, 'sandboxApiUrl', 'paypalApiUrl', 'TestToken2', 'action', 'paypalApiUrl&cmd=_express-checkout&token=TestToken2&useraction=action'),
);
@@ -541,7 +541,7 @@ public function testGetIPNResponseUrl_sandboxOFF_usePayPalUrl()
$this->getConfig()->setConfigParam('blOEPayPalSandboxMode', false);
$oConfig = new oePayPalConfig();
$this->assertEquals($oConfig->getIPNResponseUrl(), 'https://www.paypal.com/webscr&cmd=_notify-validate');
$this->assertEquals($oConfig->getIPNResponseUrl(), 'https://www.paypal.com/cgi-bin/webscr&cmd=_notify-validate');
}
/**
@@ -552,7 +552,7 @@ public function testGetIPNResponseUrl_sandboxON_useSandboxUrl()
$this->getConfig()->setConfigParam('blOEPayPalSandboxMode', true);
$oConfig = new oePayPalConfig();
$this->assertEquals($oConfig->getIPNResponseUrl(), 'https://www.sandbox.paypal.com/webscr&cmd=_notify-validate');
$this->assertEquals($oConfig->getIPNResponseUrl(), 'https://www.sandbox.paypal.com/cgi-bin/webscr&cmd=_notify-validate');
}
/**
@@ -563,7 +563,7 @@ public function testGetUrl_sandboxOFF_returnPayPalUrl()
$this->getConfig()->setConfigParam('blOEPayPalSandboxMode', false);
$oConfig = new oePayPalConfig();
$this->assertEquals($oConfig->getUrl(), 'https://www.paypal.com/webscr');
$this->assertEquals($oConfig->getUrl(), 'https://www.paypal.com/cgi-bin/webscr');
}
/**
@@ -574,7 +574,7 @@ public function testGetUrl_sandboxON_returnSandboxUrl()
$this->getConfig()->setConfigParam('blOEPayPalSandboxMode', true);
$oConfig = new oePayPalConfig();
$this->assertEquals($oConfig->getUrl(), 'https://www.sandbox.paypal.com/webscr');
$this->assertEquals($oConfig->getUrl(), 'https://www.sandbox.paypal.com/cgi-bin/webscr');
}
/**

0 comments on commit d93fecd

Please sign in to comment.