cgimenes / yookassa

Simple integration with YooKassa payment gateway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YooKassa API Ruby Client

Yookassa Gem Version License

Installation

Add this line to your application's Gemfile:

gem 'yookassa'

And then execute:

$ bundle

Or install it yourself as:

$ gem install yookassa

Usage

# 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')

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

License

The gem is available as open source under the terms of the MIT License.

About

Simple integration with YooKassa payment gateway

License:MIT License


Languages

Language:Ruby 100.0%