• My account
    • (X)Sign in

      I am a returning customer at TYPO3 Multishop

      Enter your username and password here in order to log in on the website:

      Forgot your password?

      Not yet customer of TYPO3 Multishop?

      • Order history
      • Automatic generated e-mail history
      • Track your Order
      New at TYPO3 Multishop
You are here:

Help by translating Multishop in your local language

On the following page you can help by translating Multishop in your local language:

https://translation.typo3.org/projects/TYPO3.ext.multishop/

Spanish:

https://translation.typo3.org/es/TYPO3.ext.multishop/pi1/locallang.xlf

The following language are already translated by our supporters:

  • Dutch
  • German
  • French

Paypal NS API


Author Message
marceo
Marco
Multishop newbie
Topic creator
registered since: 03.02.2012
Posts: 1
Hi,

seems like there was a Paypal API change.

In core.php you open a socket like this:

PHP
$fp = fsockopen ('www.sandbox.paypal.com', 80, $errno, $errstr, 30);


If I use that I will only get an reply 'HTTP/1.1 302 Found'

New Paypal API says to open a socket with SSL:

PHP
$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);


Here I get an 'HTTP/1.1 200 OK' as return.
And in the 'while' loop only first row of the response gets compared with 'VERIFIED'/'INVALID'.

But the return has more then 1 row and in the last row there is the status ('VERIFIED'/'INVALID').

So I had to delete/uncomment the 'die()' calls.

So it looks like this:

PHP
fputs ($fp, $header . $req);
while (!feof($fp))
{
	$res = fgets ($fp, 1024);
 
	if (strcmp ($res, "VERIFIED&quot<img src="typo3conf/ext/mm_forum//res/smilies/icon_wink.gif" alt="icon_wink.gif" /> == 0)
	{
		// check the payment_status is Completed
		// check that txn_id has not been previously processed
		// check that receiver_email is your Primary PayPal email
		// check that payment_amount/payment_currency are correct
		// process payment
		if ($post["payment_status"] == 'Completed' and $post["custom"])
		{
			$orders_id=mslib_fe::getOrdersIdByTransactionId($post['custom'],'paypal');
			mslib_fe::updateOrderStatusToPayed($orders_id);
		}
	}
	else if (strcmp ($res, "INVALID&quot<img src="typo3conf/ext/mm_forum//res/smilies/icon_wink.gif" alt="icon_wink.gif" /> == 0)
	{
		// log for manual investigation
		//mail($ms['MODULES']['STORE_EMAIL'],$HTTP_HOST.' PAYPAL PAYMENT ERROR',print_r($post,1).$HTTP_RAW_POST_DATA,'');
		//die();
	}
	else
	{
		//mail($ms['MODULES']['STORE_EMAIL'],$HTTP_HOST.' PAYPAL PAYMENT ERROR',print_r($post,1).$HTTP_RAW_POST_DATA,'');
		//die();
	}
}


So all rows of $fp will be compared with 'VERIFIED'/'INVALID'.

see: [url=]https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNImplementation[/url]


Can anyone confirm this? Or am I doing it all wrong?

Greetings
Marco

PS: I made an payment module for Acceptance/Paytool. I would like to share it after it passes the testing phase.

[This article was edited 1 times, at last 03.02.2012 at 13:19.]
Written on: 03. 02. 2012 [13:17]
bas
Bas van Beek
Multishop guru
registered since: 12.05.2010
Posts: 644
Excellent. I will follow this up shortly, thanks.
Written on: 05. 02. 2012 [13:30]
bas
Bas van Beek
Multishop guru
registered since: 12.05.2010
Posts: 644
Confirmed and added to 2.0.21
Written on: 10. 02. 2012 [19:04]