0.0
No commit activity in last 3 years
No release in over 3 years
Rocket Ruby SDK to Rocket API, with this SDK you can create invoices and retrieve invoice status from out Simple Checkout System, you can make API calls when your plan have it.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 0.10
~> 0.8
~> 10.0
~> 3.4

Runtime

 Project Readme

Rocket::Ruby::Sdk

Ruby SDK to Rocket API, with this SDK you can create invoices and retrieve invoice status from out Simple Checkout System, you can make API calls when your plan have it. This gem is based at SDK PHP

Installation

Add this line to your application's Gemfile:

gem 'rocket-ruby-sdk'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rocket-ruby-sdk

Usage

Send a new order:

checkout = Rocket::Checkout::Checkout.new 'INFORM YOU SIMPLE CHECKOUT KEY'

invoice = Rocket::Invoice::Invoice.new
invoice.invoice_number = 1
invoice.invoice_description = 'Test Description'
invoice.cancel_url = 'http://example.com/cancel'
invoice.success_url = 'http://example.com/success'
invoice.customer_email = 'john@doe.com'
invoice.customer_name = 'John Doe'

product = Rocket::Invoice::InvoiceProduct.new
product.name = 'Test Product'
product.description = "Test Product Description"
product.quantity = 10
product.unity_price = BigDecimal.new('9.90')

product2 = Rocket::Invoice::InvoiceProduct.new
product2.name= "Test Product"
product2.description = "Test Product Description"
product2.quantity = 1
product2.unity_price = BigDecimal.new('1000.00')

invoice.add_products(product)
invoice.add_products(product2)

checkout.create_invoice(invoice)

return_url = checkout.pay_invoice_url
invoice_unique_code = checkout.invoice_token
status = checkout.invoice_status

Query an order:

checkout = Rocket::Checkout::Checkout.new 'INFORM YOU SIMPLE CHECKOUT KEY'
invoice = checkout.check_invoice 'INVOICE UNIQUE ID'
status = checkout.invoice_status

Check if a user exists:

transfer = Rocket::Payment::Transfer.new 'INFORM YOU SIMPLE CHECKOUT KEY'
send = transfer.check_user 'user@email.com'
send.status

Get your actual Balance

You can check your actual balance for all your accounts:

default = Your default money account bitcoin = You bitcoin Wallet blocked = Your blocked funds wallet

transfer = Rocket::Payment::Transfer.new 'INFORM YOU SIMPLE CHECKOUT KEY'
send = $transfer.check_balance 'default'
send.status

Transfer Money:

transfer = Rocket::Payment::Transfer.new 'INFORM YOU SIMPLE CHECKOUT KEY'
send = transfer.send_transfer 'user@email.com', BigDecimal.new('20.00'), 'USD',
  'Your Custom Message'
send.status

Known issues

  • Cover the gem with tests (I believe not something from another world)
  • Improve DSL SDK (It was based on a php code)

So ...

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jonathanccalixto/rocket-ruby-sdk.