Sha256: af15e065e47e357f22e5b479fabaf9ef5f41588bacf0a0f6d362d40487bbc7a7

Contents?: true

Size: 612 Bytes

Versions: 6

Compression:

Stored size: 612 Bytes

Contents

class PaymentsController < ApplicationController
  def create
    @ticket = Ticket.create!(create_params)
    srv = PuntoPagosRails::TransactionService.new(@ticket)
    srv.create ? redirect_to(srv.process_url) : render(:error)
  end

  def notification
    PuntoPagosRails::TransactionService.complete(params)
    head(200)
  end

  def success
    @ticket = PuntoPagosRails::TransactionService.ticket_by_token(params)
  end

  def error
    @ticket = PuntoPagosRails::TransactionService.failed_ticket_by_token(params)
  end

  private

  def create_params
    params.require(:ticket).permit(:amount)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
punto_pagos_rails-1.6.0 spec/dummy/app/controllers/payments_controller.rb
punto_pagos_rails-1.5.0 spec/dummy/app/controllers/payments_controller.rb
punto_pagos_rails-1.4.0 spec/dummy/app/controllers/payments_controller.rb
punto_pagos_rails-1.3.1 spec/dummy/app/controllers/payments_controller.rb
punto_pagos_rails-1.3.0 spec/dummy/app/controllers/payments_controller.rb
punto_pagos_rails-1.2.0 spec/dummy/app/controllers/payments_controller.rb