Support

Home Forums Event Espresso Premium Getting PayPal Error 10540 when EE sends blank SHIPTONAME

Getting PayPal Error 10540 when EE sends blank SHIPTONAME

Posted: November 10, 2020 at 10:17 am


Daniel

November 10, 2020 at 10:17 am

Hi!

Several customers have gotten invalid address errors in the last few days. The issue is that the EE Payment Gateway code for Paypal sometimes sends a blank customer name in the SHIPTONAME field.
EEG_Paypal_Pro.gateway.php
The original line 243 I commented out – my additional $attendee->full_name() check is below

// if ($attendee->address() && $attendee->city() && $attendee->country_ID()) {
if ($attendee->full_name() && $attendee->address() && $attendee->city() && $attendee->country_ID()) {
$use_registration_address_info = true;
} else {
$use_registration_address_info = false;
}

Error 10540 is returned.
https://developer.paypal.com/docs/nvp-soap-api/errors/#10540

My temp fix is to hack the core EE code to stop the errors and allow payments to go through.

Please let me know if this will cause any issues – I am not 100% sure of the implications of making this change.

Also, I consider this a bug because there is a name associated with these failed payment requests – it’s just not being sent. So far it’s in the several hundred dollar range for rejected orders… hoping to have this addressed soon!

TY in advance!
D


Tony

  • Support Staff

November 11, 2020 at 3:20 am

Hi Daniel,

Have you checked the EE payment logs for these?

The reason I ask is $attendee->full_name() is is just fname() and lname() combined, see:

https://github.com/eventespresso/event-espresso-core/blob/master/core/db_classes/EE_Attendee.class.php#L271-L280

Now, you should never have an attendee that doesn’t have at least Firstname (fname()) set, meaning the additional check you’ve added above:

if ($attendee->full_name() && $attendee->address() && $attendee->city() && $attendee->country_ID())

With the default setup within EE full_name should always return something in the above, meaning it does nothing under normal circumstances. Note, I’m not saying it’s doing nothing for you here but the fact that it appears you are getting to the payment options step and have an attendee with no name set is more alarming. I’m assuming that additional check is failing meaning EE then uses the billing form values.

Go to Event Espresso -> Payment methods -> Logs.

Find the log entries for one of these payments and check the values sent when it’s failing as something doesn’t seem right.


Daniel

November 11, 2020 at 10:53 am

Thank you for the reply!

I found the Paypal error code in the payments table PAY-details column.

I have included that in the next reply -privately.

D


Daniel

November 11, 2020 at 10:54 am

This reply has been marked as private.


Tony

  • Support Staff

November 12, 2020 at 10:00 am

Ok, so can you check the logs I mentioned above and confirm if the the shiptoname is set on the payment request sent to PayPal?

In the log entries mentioned find the logs linked to the transaction for a payment this has happen on. Requests sent to PayPal should have an entry with ‘Paypal Request’, responses will show ‘Paypal Response’.

The the first Paypal Request for the transaction and check the shiptoname value, is it set there?

The more I look into this the less the full_name() check used in your code to fix it makes sense to me. The check you have is fine, it’s basically not doing anything other than checking for full_name() before using it on shiptoname, but it simply shouldn’t be needed. You shouldn’t be getting to that point without a valid EE_Contact, which will need full_name().

Any caching enabled or any modifications on the site?

The support post ‘Getting PayPal Error 10540 when EE sends blank SHIPTONAME’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: closed

Updated by  Tony 2 weeks, 6 days ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!