You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
Fixes issue solidusio#302
In the case that:
- SolidusSupport::combined_first_and_last_name_in_address returns true;
- Spree::Address::Name is not defined; and
- the given name argument to self.split_name is just one word (e.g
"Bruce")
Then it would return the array of one element such as ['Bruce'].
lastname was assuming that there should be two elements and was calling
.last on the array, resulting in the same word as firstname. This made
the recipientName for example be "Bruce Bruce".
https://github.com/solidusio/solidus_paypal_braintree/blob/819bd3467e6f0c8ead8d855138ba88e10eb80a18/app/models/solidus_paypal_braintree/address.rb#L35
The #fullname method was added to fix the problem that if the given name
was only one word, then recipientName won't attempt to add a space
between the firstname and lastname's returned empty string. Otherwise,
it would cause for example: "Bruce ".
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
When the user only inputs their first name in the address
name
field then the user's first and last names will get added to the recipientName here.The issue is that these
firstname
andlastname
methods always return a string and are not checking if alast_name
actually exists.Example:
The user enters "John" as their name on the address field.
The
recipientName
will be "John John"The text was updated successfully, but these errors were encountered: