Class: Spree::ConektaOxxoController

Inherits:
StoreController
  • Object
show all
Defined in:
app/controllers/spree/conekta_oxxo_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
# File 'app/controllers/spree/conekta_oxxo_controller.rb', line 7

def create
  if params[:data][:object][:object] == 'charge' && params[:data][:object][:status] == 'paid'
    payment = Spree::Payment.find_by(response_code: params[:data][:object][:payment_method][:reference])
    policy = PaymentOxxoPolicy.new(payment)
    policy.process(params[:data][:object])
  end
  head :ok
end

#receiptObject



16
17
18
19
# File 'app/controllers/spree/conekta_oxxo_controller.rb', line 16

def receipt
  @payment = Spree::Payment.find(params[:id])
  render layout: false
end