Project

payonline

0.01
No commit activity in last 3 years
No release in over 3 years
This is a thin wrapper library that makes using PayOnline API a bit easier.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 11.2

Runtime

~> 0.14.0
 Project Readme

Payonline

Gem Version Code Climate

This is a thin wrapper library that makes using PayOnline API a bit easier.

Installation

Add this line to your application's Gemfile:

gem 'payonline'

And then execute:

$ bundle

Configuring

Create an initializer: config/initializers/payonline.rb:

Payonline.config do |config|
  config.merchant_id = '12345'
  config.private_security_key = 'your-private-security-key'
  config.return_url = 'https://example.com/payments/success'
  config.fail_url = 'https://example.com/payments/fail'
end

Usage

Get payment URL:

Payonline::PaymentGateway.new(order_id: 1, amount: 2.0, currency: 'RUB').payment_url

Implement a callback action that will be called by PayOnline after a transaction is completed:

@response = Payonline::PaymentResponse.new(params)

if @response.valid_payment?
  Order.find(@response.order_id).set_paid!
end

Contributing

  1. Fork it
  2. Clone it git clone https://github.com/SumatoSoft/payonline
  3. Create your feature branch git checkout -b my-new-feature
  4. Commit your changes git commit -am 'Add some feature'
  5. Push to the branch git push origin my-new-feature
  6. Create new pull request through Github