Class: Spree::BcashController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/bcash_controller.rb

Instance Method Summary collapse

Instance Method Details

#notifyObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/spree/bcash_controller.rb', line 6

def notify
  notification = Spree::BcashNotification.create_from_params(params)

  if notification.cod_status == "1"
    Order.transaction do
      @order = Spree::Order.find_by_number(notification.id_pedido)

      @order.payment.complete
    end
  end

  redirect_to order_path(id: notification.id_pedido)
end