Sha256: cf8fac389abe810ec47dcd8574f8e9f5952328b436cd4caacd599ed3b133145a
Contents?: true
Size: 800 Bytes
Versions: 7
Compression:
Stored size: 800 Bytes
Contents
module Spree::Admin::PaymentsControllerDecorator def paypal_refund if request.get? if @payment.source.state == 'refunded' flash[:error] = Spree.t(:already_refunded, :scope => 'paypal') redirect_to admin_order_payment_path(@order, @payment) end elsif request.post? response = @payment.payment_method.refund(@payment, params[:refund_amount]) if response.success? flash[:success] = Spree.t(:refund_successful, :scope => 'paypal') redirect_to admin_order_payments_path(@order) else flash.now[:error] = Spree.t(:refund_unsuccessful, :scope => 'paypal') + " (#{response.errors.first.long_message})" render end end end end Spree::Admin::PaymentsController.prepend Spree::Admin::PaymentsControllerDecorator
Version data entries
7 entries across 7 versions & 1 rubygems