I have 2 PHP files, one index.php and the other is paypal.php. Code for PayPal.FPP is:
1, CURLOPT_POSTFIELDS = & gt; $ POST, CURLOPT_RETURNTRANSFER = & gt; 1, CURLOPT_SSLVERSION => 3); Curl_setopt_array ($ ch, $ option); $ Response = curl_exec ($ ch); Curl_close ($ ch); $ Atoken = json_decode ($ response); $ Profile_url = "https://www.paypal.com/webapps/auth/protocol/openidconnect/v1/userinfo?" "Schema = OpenID". "Access_token =". $ Atocon-> access token; $ Ch = curl_init ($ profile_warnel); $ Option = array (CURLOPT_RETURNTRANSFER = & gt; 1, CURLOPT_SSLVERSION => 3); Curl_setopt_array ($ ch, $ option); $ Response = curl_exec ($ ch); Curl_close ($ ch); $ Profile = json_decode ($ response, true); $ _SESSION ['paypal_use'] = "true"; $ _SESSION ['profile'] = $ profile; Echo ("& lt; scripts> top position .hr = 'index.php' "); }? & Gt; The code for index.php is:
LOGOUT & lt; / a & gt;"; } Else {// login? & Gt; & Lt; A href = 'paypal.php' title = 'PayPal Out Login' & gt; & Lt; Img src = 'https: //www.paypalobjects.com/en_US/Marketing/i/btn/login-with-paypal-button.png'> & Lt; / A & gt; By & lt;? }? & Gt; Any idea why this code is not working? I tried var_dump json_decode and it returns empty.
Thank you!
I am wrong, but I believe that you must have a scope ...
"scope": "email https://uri.paypal.com/services/paypalattributes", is the URL profile
No comments:
Post a Comment