app/controllers/supercharged/gateway_notifications_controller.rb in supercharged-2.0.4 vs app/controllers/supercharged/gateway_notifications_controller.rb in supercharged-2.1.0
- old
+ new
@@ -7,24 +7,24 @@
persistent_logger.info("params = #{params.inspect}")
@notification = GatewayNotification.create!(params: params, gateway: params[:gateway], raw_post: request.raw_post)
@notification.logger = persistent_logger
- error = if !@notification.complete?
- "not_completed"
- elsif !@notification.acknowledge
+ error = if !@notification.acknowledge
"acknowledge_failed"
+ elsif !@notification.complete?
+ "not_completed"
elsif !@notification.charge
"charge_not_found"
end
if error
persistent_logger.error("Error: #{error.inspect}")
charge = @notification.charge
if charge && !charge.error?
- @notification.charge.failed!
+ @notification.charge.fail
@notification.charge.update_attribute(:error, error)
end
redirect_to new_charge_url, alert: "#{I18n.t("supercharged.gateway_controller.error.failed")}: #{I18n.t("supercharged.gateway_controller.error.#{error}")}"
else