Fatal error: Uncaught PayPalHttp\HttpException - php

Fatal error: Uncaught PayPalHttp\HttpException: {"error":"invalid_client","error_description":"Client Authentication failed"} in /home/smmtopse/public_html/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php:224
Stack trace:
#0 /home/smmtopse/public_html/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php(107): PayPalHttp\HttpClient->parseResponse(Object(PayPalHttp\Curl))
#1 /home/smmtopse/public_html/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php(40): PayPalHttp\HttpClient->execute(Object(PayPalCheckoutSdk\Core\AccessTokenRequest))
#2 /home/smmtopse/public_html/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php(32): PayPalCheckoutSdk\Core\AuthorizationInjector->fetchAccessToken()
#3 /home/smmtopse/public_html/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php(71): PayPalCheckoutSdk\Core\AuthorizationInjector->inject(Object(PayPalCheckoutSdk\Orders\OrdersCreateRequest))
#4 /home/smmtopse/public_html/app/controller/addfunds.php(189): PayP in /home/smmtopse/public_html/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php on line 224

There are exactly two possible reasons for an invalid_client error when attempting to obtain an access_token.
You are using or transmitting wrong REST App API credentials. Obtain a new clientid and secret from the "sandbox" or "live' tab of PayPal Developer.
You are using sandbox credential in live mode, or live credentials in sandbox mode. The two environments are completely separate, and a clientid+secret from one will never work in the other.

Related

fatal error in googleapi

i have to use google api in my project using php
the project : using google search engine and gathering urls and their source pages
i downloaded google api php client and i followed what ever is written here
https://code.google.com/p/google-api-php-client/
after running i ge this error:
Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/plus/v1/people/me/activities/public?key=[REDACTED]: (403) Access Not Configured' in C:\xampp\htdocs\google-api-php-client\src\io\Google_REST.php:66 Stack trace: #0 C:\xampp\htdocs\google-api-php-client\src\io\Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1 C:\xampp\htdocs\google-api-php-client\src\service\Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest)) #2 C:\xampp\htdocs\google-api-php-client\src\contrib\Google_PlusService.php(58): Google_ServiceResource->__call('list', Array) #3 C:\xampp\htdocs\googleapitest.php(31): Google_ActivitiesServiceResource->listActivities('me', 'public') #4 {main} thrown in C:\xampp\htdocs\google-api-php-client\src\io\Google_REST.php on line 66
i am completely confused and don't know what to do
That error often means you're not matching your access requirements in the API console - i.e. if you have IP or referrer restrictions configured.
Just remove your developer key and add the scope
'www.googleapis.com/auth/userinfo.email',
'www.googleapis.com/auth/userinfo.profile',
'www.googleapis.com/auth/plus.login',
'www.googleapis.com/auth/plus.me'));

Google API login

I try to fetch data from google analytics using the google api class in php.
I checked serval google groups and found out that the error comes most of the time when Curl is off and SSL is off too, but I checked in the phpinfo() and booth are running. Anyone an idea what it could be? On my local server it's running, but on the webserver it's not running.
<br />
<b>Fatal error</b>: Uncaught exception 'Exception' with message 'GAPI: Failed to authenticate user. Error: "Error=BadAuthentication
Url=https://www.google.com/accounts/ServiceLogin?service=analytics#Email=mail
Info=WebLoginRequired
"' in /home/express/public_html/loggedIn/gapi.class.php:418
Stack trace:
#0 /home/express/public_html/loggedIn/gapi.class.php(62): gapi->authenticateUser('mail', 'pw')
#1 /home/express/public_html/loggedIn/request.php(10): gapi->__construct('mail', 'pw')
#2 {main}
thrown in <b
>/home/express/public_html/loggedIn/gapi.class.php</b> on line <b>418</b><br />
So after browsing more groups, a friend found out that you need to approve your account before you start fetching data for the first time at this url

dropbox SDK php cannot be authenticated with known CA certificates

