PayPal IPN Bad Request 400 Error

后端 未结 6 2319
挽巷
挽巷 2020-12-05 05:31

Using the PayPal IPN, I keep getting an error 400.

I have been making the script send me emails of $res to see what the response is, inside of the

6条回答
  •  隐瞒了意图╮
    2020-12-05 05:36

    Since you're opening the socket yourself, rather than using an HTTP library such as curl, you need to set the proper HTTP Protocol version and add the HTTP Host header yourself just below the POST line.

    $header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
    $header .= "Host: www.sandbox.paypal.com\r\n";
    

提交回复
热议问题