Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:14:17+00:00 2026-06-08T20:14:17+00:00

Following is my code which I am using: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->paypal_url);

  • 0

Following is my code which I am using:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->paypal_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
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_HTTPHEADER, array('Host: ' . $url_parsed['host']));
$res = curl_exec($ch);
curl_close($ch);

this->paypal_url is the sandbox api url and url_parsed[‘host’] is the sandbox paypal host name these both are correct, but the problem I am having is on every call $res is always empty.

Before getting this code from paypal developer site I was using following code:

$fp = fsockopen('ssl://' . $url_parsed['host'],"443",$err_num,$err_str,30);
fputs($fp, "POST $url_parsed[path] HTTP/1.1\r\n"); 
fputs($fp, "Host: $url_parsed[host]\r\n"); 
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); 
fputs($fp, "Content-length: ".strlen($post_string)."\r\n"); 
fputs($fp, "Connection: close\r\n\r\n"); 
fputs($fp, $post_string . "\r\n\r\n"); 

and failed to open socket error occurred.

Before using ssl I was using this line of code:
$fp = fsockopen($url_parsed[‘host’],”80″,$err_num,$err_str,30);

I was getting this response:

Server:
 HTTP/1.0 302 Moved Temporarily
Location: https://www.sandbox.paypal.com
Server: BigIP
Content-Length: 0
X-Cache: MISS from proxyco.confiz.com
X-Cache-Lookup: MISS from proxyco.confiz.com:3128
Via: 1.0 proxyco.confiz.com:3128 (squid/2.6.STABLE21)
Connection: close

Please help me finding the solution for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:14:19+00:00Added an answer on June 8, 2026 at 8:14 pm

    Hope following links will help you..

    https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro
    

    To download sample code

    https://www.x.com/developers/PayPal/documentation-tools/code-sample/216623
    

    IPN Listner is very useful and easy to integrate

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which I am are currently using .... Basically, this
I have the following code which I'm using to populate form fields. This code
I am using this following code which creates a ListView with text and an
I'm using the following code which will generate a wav file which contains a
Given the following lines of code which is using JQTOUCH: $('#customers').bind('pageAnimationEnd', function(e, info){ if
I have the following code which outputs an object to an XML file: using
I am using the following code to determine which key is pressed by the
I have a javascript code using which I want to accomplish the following .
I'm using the following code to load some sounds depending on which button a
I'm using he following code the call a CFC which returns auto-suggest results through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.