Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change payment method partial name convention #3217

Conversation

bitberry-dev
Copy link

Hi!

I propose to use underscore in the name of the payment method partial. It is more convenient and clearer. What do you think, guys?

@mdesantis
Copy link
Contributor

I agree :)

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. Thanks 🙏🏻

@spaghetticode
Copy link
Member

👍 This is definitely an improvement, but I do have some concerns: besides some failing specs that should be addressed, this may be a breaking change for some stores and/or extensions, as some partials will possibly need to be renamed?

@bitberry-dev
Copy link
Author

Once everyone agrees I'll fix the tests.

this may be a breaking change for some stores and/or extensions, as some partials will possibly need to be renamed

Yes

@tvdeyen
Copy link
Member

tvdeyen commented May 31, 2019

I won’t consider this breaking, but a fix instead. The only difference is that a payment method name "Credit Card" would currently be credit card and now credit_card. The former will most likely lead to bugs. Since this is a rather new feature and even aliased to the former method_type method I think this is save.

@bitberry-dev
Copy link
Author

I won’t consider this breaking, but a fix instead. The only difference is that a payment method name "Credit Card" would currently be credit card and now credit_card. The former will most likely lead to bugs. Since this is a rather new feature and even aliased to the former method_type method I think this is save.

No, it is 'gateway' already :)
https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment_method/credit_card.rb#L17

@bitberry-dev bitberry-dev force-pushed the feature/change_payment_method_partial_naming_convention branch from 4c6242f to 5683b20 Compare May 31, 2019 10:22
@bitberry-dev bitberry-dev force-pushed the feature/change_payment_method_partial_naming_convention branch from 5683b20 to 3d3b7d7 Compare May 31, 2019 10:23
@tvdeyen
Copy link
Member

tvdeyen commented May 31, 2019

gateway is the fallback for all credit card payment methods that do neither implement method_type nor partial_name

https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment_method.rb#L204

Anyway. This fix is good and appreciated. Thanks for the work.

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I agree with @tvdeyen and this should be safe.

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I think we should at least mention in the CHANGELOG that if stores are overriding _storecredit partials, they should rename them to _store_credit. I will take care of that!

@kennyadsl kennyadsl merged commit 3af846b into solidusio:master Jun 10, 2019
jaimelr added a commit to magma-labs/solidus_oxxo_pay that referenced this pull request Jul 24, 2019
In recent version of Solidus (starting 2.9)
the payment method naming convention changed, see: solidusio/solidus#3217
jaimelr added a commit to magma-labs/solidus_oxxo_pay that referenced this pull request Jul 25, 2019
In recent version of Solidus (starting 2.9)
the payment method naming convention changed, see: solidusio/solidus#3217
jaimelr added a commit to magma-labs/solidus_oxxo_pay that referenced this pull request Jul 26, 2019
In recent version of Solidus (starting 2.9)
the payment method naming convention changed, see: solidusio/solidus#3217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants