How to send transactions to the sandbox paypal using paypal API? - paypal

I am trying to create some payments with transactions on my sandbox API. I followed the doc here https://developer.paypal.com/docs/api/payments/v1/#payment_create and inserted the request body in postman but I get a 404 error. I am not using the deprecated endpoint. Can someone help?

v1/payments is a deprecated API.
Use the current v2/checkout/orders API, documented here.
Impossible to advise on the reason for the 404 without seeing a log of your request and response, but make sure you are successfully obtaining an access token first. There is a postman collection at https://www.postman.com/paypal/

Related

I am working with CyberSource pilot endpoints, how can I get around the 401 unauthorized when testing in Postman or our application?

I am working with one of the Pilot endpoints trying to implement the new CyberSource recurring billing for a customer of ours.
I had a discussion with CyberSource late last year, and was provided the API reference link to these new endpoints. The API endpoint is https://apitest.cybersource.com/rbs/v1/subscriptions.
I noticed that when testing these endpoints in the API reference page, they would work and the subscriptions were created in our Sandbox account.
When testing this endpoint in our applications integration however, I am seeing a 401 unauthorized on each request. I see the same thing when testing in Postman, but not when testing directly in the API reference.
Is there something I need to include in the request header or otherwise in order to make these calls work?

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

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.

Search client transactions data

I'm building an application that resembles personal financing. For that, I need to fetch information about that customer's transactions.
I managed to run the GetBasicPersonalData example within the permissions service.
Here it says that requesting TRANSACTION_SEARCH will allow me to use TransactionSearch on behalf of the customer.
There is no such endpoint and calling the NVP service with METHOD=TransactionSearch and similarly constructed X-PAYPAL-AUTHORIZATION header doesn't do it either.
How can I use the token and token secret retrieved from the permissions service to list that customer's transactions?
Update: According to FAQ#6 here, the X-PAYPAL-AUTHORIZATION is supposed to be used to replace the USER, PWD, and SIGNATURE params. When I call the nvp service that way I get:
TIMESTAMP=2016%2d11%2d07T15%3a35%3a36Z&CORRELATIONID=f50b7296c2d28&ACK=Failure&VERSION=94%2e0&BUILD=24616352&L_ERRORCODE0=10002&L_SHORTMESSAGE0=Authentication%2fAuthorization%20Failed&L_LONGMESSAGE0=You%20do%20not%20have%20permissions%20to%20make%20this%20API%20call&L_SEVERITYCODE0=Error
I'd like to share below useful documents for your reference:
TransactionSearch API guide here;
TransactionSearch API reference here;
PayPal API Endpoint here(Refere Merchant APIs);

PayPal REST API - Get Sale by Transaction ID - The requested resource ID was not found (404)

I am essentially trying to get the details of any transaction ID in my PayPal account to authenticate users I am migrating to a new authentication system.
I am using the PayPal Rest API so: http://puu.sh/gdb3T/461dde2928.png and yes I have checked everything is fine, it is infact set to live with the correct id / secret.
This isn't exactly an answer to this specific question, but I have simply fixed it by using PayPal's classic API in order to get the job done.
Kind of strange the rest API doesn't let me do this.

Receiving INTERNAL_SERVICE_ERROR REST API

Using REST API, sandbox and attempting to get bearer token. Receiving the following error
{"name":"INTERNAL_SERVICE_ERROR","information_link":"https://api.sandbox.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"5a235c510522b"}
How can I find out what the debug id means?
The 'debug_id' is an internal identifier we can use to pull up the request within PayPal.
You may see our classic API calls refer to this as the 'correlationID'.
Unfortunately I'm not finding anything in our system for this debug_id. Can you log a ticket (www.paypal.com/mts) or email me (address in profile) with details of the call, including your full HTTP request (minus credentials) and the resources you tried to access, as well as the full HTTP response?
I suggest we close this answer as it's not strictly programming-related, but I can continue working on this via mail / ticket with you.
By the way; if you're using the 4111111111111111 credit card: this card number is currently inoperable in the Sandbox environment and may throw 'internal service error' type responses as well. You can use any other card number instead.