Paypal Express Checkout through Braintree SDK suddenly fails (missing facilitator REST API App?) - paypal

We implemented PayPal express checkout through the Braintree SDK (js v3) because this allows us to use our own HTML button whereas we would have to use the provided PayPal buttons if we were using the REST API.
Everything was working fine within our live setup until yesterday. Code was changed neither on the client nor on the server.
However, I did delete two REST API apps within the PayPal developer dashboard which were no longer needed since we had decided to go down the Braintree JS SDK path.
After that, express checkouts started throwing AuthenticationErrors.
Generating client tokens on our server still works. Performing the actual checkout fails on tokenization.
I receive the following exception:
{
"paymentResource": {
"errorName": "invalid_client",
"errorMessage": "Client Authentication failed",
"errorDetails": null,
"debugId": "84b227241374e",
"paypalHttpStatus": 401
}
}
The whole setup works using the test access_token btw :/
My current assumption is that the Braintree SDK access_token is somehow coupled to the default REST API App (email-facilitator#domain.tld). I deleted this default REST API App.
I found the following FAQ article which I believe proves the assumption might be correct: https://www.paypal-knowledge.com/infocenter/index?page=content&id=FAQ1938&expand=true&locale=en_US
We now switched to a different PayPal account as we could not figure out what was going wrong. Without changing any code except for the new access_token, everything started working again.
Has anyone experienced this or something similar before?
Does anyone know how I can either
Delete the Braintree Account or regenerate it (which will hopefully restore the link to my new REST API App)? or
Restore the link between my Braintree SDK access_token and my REST API app?
If something was unclear or if I can provide more context somewhere please let me know!

As Brian K correctly noted, the solution was to contact the PayPal technical support at paypal-techsupport.com/app/ask and ask for the deleted REST API app to be reinstated.
Everything is back to normal now.

Related

PayPal Node SDKs: difference between paypal-rest-sdk and #paypal/checkout-server-sdk for webhooks?

I have this question regarding 2 npm PayPal packages, what is the difference between
paypal-rest-sdk and #paypal/checkout-server-sdk ? And can you implement webhooks using #paypal/checkout-server-sdk or there is no need for webhooks for this package ?
paypal-rest-sdk
checkout-server-sdk
var paypal = require('paypal-rest-sdk');
const paypal = require('#paypal/checkout-server-sdk');
All PayPal-*-SDK for every language have been deprecated for a long time and should not be used for anything. This includes the one for node that's in npm as #paypal/paypal-rest-sdk.
The Checkout-*-SDK for every language, in npm for node as #paypal/checkout-server-sdk, implements the v2/checkout/orders API (and only that API). It can still be used if desired, although I've heard it will be deprecated soon as well. Currently all developer.paypal.com documentation only references doing direct HTTPS REST API integrations, using a client id and secret to first obtain an access_token. For node in particular, there is a full stack example in the PayPal Checkout integration guide that serves as a useful starting point, although I recommend the client side onApprove function in this approval flow since that sample includes client-side error handling of the capture response (restarting or showing an error as appropriate)
As for webhooks, they are a separate matter. There is no current SDK for them. The server-side capture API response is already sufficient for normal orders API payments so you may not need webhooks for what you're doing, but if there are specific events you're interested in listening for (such as refunds or disputes that occur on PayPal.com ) you'll need to subscribe to the event(s) you want -- either in the REST app or using webhook API calls.

How to use PayPal API credentials?

I need to add PayPal button on client's website. It is first time I am doing this and I asked for credentials he gave me API signature, API username and API password. I was checking lots of tutorials how to add PayPal button, they use sandbox/live Client ID and Secret. Can I use this API credentials instead?
I searched a lot but couldn't find an answer.
I am coding in CodeIgniter 3.
Thanks
Username, Password, and Signature are related to Classic API integration.
Client ID and Secret are related to the REST API integration.
Which one do you want to work with?
Or, the easiest option is to use PayPal Standard Payment Buttons, but that will also be the most limiting.
We actually have a PayPal CodeIgniter Library that you might be interested in. It was built for the Classic API.
The general PayPal PHP SDK that it's based on is now available with Composer, so I would recommend installing it that way.
We'll be releasing an update to that library before the end of the year that adds all of the REST APIs. It's available in the dev branch on GitHub already.

PayPal Rest API Get Sale - REQUIRED_SCOPE_MISSING

Today I have been trying to implement the rest API into my application to look up transaction information from a transaction ID (GET /v1/payments/sale/)
I have implemented everything correctly on my end and set the mode to "live" and I can't seem to get details from a transaction.
Here is the full error code:
{"name":"REQUIRED_SCOPE_MISSING","message":"Access token does not have required scope","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#REQUIRED_SCOPE_MISSING"}
And here is documentation on what I am trying to do: https://developer.paypal.com/docs/api/#look-up-a-sale
Any help would be appreciated.
Thanks.
There are few things you could do to make sure your configurations are set right.
If the mode is set to live, are you using the live credentials instead of sandbox. You can select the sandbox app and copy the live credentials from there. See bottom part of this image.
Make sure Payments are enabled on live. PayPal has a dashboard page, where you could see all the services that you have enabled to work with Live environment. This prevents accidents on unknowingly using an API on live. You can check the status here
Is the sale that you are looking for created by the same clientId that you are using for making a GET call ? Only the app who creates the sale, can view the sale.
In the mean time, PayPal has created SDKs for many languages to support REST APIs. They are actively developed, and maintained, and could help you mitigate issues in handling tokens, credentials, etc, and allows you to quickly use APIs faster and in a way that could be upgraded easily. Also, few SDKs come packaged with Sample codes, and wiki documentations. Few are still under development, but you can feel free to contribute back to these open source SDKs.
When I had this issue, the problem was that I was making REST requests using the Identity API token. Basically, I was logging users into my website with Paypal then using that token for REST requests when another token from the REST API service should have been used. "
Here is the support ticket from Paypal SDK deveoper Randy who helped answer my question even though I do not use the SDK. Thanks Randy:
https://github.com/paypal/PayPal-PHP-SDK/issues/785#issuecomment-282749095

Paypal express checkout not working on sandbox

We have integrated paypal express checkout in our application 1 year back and it was working just fine till last week. It still works fine on Live environment, the issue is with sandbox.
We get below error
The Request was aborted: Could not create SSL/TLS secure channel
On doing some search I found that there are some changes on Pyapal API. I did changes in endpoint as mentioned in API document but still it doesn't work. Anybody is facing the same and it would be great if you can give some working sample with new API changes.
Maybe your return url is SSL (https) and your certificate has expired?

Subscribing to realtime updates for an app that is marked as "native'

When I follow the instructions on:
http://developers.facebook.com/docs/reference/api/realtime/
Namely:
1) Retrive an access_token with:
https://graph.facebook.com/oauth/access_token?client_id=<APP_ID>&client_secret=<APP_SECRET>&grant_type=client_credentials
2) Issue a subscription request to https://graph.facebook.com/<app-id>/subscriptions?access_token=...
I receive the error:
{"error":{"message":"(#15) This method is not supported for native apps","type":"OAuthException","code":15}}
My app is marked as a native app under "App Type" on https://developers.facebook.com/apps/<app id>/advanced.
But, to be clear, I am making the subscription request from a server (the same server that I intend to use as my callback server).
So, questions:
Should I be getting an access_token via some other means? Does
the way I'm getting the access token
("grant_type=client_credentials") mean that I'm getting an access token that is supposed to be for a client, rather than a server?
Am I doing something else wrong? Or,
is this just a bug / documentation bug? Nowhere in the realtime API
docs does it say that Native apps are not alllowed to use the realtime API.
Related questions:
How do I subscribe to Facebook Realtime API? is basically my same question, but it's not on facebook.stackoverflow.com and it was answered with a non-answer, so I saw fit to repost.
http://facebook.stackoverflow.com/questions/11141333/using-real-time-updates-from-facebook-graph-api-with-a-client-application is a related question, but again, I am making a subscription request from a SERVER, not a client.
If you setup a canvas_url, you can do client_credentials. So setup native AND canvas (server). It will host a web site version of your app, which is what FB needs to grant that kind of access_token.