php - CURL Request problem -
I am trying to verify PayPal's PDT information.
I prepared my mockup form and submitted it. IT worked and returned the information too.
I tried to do the same thing which curl request
my mask form:
& Lt; Input type = "hidden" name = "A" value = "-----" /> & lt; Input type = "hidden" name = "tx" value = "-----" /> & lt; Input type = "submit" value = "test" /> & Lt; / Form & gt; My curl rake code: $ arrData = array ('tx' = & gt; '----', 'cmd' = & Gt; '_notify-synch', 'at' = & gt; '-----'); $ Ch = curl_init ('https://sandbox.paypal.com/cgi-bin/webscr'); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ CH, CURLOPT_POST, 1); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, $ arrData); $ StrCurlResult = curl_exec ($ ch); Curl_close ($ ch); Return $ strCurlResult; EDIT:
I got the following message when turning on the curl error:
SSL: certificate subject name 'www .sandbox.paypal .com 'target host name does not match' sandbox.paypal.com '
Replace: $ ch = curl_init ('https://sandbox.paypal.com/cgi-bin/webscr'); To: $ ch = curl_init ('http: //www.sandbox.paypal.com/cgi-bin/webscr'); Reason: The certificate for www.sandbox.paypal.com is not valid for sandbox.paypal.com.
Make the same change in the 'action' of your form.
Comments
Post a Comment