SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict kuldeepkaundal's Avatar
    Join Date
    Oct 2008
    Location
    India
    Posts
    239
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    connect to paypal using curl

    Hi,

    I am trying to connect to sanbox paypal for testing using Curl, but, i keep on getting "Please login to use the PayPal Sandbox features." screen. Here's my code:

    Code:
            $ch = curl_init();
            $addr = "https://www.sandbox.paypal.com/cgi-bin/webscr";       
            
             $string_values = "cmd=_xclick&business=test_1203664704_biz@miraclegroup.com&item_name=Directory membership&item_number=1&no_shipping=1&currency_code=USD&a3=18.00&p3=12&t3=M";       
            curl_setopt($ch, CURLOPT_URL, $addr);  
            curl_setopt($ch, CURLOPT_TIMEOUT, 10);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $string_values);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    
            $paypal_response = curl_exec($ch);
            $error_response = curl_error($ch);
            print_r( $paypal_response);
    What can be the issue?
    Plz suggest,
    Thanks,
    Kul.
    Not da best but not like da rest.

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2009
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It looks you are missing cookies. Did you try adding cookies to see if they help?
    Daniel, Helpdesk Leader
    Hosting24.com Web Hosting - First class web hosting services.
    Reseller Hosting - Provide unlimited disk space and bandwidth

  3. #3
    SitePoint Zealot Ripe's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're running off your site off localhost, PayPal won't work. I spent hours trying to work this out.

  4. #4
    SitePoint Evangelist
    Join Date
    Aug 2009
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why shouldn't script work on localhost?
    Daniel, Helpdesk Leader
    Hosting24.com Web Hosting - First class web hosting services.
    Reseller Hosting - Provide unlimited disk space and bandwidth

  5. #5
    SitePoint Zealot Ripe's Avatar
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hosting24 View Post
    Why shouldn't script work on localhost?
    http://www.pdncommunity.com/pdn/boar...hread.id=18794

  6. #6
    SitePoint Evangelist
    Join Date
    Aug 2009
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But if person has no router (sure, we don't know if he has or not), I believe it still should work fine.
    Daniel, Helpdesk Leader
    Hosting24.com Web Hosting - First class web hosting services.
    Reseller Hosting - Provide unlimited disk space and bandwidth


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •