Paypal IPN verification fails due to host name does not match certificate in sandbox environment - paypal

I've been using IPN verification successfully for years now. It suddenly stopped working.
I send the verification request to https://ipnpb.sandbox.paypal.com/cgi-bin/webscr?cmd=_notify-validate
It seems like there is something wrong with their certificate not matching 'ipnpb.sandbox.paypal.com'
This is the url listed in their documentation.
I also tried using www.sandbox.paypal.com as suggested here
but still did not work.
Could anyone tell me what's going on?

Related

Are new Paypal API credentials required after server migration?

We've successfully been running a WordPress plugin using PayPal's Classic API integration and a custom listener URL for years.
After recently migrating the site to a new server, all IPNs related to the plugin started failing. No configuration changes have been made to the plugin or Paypal account. Our server manager insists WHM/Apache config is identical. It appears the only difference is the server IP address.
Would I need to create and assign new Paypal NVP/SOAP (Classic) API credentials after moving the website to a new server if the domain and plugin configuration remains the same?
Can I simply/safely "Remove" our existing Classic API integration and create new credentials?
Any other suggestions are greatly appreciated.
Thanks in advance for any help!
You do not need new API credentials.
However you should verify that any IPN notify_url specified in the PayPal account or at transaction time (as part of the checkout setup) is a valid one and responding with an HTTP 200 OK status when PayPal sends an IPN.
Review your IPN history to see if your server is responding with another status now, such as 500 or 404 or simply no connection/response. To PayPal anything other than a 200 OK indicates a failed IPN delivery, and likely must be corrected in your system. Also there are some IPs/domains PayPal cannot connect to for various reasons, which will cause a no response status.

Why do I get authentication error when trying to access PayPal Sandbox (ref REST API app)?

As requested by Preston PHX, I uploaded a full copy of my
code to Dropbox:
My test ASP.NET Web App
I hope this helps someone to identify what I may have done wrong
#####################################
I am trying to use the sample code at https://github.com/paypal/Checkout-NET-SDK/tree/develop/Samples to make contact with the Sandbox but it doesn't work for me. In order to find out why, I ran my code in Visual Studio under Localhost in debugging mode, using several breakpoints.
This line of code in my test page ...
var createOrderResponse = CreateOrderSample.CreateOrder(true).Result;
... displayed the following error:
Inner Exception 2:
HttpException: {"error":"invalid_client","error_description":"Client Authentication failed"}
However, it was the environment function in PayPalClient.cs (modified to use my PAYPAL_CLIENT_ID and PAYPAL_CLIENT_SECRET) that appears to have generated the error:
public static PayPalEnvironment environment()
{
return new SandboxEnvironment(
System.Environment.GetEnvironmentVariable("PAYPAL_CLIENT_ID") != null ?
System.Environment.GetEnvironmentVariable("PAYPAL_CLIENT_ID"):"<<PAYPAL-CLIENT-ID>>",
System.Environment.GetEnvironmentVariable("PAYPAL_CLIENT_SECRET") != null ?
System.Environment.GetEnvironmentVariable("PAYPAL_CLIENT_SECRET"):"<<PAYPAL-CLIENT-SECRET>>");
}
I very carefully copied my PAYPAL_CLIENT_ID and PAYPAL_CLIENT_SECRET from the REST API app I created via the PayPal Developer Dashboard. Apart from that, the GitHub sample code has not been modified. I could see no requirement in the GitHub code to specify a Sandbox URL and assume that this is provided by the PayPalCheckoutSdk via the use of "return new SandboxEnvironment()".
It's not obvious to me why my attempt to connect to this Sandbox account is failing the authentication process. What might I be doing wrong? Is it anything to do with my use of Localhost?
EDIT on 1 Nov 2021 in response to Preston PHX
Creating a new Sandbox Client ID and Secret made no difference. Prompted by another forum post I read some time ago, I also tried using ngrok (for the first time) to open http port 80 to facilitate PayPal testing via Localhost, but the connection to the Sandbox still failed authentication.
Sandbox Client ID: AZcb8XrqhJEUO7lS_JtKSe3sdNDLESmo3ekhupDKTL1J9vQCKVOzacCjO3PBQwSfngYkLGa-qS7EUrGV
Secret:
EBEcuPewHdzCB8p0qE1Yszjk2eMyFCstzkL0Diz2WC5IQREsu6cDHr7yFG9a-GDIyljb-KRb2DA6Hoey
I installed curl (plus Bash and Git) on my Windows 10 PC and ran the curl command specified on the get-an-access-token page. I couldn't find a way to post the result here in an easily readable form so I put it in a Word doc and uploaded that to Dropbox.
https://www.dropbox.com/s/knia3y2ighfzxpa/Result%20of%20PayPal%20curl%20command.docx?dl=0
Edit on 2 Nov 2021
As requested by Preston PHX, I have uploaded a copy of the ASP.NET Web App I have been using for my tests to Dropbox.
https://www.dropbox.com/sh/4uclfs2lexv4v42/AAAjoZIN5cEMV1mu0cYi24zKa?dl=0
I've only uploaded the project folder, as I'm guessing that it is unnecessary to upload my Solution files.
Create a new sandbox client ID and secret in the developer dashboard. Test with the new client ID and secret.
If issues persist,
Update your question with both the new sandbox client ID, and the new sandbox secret.
Update your question with a sample curl command to get an access token, showing the entire command and the entire response in your question.

