PayPal Pro NVP API Error Localization - paypal

I am creating an english and french website that will be using paypal for payment processing.
I have all of the PayPal API working properly, and currently I am just outputting any error messages to the user (L_LONGMESSAGEX). However this is always english, is there a way to output the error messages as french?
I saw a LOCALECODE parameter but that seems to be something else.
Or am I going to have to setup my own lookup table based off the error codes?

No. This is not possible.
The PayPal API error messages are intended for your use only; you're supposed to properly handle these exceptions within your own application, and output a more meaningful message to the buyer.
(For example; "L_LONGMESSAGE0=This transaction has already been approved" means nothing to your buyers. Yet "This transaction has been processed previously. Did you order twice? Give our support team a call if you have any questions regarding your order!" is a lot clearer.)

Related

Looking for examples for error handling on Paypal payment status code (other than 201)?

Hello Paypal experience experts,
Since about 5 months I'm trying to implementate version /v2 of the Paypal payment SDK.
I am looking for examples of what you should tell a customer what to do when receiving an error code in the Paypal payment response status code (HTTP?), other than 201.
I'm using the Paypal javascript SDK and PHP SDK with CreateOrder.php and CaptureOrder.php.
A basic test in the sandbox does function okay.
In PHP I will use a self created object from the Paypal response for easier error handling on the client side.
The only example which Paypal gives on their site is about code 422 'Instrument Declined'.
However Paypal also shows a number of other status codes, like 200, 202, 204, 4xx.
To be able to complete my error handling script I would like to have some examples of what the customer should do if any of the other error codes occur.
I would have expected that Paypal would have given those examples, but they seem not to exist (Paypal assumes they will not occur (?) ).
(There are other questions on this forum that look similar, but they are not about /v2)
Can somebody please help me with those examples?
Thank you in advance.
Martin
The best error-handling example for a server-based integration is at https://developer.paypal.com/demo/checkout/#/pattern/server
This shows how to restart with client-side JS in the case of the recoverable instrument declined. For all other cases, it simply shows the error message details returned. If you want to show a different message, you can customize it to your needs, but it is not necessary. The important thing is that in the case of errors you do still return some details from the backend to the frontend that your frontend knows what to do with, which is particularly important for the case of INSTRUMENT_DECLINED.
Other possible error types are documented toward the end of each API reference, for the case of the Orders API that can be found here.

PayPal REST API - Redirect Error Handling

My question is simple yet I can't find any SO posts or PayPal documentation to answer it.
In the event of a PayPal user having some error being redirected after completing their checkout (internet goes out, browser crashes, they close their browser before the redirect goes through, random networking issues, etc.) How are we suppose to handle that?
I thought using the following REST API
GET /v1/payments/payment/<Payment-Id>
Would solve my problem but since the state returned from this request does not change from created to approved until the funds have been executed it is useless. In the case of having some redirect error you will not have been able to execute the funds and thus it will simply be in the created state still which does not help you.
Additionally I thought maybe PayPals IPN system used for CLASSIC API would be the answer to my problem but again it fails. The IPN system does not contain relevant information such as transaction ID which is needed to link the two systems together.
Is there no way to do automated error handling using the REST API?

Paypal Classic API error codes processing in PHP

Here we have long list of paypal errors
This list is asolutely unusable. For some errors "Short Message" should be shown to the user, for some errors "Long Message". Part of errors should be described to users in some cases we have to redirect user to Paypal. Can anybody suggest php library to process all these errors?
I don't think any such library exists at this time (and yes, some Paypal errors leave much to be desired). The closest I could find was this JSON Object, but it doesn't improve on the messages, only rehashes them. Maybe consider creating one and putting it in GitHub for public use?

Has anyone had success using PayPal SoftDescriptors?

Paypal provides access to a parameter called "SoftDescriptor" in a number of their payment request API calls, in the classic API (either NVP or SOAP). In theory, this parameter lets you send transaction-specific data along with your request, which will be passed along to the buyer's credit card statement.
This parameter is available on at least:
DoCapture
DoReferenceTransaction
DoExpressCheckoutPayment
I cannot, for the life of me, get this to work. None of these calls seem to set the softdescriptor for the initial descriptor (Which shows up in the bank statement while the charge is pending, before the payment posts). I've been waiting a few days for the payments to post to see if it will change at that point, but I'm skeptical.
Has anyone successfully used the SoftDescriptor? Did it require extra account setup?
This might be very late.
Soft Descriptors is supported only for US,UK and CA merchants.
Your account needs to be enabled for Soft Descriptor.You can contact Businesss/Customer Support to get this enabled.
https://developer.paypal.com/docs/classic/release-notes/merchant/PayPal_Merchant_API_Release_Notes_115/#softdescriptorforpro
Sorry, I know this is an old post, but I was looking for the same answer to the same question and I thought I would share what I found.
You should be able to use the following link to move past this error. In my case, I had a comma after the wrong right curly brace. Just copy and paste the example, in the aforementioned link, and change the values to meet your needs.
And I am about to post my own question about why the transaction amount is considered invalid

Set PayPal Direct Payment errors language

Is there any way to set the language of the errors returned by PayPal when processing a Direct Payment API call?
I've tried with:
LOCALECODE=es_US
to show them in spanish, but no luck. I called PayPal Support and the person said he didn't know, that I should ask in the forums ?!?!?
Anyone knows how to do this?
PayPal is not going to return the error message back in the selected language for the buyer. If you are wanting language specific errors, you would need to create your own database. Then based on the country, and the error number that is returned you can display the correct error message in that particular language.
You are probably looking for this , or at least I think that the person to whom you were talking was suggesting this kind of approach.
Remember that you are handling moneys and payments here, if you are not sure about what are you doing spend some months/years to refine your approach.