Sha256: 18b27869cd266c1fe76abee3458ab24db7e063ca2fa7e4fdc08dedc72ce67fbd

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

# -*- encoding : utf-8 -*-
class RobokassaController < ApplicationController
  before_filter :create_notification

  def paid
    if @notification.valid_result_signature?
      instance_exec @notification, &Rubykassa.result_callback
    else
      instance_exec @notification, &Rubykassa.fail_callback
    end
  end

  def success
    if @notification.valid_success_signature?
      instance_exec @notification, &Rubykassa.success_callback
    else
      instance_exec @notification, &Rubykassa.fail_callback
    end
  end

  def fail
    instance_exec @notification, &Rubykassa.fail_callback
  end

  private

    def create_notification
      @notification = Rubykassa::Notification.new request.query_parameters
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubykassa-0.4.2 app/controllers/robokassa_controller.rb
rubykassa-0.4.1 app/controllers/robokassa_controller.rb
rubykassa-0.4.0 app/controllers/robokassa_controller.rb