Why does the PayPal API not recognize my client id and secret

The Paypal API doesn't recognize my Client ID and Secret I got from https://developer.paypal.com/developer/applications/
I wanted to include a server side checkout according to this tutorial https://developer.paypal.com/docs/archive/checkout/how-to/server-integration/
When I do the request to https://api-m.paypal.com/v1/payments/payment I always get a 401 Error with the message "Authentication failed due to invalid authentication credentials or a missing Authorization header.".
I checked multiple times if my credentials were correctly included into the request. I also tested the endpoint in my server environment and as well via Postman.
I also tried the route https://api-m.sandbox.paypal.com/v1/oauth2/token to exchange my credentials with an access token and got the same problem.
I also tried to create multiple Sandbox and Live Accounts and always got the same error.
Has anyone an idea what the problem could be?
There are two separate issues here.
You first need to use /v1/oauth2/token to obtain an access token, and then use that access token to call any of the other actual APIs.
The credentials you obtain from PayPal Developer will be for either "Sandbox", or "Live". Make sure you choose the correct tab (sandbox, for development). Sandbox credentials will only work for api-m.sandbox.paypal.com , and Live credentials will only work for api-m.paypal.com . The two environments are completely separate.
If you still have issues, post the SANDBOX client ID and secret you are using, and the full request and response to the api-m.sandbox.paypal.com endpoint. There should be a PayPal-Debug-Id in any error response, in the headers if nowhere else.

Paypal android sdk, response Internal server error

Im new to Paypal integration.
Im getting Internal server error when running SampleApp with Sandbox mode. Yesterday Its worked fine.
08-29 19:22:49.141: E/paypal.sdk(1036): request failure with http
statusCode:500,exception:org.apache.http.client.HttpResponseException:
Internal Server Error 08-29 19:22:49.146: E/paypal.sdk(1036): request
failed with server
response:{"name":"ACCOUNT_CANNOT_BE_FETCHED","message":"Account can
not be
fetched.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#ACCOUNT_CANNOT_BE_FETCHED","debug_id":"c06d088d20e95"}
though Pay With Card, working fine. Not really sure what is the issue Pay With PayPal account.
Please let me know how to fix this issue.
Thank you.

Intuit Partner Platform - Unauthorized access issue using production OAuth credentials

We're just going live with the Intuit API feature on our live application. We finished the last step of the process by uploading the X.509 certificate signed by Comodo PositiveSSL CA. Though our production access status shows up as ready now, we are having a problem using the production OAUTH credentials. We get an unauthorized exception using these credentials. The development OAUTH credentials work fine though. We also tried using Thawte SSL 123 but no luck even with that.
Also, the actual expiry date of the X.509 certificate, we uploaded is 16-Mar-2014 but when we upload this to the Intuit settings page, it shows expired (0/1/1). Please advice.
Adding the update here to this question- issue was with pointing to the wrong PFX file.