|
![Post Reply Post Reply](images/reply.gif) |
paypal updates ... |
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
![](images/spacer.gif) |
|
I had to change the webshop code because of the upcoming changes at paypal. changes at paypal will be effective on 1st of february. in sandbox mode everything works smoothly. after purchase you are redirected to a download page. additionally the download links are sent to the address the payment came from. but I'd appreciate it, if someone could verify if everything works as it should in life mode. I noticed that recent purchases were not downloaded from the download page but from the email. so there still could be a problem with the setup ...
|
|
01-18-2013 18:17 |
|
|
potk
Super Moderator/One-Shoe Guru
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
![images/avatars/avatar-46.jpg](images/avatars/avatar-46.jpg)
Registration Date: 04-05-2011
Posts: 359
![](images/spacer.gif) |
|
I had just made a purchase earlier in the week (my last purchase was before the new year) and didn't really notice anything different. Only thing I noticed was that it took a little longer to get the code after I had gotten the receipt (about 10 minutes).
What changes are PayPal supposed to be making anyway?
EDIT: After reading the Member's Section I now understand what was going on with the emails.
__________________ http://p-o-t-k.deviantart.com/
![](http://i.imgur.com/q39vMKh.png)
|
|
01-18-2013 22:16 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
quote: |
Originally posted by potk
I had just made a purchase earlier in the week (my last purchase was before the new year) and didn't really notice anything different. Only thing I noticed was that it took a little longer to get the code after I had gotten the receipt (about 10 minutes).
What changes are PayPal supposed to be making anyway?
EDIT: After reading the Member's Section I now understand what was going on with the emails. |
thanks for answering. if it took longer it probably already was manually sent. I tried to respond as quickly as possible just in case that main download page was not working for some reason.
paypal changes are only important for merchants not for customers. I got the changes just in german but I try to translate the core parts:
paypal expands amount of IP addresses for paypal.com to improve overall performance. therefore they don't support HTTP 1.0 protocol anymore. this means that for IPN (necessary for direct download after payment) the headers have to be updated to HTTP 1.1
PHP - example:
// post back to PayPal system to validate
$header .="POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .="Content-Type: application/x-www-form-urlencoded\r\n";
$header .="Host: www.paypal.com\r\n";
sounds easy, but isn't. lots of people are having trouble with that update. sometimes it works in sandbox environment but doesn't when you go live with the new code ...
|
|
01-20-2013 14:05 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
right now nobody seems to receive automated emails. and what's even worse, as they don't download from that download page that they are supposed to be redirected to, it looks as if they additionally end up on a blank page. I try to send out manual links as fast as I can, but of course this often means delay of a couple of hours. at the moment I don't know what I can do about it. I really might have to close down the wesite until this is permanently solved ...
I know those emails are sent out correctly as I always receive a duplicate myself. gmail is still blocking the ip. but recently I got some new customers from italy with different email providers and nothing seems to work. if anyone can tell me what happens to those emails I'd appreciate it ...
|
|
01-20-2013 21:34 |
|
|
potk
Super Moderator/One-Shoe Guru
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
![images/avatars/avatar-46.jpg](images/avatars/avatar-46.jpg)
Registration Date: 04-05-2011
Posts: 359
![](images/spacer.gif) |
|
If it's OK with you, I'd like to see if I can do something about the situation, since I helped re-organize the main site. How different is .php from .html?
__________________ http://p-o-t-k.deviantart.com/
![](http://i.imgur.com/q39vMKh.png)
|
|
02-04-2013 17:00 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
this is something utterly different. but thank you for your kind offer.
here is a brief php code example:
// STEP 1: Read POST data
// reading posted data from directly from $_POST causes serialization
// issues with array data in POST
// reading raw POST data from input stream instead.
$raw_post_data = file_get_contents('php://input');
$raw_post_array = explode('&', $raw_post_data);
$myPost = array();
foreach ($raw_post_array as $keyval) {
$keyval = explode ('=', $keyval);
if (count($keyval) == 2)
$myPost[$keyval[0]] = urldecode($keyval[1]);
}
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
if(function_exists('get_magic_quotes_gpc')) {
$get_magic_quotes_exists = true;
}
foreach ($myPost as $key => $value) {
if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {
$value = urlencode(stripslashes($value));
} else {
$value = urlencode($value);
}
$req .= "&$key=$value";
}
// STEP 2: Post IPN data back to paypal to validate
// sandbox
$ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
// regular
// $ch = curl_init('https://www.paypal.com/cgi-bin/webscr');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
// In wamp like environments that do not come bundled with root authority certificates,
// please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path
// of the certificate as shown below.
// curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');
if( !($res = curl_exec($ch)) ) {
// error_log("Got " . curl_error($ch) . " when processing IPN data");
curl_close($ch);
exit;
}
curl_close($ch);
if you can read and understand this I can send you the full code. but the main problem is, that when tested in paypal sandbox environment it often gets different results than when going live. in sandbox environment I never got a blank page while testing ...
|
|
02-04-2013 17:54 |
|
|
potk
Super Moderator/One-Shoe Guru
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
![images/avatars/avatar-46.jpg](images/avatars/avatar-46.jpg)
Registration Date: 04-05-2011
Posts: 359
![](images/spacer.gif) |
|
Yeah, that looks a bit too out of my league.
I'll still see if I can do some reasearch about it to help you out, though.
__________________ http://p-o-t-k.deviantart.com/
![](http://i.imgur.com/q39vMKh.png)
|
|
02-04-2013 19:27 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
lots of people have that kind of problems. if you google for "paypal blank page" you find many postings. but when I go through them I never find a clear solution ...
and the code itself is best found if you google "php redirect paypal"
paypal itself gives some brief sample codes that should work. but then you find comments saying this doesn't work either. or it works smoothly in sandbox but not live ...
if you really want to look at this it would be best to create your own sandbox account at paypal. then you can test the code. I just don't remember if you can do that with a simple buyer account
|
|
02-04-2013 20:48 |
|
|
Mandrake
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
![images/avatars/avatar-36.jpg](images/avatars/avatar-36.jpg)
Registration Date: 03-03-2010
Posts: 1,000
Location: NY
![](images/spacer.gif) |
|
This looks complicated and I'm not familiar enough with PHP, or the way this system works to offer a solution.
Is there a tool to debug the code and find exactly where it's failing? If not, is there a way you can add something like print line statements periodically to debug it manually?
|
|
02-04-2013 21:35 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
quote: |
Originally posted by Mandrake
This looks complicated and I'm not familiar enough with PHP, or the way this system works to offer a solution.
Is there a tool to debug the code and find exactly where it's failing? If not, is there a way you can add something like print line statements periodically to debug it manually? |
I have no idea. I use php only in form of ready made code snippets and adapt them. this works fine as long as I keep standard webshop routines. in the php code you can insert html parts per "include" and these are the parts that I change in dreamweaver without any problems.
paypal provides a sandbox environment where you can test the code. so what I usually do is to copy and paste freely available webshop snippets that simply check back at paypal if a transaction is completed, then write it into the database, then create randomized login data, then write those data per "echo" onto the predefined checkout page (which doesn't work live but works smoothly in sandbox) and additionally send those data by php "sendmail" (which works both in sandbox and live most of the time), so the redirection works, it just doesn't show up. and if I want to test this live I would have to complete real transactions using real money ...
|
|
02-04-2013 22:16 |
|
|
Mandrake
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
![images/avatars/avatar-36.jpg](images/avatars/avatar-36.jpg)
Registration Date: 03-03-2010
Posts: 1,000
Location: NY
![](images/spacer.gif) |
|
well, let me know if you want to test it with me like we did last time.
|
|
02-05-2013 01:15 |
|
|
potk
Super Moderator/One-Shoe Guru
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
![images/avatars/avatar-46.jpg](images/avatars/avatar-46.jpg)
Registration Date: 04-05-2011
Posts: 359
![](images/spacer.gif) |
|
|
02-05-2013 01:38 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
quote: |
Originally posted by Mandrake
well, let me know if you want to test it with me like we did last time. |
thanks. but first we somehow have to track down the problem itself. I didn't find any possible solution yet ...
|
|
02-05-2013 10:12 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
quote: |
Originally posted by potk
Just bought another e-comic and the blank page appeared again. |
good thing is, that if the blank page pops up, php code is processed in the background and the download link is sent per "sendmail". only yours is bouncing back because gmail says that the account doesn't exist. so I sent you the link to your other address ...
|
|
02-05-2013 10:15 |
|
|
potk
Super Moderator/One-Shoe Guru
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
![images/avatars/avatar-46.jpg](images/avatars/avatar-46.jpg)
Registration Date: 04-05-2011
Posts: 359
![](images/spacer.gif) |
|
Wow, I feel stupid; I found out what the problem is. When I created the new account, I mispelled my secondary email address. I'll go ahead and fix it as soon as I can.
__________________ http://p-o-t-k.deviantart.com/
![](http://i.imgur.com/q39vMKh.png)
|
|
02-05-2013 13:53 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
changed
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
to
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close\r\n'));
paypal reference: https://www.x.com/node/320404
again it works smoothly in sandbox mode. I get the full download page after being redirected and receive the email.
|
|
02-05-2013 16:03 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
I might have found what's causing the problems:
http://www.prestashop.com/forums/topic/1...onfirm-payment/
quote: |
I have found and solved the issue.. just thought I would post the fix here, in case anyone out there ever runs into this very same thing.
Basically, what I did was turn on error reporting in the /config/config.inc.php (around line 28, change "off" to "on".
Then I did another test order, and the PayPal confirmation page gave me an error like so:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1966080 bytes) in
/home/xxxxxx/public_html/test/tools/tcpdf/tcpdf.php on line 23264
Then I did a search on google, and found some info, about the PHP settings for :
php_value memory_limit 32mb
max_execution_time 30 (seconds)
What I did was increase both to the following:
php_value memory_limit 64mb
max_execution_time 60 (seconds)
This seemed to solve the issue, and now my PayPal confirmation page is showing like normal...
yay!!!! |
I included in the code:
ini_set('memory_limit', '64M');
ini_set('max_execution_time', 90);
not sure though if it works as expected because I can't access root php settings. I read that safe mode must be off to allow changing these settings directly in the script. but at least in sandbox I don't get any error message when it's processed.
this would be an explanation why it always works in sandbox but not live as sandbox redirection is simply much faster ...
|
|
02-05-2013 17:10 |
|
|
fantomaZ
Administrator
![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif) ![](images/star3.gif)
Registration Date: 03-02-2010
Posts: 403
Thread Starter
![](images/spacer.gif) |
|
doesn't seem to work either. at least all of the customers who bought something today didn't use it
|
|
02-05-2013 21:36 |
|
|
|
|
![Post Reply Post Reply](images/reply.gif) |
|