I'm trying to use the php dropbox sdk, but i got these error
Uncaught exception 'OAuthException' with message 'making the request failed (Peer certificate cannot be authenticated with known CA certificates)' in C:\xampp\htdocs\mydropbox\Dropbox\OAuth\PHP.php:126 Stack trace: #0 C:\xampp\htdocs\mydropbox\Dropbox\OAuth\PHP.php(126): OAuth->getRequestToken('https://api.dro...') #1 C:\xampp\htdocs\mydropbox\index.php(18): Dropbox_OAuth_PHP->getRequestToken() #2 {main} Next exception 'Dropbox_Exception_RequestToken' with message 'We were unable to fetch request tokens. This likely means that your consumer key and/or secret are incorrect.' in C:\xampp\htdocs\mydropbox\Dropbox\OAuth\PHP.php:132 Stack trace: #0 C:\xampp\htdocs\mydropbox\index.php(18): Dropbox_OAuth_PHP->getRequestToken() #1 {main} thrown in C:\xampp\htdocs\mydropbox\Dropbox\OAuth\PHP.php on line 132
I did tried so many times, to use OpenSSL to generate new and follow all the instruction ,but it still giving me this errors.
Refer Source:http://help.discretelogix.com/miscellaneous/installing-self-signed-ssl-certificate-on-wamp-server.htm
I found a github that do not use the CA certification, or maybe it's already taken care for me.
https://github.com/BenTheDesigner/Dropbox
it's working well for me.

Can not authenticate with UserInfo service with google-api-php-client library

I'm testing the OAuth2 service with google-api-php-client library to access UserInfo of logged users with their Google account. The code is taken from examples/userinfo/index.php with little change to cope with my host. When running the example, it passed through Google login form. When it came back to my site, an exception thrown as following.
Fatal error: Uncaught exception 'apiIOException' with message 'HTTP Error: (0) couldn't connect to host' in /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiCurlIO.php:120
Stack trace:
#0 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiCurlIO.php(46): apiCurlIO->makeRequest(Object(apiHttpRequest))
#1 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiREST.php(55): apiCurlIO->authenticatedRequest(Object(apiHttpRequest))
#2 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/service/apiServiceResource.php(151): apiREST::execute(Object(apiServiceRequest))
#3 /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/contrib/apiPlusService.php(207): apiServiceResource->__call('get', Array)
#4 /home/ztbmwjhd/public_html/apis/at/googleplus/google-plus-access.php(40): PeopleServiceResource->get('me')
#5 /home/ztbmwjhd/public_html/apis/at/googleplus/index.php(2): include_once('/home/ztbmwjhd/...')
#6 {main}
throw in /home/ztbmwjhd/public_html/apis/at/googleplus/google-api-php-client/src/io/apiCurlIO.php on line 120
Thank you for your help
The error "HTTP Error: (0) couldn't connect to host" typically means theres a problem between your server and google. Are you connecting through a proxy?
Also, try to run "curl https://www.googleapis.com/discovery/v1/apis" from your command line.

Google Api Oath Exception Issues

I am newer to the Google Plus Api, but I have followed each and every rule to integrate G-Plus API in my WEB. But every time I get stuck at the issue:
Fatal error: Uncaught exception 'apiAuthException' with message 'Error refreshing the OAuth2 token, message: ''' in C:\AppServ\www\googleplus-source\google-api-php-client\src\auth\apiOAuth2.php:203
Stack trace:
#0 C:\AppServ\www\googleplus-source\google-api-php-client\src\io\apiCurlIO.php(51): apiOAuth2->sign(Object(apiHttpRequest))
#1 C:\AppServ\www\googleplus-source\google-api-php-client\src\io\apiREST.php(55): apiCurlIO->authenticatedRequest(Object(apiHttpRequest))
#2 C:\AppServ\www\googleplus-source\google-api-php-client\src\service\apiServiceResource.php(148): apiREST::execute(Object(apiServiceRequest))
#3 C:\AppServ\www\googleplus-source\google-api-php-client\src\contrib\apiPlusService.php(204): apiServiceResource->__call('get', Array)
#4 C:\AppServ\www\googleplus-source\google-plus-access.php(40): PeopleServiceResource->get('me')
#5 C:\AppServ\www\googleplus-source\index.php(2): include_once('C:\AppServ\www\...')
#6 {main} thrown in C:\AppServ\www\googleplus-source\google-api-php-client\src\auth\apiOAuth2.php on line 203
What could be the reason for this error?
What could be the reason for this error?
The reason for this error (a Fatal error) is given in the error message: Uncaught exception. That means an exception­Docs has been thrown and was not caught. This results in a fatal error.
Most likely in your case, the root cause of the problem highlighted in the exception message is misconfiguration and/or wrong API usage. As you have not posted any code in your question, you should read the API documentation first and double check your usage of the API and it's configuration.

Categories