Configure - PayPal Smart Payment Buttons

2 months ago
I created a live APP on Paypal used the Client ID and pass and connected the plug in.
However I see a field on PayPal called Live return URL. What should I put in this field?

I also see some info around about things called PDT and IPN is there anything else I need to do to set these up? And what is their purpose? All the info I see around on forums is for very old versions from like 8-10 years ago. What is the best place to read about that for version 4.3?

How do I test if these PDT and IPN links actually exist I couldn't find anything in the plugins folder called IPNHandler or PDTHandler.
2 months ago
See the  documentation
https://docs.nopcommerce.com/en/getting-started/configure-payments/payment-methods/paypal-smart-payment-buttons.html

I don't think some of those fields are required for the smart button vs the Standard
2 months ago
The information on this link doesn't say anything about Return URL, PDT or IPN.
1 month ago
hello, I have a problem with the plug in object installed and made as per tutorial.
But by mistake as seen from the video.

It only works in checkout, what a problem it can be, nopcommerce 4.3

http://www.e-direct.eu/video.mp4
1 month ago
Horus76 wrote:
http://www.e-direct.eu/video.mp4


Can you disable ajax cart plugin and test. It seems ajax cart plugin preventing it.
1 month ago
disabled, but it doesn't work.
It doesn't work anywhere on the site.
In the cart, the following error came out:

Request is not well-formed, syntactically incorrect, or violates schema.


Messaggio breve  
Payments.PayPalSmartPaymentButtons error:
Request is not well-formed, syntactically incorrect, or violates schema.
Messaggio completo  
System.AggregateException: One or more errors occurred. ({"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"6b610bd3bd2f4","details":[{"field":"/payer/phone/phone_number/national_number","value":"","location":"body","issue":"INVALID_PARAMETER_SYNTAX","description":"The value of a field does not conform to the expected format."},{"field":"/payer/phone/phone_number/national_number","value":"","location":"body","issue":"INVALID_STRING_LENGTH","description":"The value of a field is either too short or too long."}],"links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_PARAMETER_SYNTAX","rel":"information_link","encType":"application/json"},{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH","rel":"information_link","encType":"application/json"}]})
---> PayPalHttp.HttpException: {"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"6b610bd3bd2f4","details":[{"field":"/payer/phone/phone_number/national_number","value":"","location":"body","issue":"INVALID_PARAMETER_SYNTAX","description":"The value of a field does not conform to the expected format."},{"field":"/payer/phone/phone_number/national_number","value":"","location":"body","issue":"INVALID_STRING_LENGTH","description":"The value of a field is either too short or too long."}],"links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_PARAMETER_SYNTAX","rel":"information_link","encType":"application/json"},{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH","rel":"information_link","encType":"application/json"}]}
   at PayPalHttp.HttpClient.Execute[T](T req)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Nop.Plugin.Payments.PayPalSmartPaymentButtons.Services.ServiceManager.HandleCheckoutRequest[TRequest,TResult](PayPalSmartPaymentButtonsSettings settings, TRequest request)
   at Nop.Plugin.Payments.PayPalSmartPaymentButtons.Services.ServiceManager.<>c__DisplayClass22_0.<CreateOrder>b__0()
1 month ago
PayPal requires the phone number to be numeric (no special characters) and no more than 14 characters (bug fix).  Make sure you have the latest plugin version which should include that fix.

Or if you have the plugin source, replace the phonenumber details with the validation below and recompile:


if (!string.IsNullOrEmpty(billingAddress.PhoneNumber))
{
    //paypal expects Minimum length: 1, Maximum length: 14, Pattern: ^[0 - 9]{ 1,14}?$
    var numericPhone = CommonHelper.EnsureNumericOnly(billingAddress.PhoneNumber);
    var validatedPhone = CommonHelper.EnsureMaximumLength(numericPhone, 14);
    orderDetails.Payer.PhoneWithType = new PhoneWithType { PhoneNumber = new Phone { NationalNumber = validatedPhone } };
}
1 month ago
Thank you.
The plug in is for nop 4.3, (the fix is ​​for nop 4.2).
I'm not very experienced.

***********
                if (! string.IsNullOrEmpty (billingAddress.PhoneNumber))
                {
                    var cleanPhone = CommonHelper.EnsureMaximumLength (CommonHelper.EnsureNumericOnly (billingAddress.PhoneNumber), 14);
                    orderDetails.Payer.PhoneWithType = new PhoneWithType {PhoneNumber = new Phone {NationalNumber = cleanPhone}};
                }
1 month ago
That should be fine.  Do you happen to know what phone number resulted in the error?
1 month ago
Thank you.
I was wrong to enter the phone number.
The error remains that the plug works only in ckeckOut.
See video