Skip to content

tutelaris/simplepay

 
 

Repository files navigation

1 Install gem

gem 'simplepay', :git => "git://github.com/SeNaP/simplepay.git"

bundle install

2 Create configurate file

Create simplepay.rb file in /config/initializers/

  Simplepay.configure do | config |
	config.development 				= false
	config.sp_outlet_id 				= 0000
	config.request_method				= :get
	config.secret_key 				= "token1"
	config.secret_key_for_result			= "token2"

	config.result_callback 			= ->(notification) { 
		Order.find(params[:sp_order_id]).update(paid: true)
		render json: notification.success 
	}
	config.success_callback 		= ->(notification) { 
		flash[:success]  = "paymetn success"
		redirect_to :payments_success 
	}
	config.fail_callback 			= ->(notification) { render text: "fail" }
end

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 98.6%
  • Shell 1.4%