-
-
Notifications
You must be signed in to change notification settings - Fork 76
Conversation
c198c5b
to
50934a3
Compare
c3dd393
to
c09a16b
Compare
The minimum version is now 0.8.1 as it includes the utility method `SolidusSupport.combined_first_and_last_name_in_address?` that is used in order to understand whether to use the name attribute or the old firstname and lastname.
probably this is necessary with rspec-rails 4.x
On recent Solidus version the `::Spree::Preferences::Persistable` module must be explicitly included in order to use preferences.
Use the already existent `SolidusPaypalbraintree::Address` service class as a wrapper around `Spree::Address` which is responsible to respond to both firstname/lastname and name methods, in order to be compatible with all Solidus versions. - fix factories - check for other fields rather than full_name/name on expectations, in order to work on all Solidus versions. Co-authored-by: Andrea Longhi <andrea@spaghetticode.it> Co-authored-by: Flavio Auciello <flavioauciello@nebulab.it>
We're still supporting Solidus 2.9 and 2.10, but since 2.11 we can rely on the presence of `Spree::Address::Name` for name manipulations.
The method does not depend on the instance, plus this way it can be easily reused elsewhere.
This seems a better place for defining this method as it deals with the address model name.
According to [Braintree 3D Secure doc][1] the 'region' parameter now doesn't accept state's name anymore, but abbreviation. [1]: https://developers.braintreepayments.com/guides/3d-secure/client-side/javascript/v3#using-3ds Co-authored-by: Andrea Longhi <andrea@spaghetticode.it> Co-authored-by: Flavio Auciello <flavioauciello@nebulab.it>
Co-authored-by: Andrea Longhi <andrea@spaghetticode.it> Co-authored-by: Flavio Auciello <flavioauciello@nebulab.it>
c09a16b
to
75e011d
Compare
Ruby 2.4 is not supported by Rubocop since 1.12, and Solidus is currently supporting Ruby >= 2.5.
48b7d50
to
2f7370e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a question, thanks!
address.name = name | ||
if SolidusSupport.combined_first_and_last_name_in_address? | ||
address.name = begin | ||
if first_name.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this check? In Solidus 2.11 we'll have both first_name
and name
always synced and this is probably always false. In Solidus 3, there's no reason to check first_name
, which is no more used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here first_name
is an instance attribute of SolidusPaypalBraintree::TransactionAddress
(together with last_name
and name
). If I recall correctly these values are returned by Braintree itself and maybe they can be valorized differently according to the API version (that's why we need the check on its presence).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah makes sense!
Let the extension work with Solidus 3.0.
Adjust code related to
Spree::Address
to fit the new combined first and last name behaviour; it also update some dependency and lint rules.