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

Fix for admin/payments_controller_decorator being outdated and causing some bugs #184

Closed
wants to merge 6 commits into from
Closed

Conversation

Dethon
Copy link
Contributor

@Dethon Dethon commented Dec 4, 2017

The code in this decorator was severely outdated. I refactored it a bit so it uses a callback, should be easier to maintain it this way.
There were some bugs caused by this, mainly there was no support for store credit and the first payment always failed due to it being performed two times

…of the code was outdated when comparing with recent (3.3-3.4) versions of Spree. This should be more maintainable
if params[:card].present? && params[:card] != 'new'
@payment.source = @payment.payment_method.payment_source_class.find_by_id(params[:card])
elsif @payment.payment_source.is_a?(Spree::Gateway::BraintreeVzeroBase)
create.before :initBraintree
Copy link
Contributor

Choose a reason for hiding this comment

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

@DethonUSAL thanks, but can you rename it to init_braintree?

elsif @payment.payment_source.is_a?(Spree::Gateway::BraintreeVzeroBase)
create.before :initBraintree

private
Copy link
Contributor

Choose a reason for hiding this comment

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

@DethonUSAL please add an empty newline after private :)

@Dethon
Copy link
Contributor Author

Dethon commented Jan 5, 2018

Requested changes implemented along with some rubocop fixes

@Dethon
Copy link
Contributor Author

Dethon commented Apr 4, 2018

Any news about when (or if) this is going to be merged?

@damianlegawiec damianlegawiec self-assigned this Nov 12, 2018
@Dethon Dethon closed this Aug 14, 2024
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.

2 participants