Add this line to your application's Gemfile:
gem 'yookassa'
And then execute:
$ bundle
Or install it yourself as:
$ gem install yookassa
# Payment
client = Yookassa::Payment.new(shop_id: 'shop_id', api_key: 'api_key')
payment = {
amount: {
value: 100,
currency: 'RUB'
},
capture: true,
confirmation: {
type: 'redirect',
return_url: return_url
}
}
client.create(payment: payment)
client.get_payment_info(payment_id: '12345')
client.capture(payment_id: '12345')
client.cancel(payment_id: '12345')
# Refund
client = Yookassa::Refund.new(shop_id: 'shop_id', api_key: 'api_key')
client.create(payload: payload)
client.get_refund_info(payment_id: '12345')
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
The gem is available as open source under the terms of the MIT License.