MariaMiArt
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Jul-15-2018
11:21 PM
Hello, I have a code for postback that returns me FAIL on live URL, but it works fine in sandbox. What I need to do to get it working? Thank you!
curl_setopt_array($request, array ( CURLOPT_URL => 'https://www.paypal.com/cgi-bin/webscr', CURLOPT_POST => TRUE, CURLOPT_TIMEOUT => 10, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_POSTFIELDS => http_build_query(array ( 'cmd' => '_notify-synch', 'tx' => $GET['tx'], 'at' => 'my_token_here', )), CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => FALSE ));
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Accepted Solutions
MariaMiArt
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul-16-2018
08:48 AM
After 16 hours of searching I found the solution here - https://github.com/apih/paypal-ipn-pdt
Here is the code:
$query_data = [ 'cmd' => '_notify-synch', 'tx' => $GET['tx'], 'at' => $this->token ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'PayPal'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query_data)); curl_setopt($ch, CURLOPT_URL, $this->url); $response = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch);
1 REPLY 1
MariaMiArt
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul-16-2018
08:48 AM
After 16 hours of searching I found the solution here - https://github.com/apih/paypal-ipn-pdt
Here is the code:
$query_data = [ 'cmd' => '_notify-synch', 'tx' => $GET['tx'], 'at' => $this->token ]; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, 'PayPal'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($query_data)); curl_setopt($ch, CURLOPT_URL, $this->url); $response = curl_exec($ch); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch);

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- "System error. Please try again later" when connecting to paypal sandbox account with my android app in Sandbox Environment
- Auto Return feature for digital products without using woocommerce? in PayPal Payments Standard
- Django-paypal form is not showing "pay with credit or debit card" option in Braintree Server-side Integration (PHP, Java, .NET, Ruby, Python, NodeJS SDKs)
- subscription_id has disappeared in REST APIs
- PHP SDK error: broken content-length header in SDKs