Bleumi Pay SDK for Ruby

The Bleumi Pay SDK helps you integrate Algo, Algorand Standard Asset, Ethereum, ERC-20, RSK, RSK ERC-20 & xDai payments and payouts into your business or application. The SDK bundles Bleumi Pay API into one SDK to ease implementation and support.
bleumi-pay-sdk-ruby is a Ruby library that provides an interface between your Ruby application and Bleumi Pay API. This tutorial covers the basics, including examples, needed to use the SDK.
Getting Started
Pre-requisites
Development Environment
Ruby 1.9+
Obtain An API Key
Bleumi Pay SDK uses API keys to authenticate requests. You can obtain an API key through the Bleumi Pay Dashboard.
Install Package

To install,
gem install bleumi_pay_sdk_ruby
Install from Git
Add the following in the Gemfile:
gem 'bleumi_pay_sdk_ruby', :git => 'https://github.com/bleumi/bleumi_pay_sdk_ruby.git'
Run Sample Code
The following code generates an unique checkout URL to accept payment from the buyer:
require 'bleumi_pay_sdk_ruby'
BleumiPay.configure do |config|
config.api_key['x-api-key'] = '<YOUR_API_KEY>'
end
api_instance = BleumiPay::HostedCheckoutsApi.new
create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new
begin
create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new
create_checkout_url_request.id = '<ID>'
create_checkout_url_request.currency = "<CURRENCY>"
create_checkout_url_request.amount = "<AMOUNT>"
create_checkout_url_request.success_url = "<SUCCESS_URL>"
create_checkout_url_request.cancel_url = "<CANCEL_URL>"
create_checkout_url_request.token = '<TOKEN>'
create_checkout_url_request.chain = BleumiPay::Chain::GOERLI
result = api_instance.create_checkout_url(create_checkout_url_request)
p result
rescue BleumiPay::ApiError => e
puts "Exception when calling HostedCheckoutsApi->create_checkout_url: #{e}"
end
More examples can be found under each method in SDK Classes section.
SDK Classes
BleumiPay::HostedCheckoutsApi | create_checkout_url | POST /v1/payment/hc | Generate a unique checkout URL to accept payment. |
BleumiPay::HostedCheckoutsApi | list_tokens | GET /v1/payment/hc/tokens | Retrieve all tokens configured for the Hosted Checkout in your account in the Bleumi Pay Dashboard. |
BleumiPay::HostedCheckoutsApi | validate_checkout_payment | POST /v1/payment/hc/validate | Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment. |
BleumiPay::PaymentsApi | get_payment | GET /v1/payment/{id} | Retrieve the wallet addresses & token balances for a given payment |
BleumiPay::PaymentsApi | list_payments | GET /v1/payment | Retrieve all payments created. |
BleumiPay::PaymentsApi | settle_payment | POST /v1/payment/{id}/settle | Settle a specific amount of a token for a given payment to the transferAddress and remaining balance (if any) will be refunded to the buyerAddress |
BleumiPay::PaymentsApi | refund_payment | POST /v1/payment/{id}/refund | Refund the balance of a token for a given payment to the buyerAddress |
BleumiPay::PaymentsApi | get_payment_operation | GET /v1/payment/{id}/operation/{txid} | Retrieve a payment operation for a specific payment. |
BleumiPay::PaymentsApi | list_payment_operations | GET /v1/payment/{id}/operation | Retrieve all payment operations for a specific payment. |
BleumiPay::PayoutsApi | create_payout | POST /v1/payout | Create a payout. |
BleumiPay::PayoutsApi | list_payouts | GET /v1/payout | Returns a list of payouts |
Documentation for Models
Limitations
License
Copyright 2019 Bleumi, Inc.
Code licensed under the MIT License.