Ruby gem wrapper for official Liqpay SDK https://github.com/liqpay/sdk-ruby
Add the gem to your Gemfile:
gem 'liqpay', github: 'liqpay/sdk-ruby'
And don't forget to run Bundler:
$ bundle install
Get API keys on https://www.liqpay.com/ and save them in config:
# config/initializers/liqpay.rb
::Liqpay.configure do |config|
config.public_key = 'public_key'
config.private_key = 'private_key'
end
You can also store API keys in ENV['LIQPAY_PUBLIC_KEY']
and ENV['LIQPAY_PRIVATE_KEY']
require 'liqpay'
liqpay = Liqpay.new
liqpay.api 'invoice/send', { email: '[email protected]', amount: 100, currency: 'UAH',
order_id: 1,
goods: [{
amount: 100,
count: 1,
unit: 'pcs',
name: 'Order' }]}
Full Liqpay API documentation is available on https://www.liqpay.com/en/doc
To pass the API tests, specify API keys in ENV['LIQPAY_PUBLIC_KEY']
and ENV['LIQPAY_PRIVATE_KEY']
or in spec/dummy/config.rb
:
# spec/dummy/config.rb
::Liqpay.configure do |config|
config.public_key = 'public_key'
config.private_key = 'private_key'
end