Skip to content

reservamos/kushki-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kushky-ruby

This is a gem for the kushki api for ruby.

Installation

Add this line to your application's Gemfile:

gem 'kushki-ruby', git: 'https://github.com/reservamos/kushki-ruby', tag: 'v1.0.2'

And then execute:

$ bundle

Usage

Right now there are only 2 api methods implemented: charge and refund.

To use this gem

require 'kushki'

client = Kushki.new YOUR_PRIVATE_MERCHANT_ID

CHARGE:

charge receives charge attributes detailed in https://docs.kushkipagos.com/api-reference/card/charge as parameters.

response = client.charge({ token: "1as123klsad123, ... })

charge response current supported attributes:

  ticket_number
  approval_code
  masked_card_number
  card_holder_name
  card_type
  issuing_bank
  payment_brand
  raw

INIT_TRANSFER:

TODO: Update this readme https://docs.kushkipagos.com/api-reference/transfer-in/transferininit

INIT_CASH

TODO: Update this readme https://docs.kushkipagos.com/api-reference/cash-in/cashininit

REFUND

refund receives the ticket_number received from the charge response.

response = client.refund "12312313123"

refund response current supported attributes:

  ticket_number

Error handling

  • when api returns an error 400, a TransactionError exception is raised.
  • when api return an error 500, a RequestError exception is raised.
  • when communication to api timeouts or fails, an UnavailableError is raised.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/kushki-ruby.

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published