Fix simple Rubocop issues

This commit is contained in:
Pau Perez
2020-07-22 17:11:32 +02:00
parent 4d9fbb68d6
commit e6943ce554
2 changed files with 9 additions and 8 deletions

View File

@@ -188,7 +188,6 @@ module Spree
# is used by the gateway.
def invalidate_old_payments
order.payments.with_state('checkout').where("id != ?", id).each do |payment|
# Using update_column skips validations and so it skips validate_source. As we are just
# invalidating past payments here, we don't want to validate all of them at this stage.
payment.update_column(:state, 'invalid')

View File

@@ -147,13 +147,15 @@ module Spree
record_response(response)
if response.success?
self.class.create!(order: order,
source: self,
payment_method: payment_method,
amount: refund_amount.abs * -1,
response_code: response.authorization,
state: 'completed',
skip_source_validation: true)
self.class.create!(
order: order,
source: self,
payment_method: payment_method,
amount: refund_amount.abs * -1,
response_code: response.authorization,
state: 'completed',
skip_source_validation: true
)
else
gateway_error(response)
end