forked from solidusio/solidus_paypal_braintree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ".
- Loading branch information
1 parent
819bd34
commit 795abb0
Showing
2 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters