Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bleumi_pay_sdk_ruby

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bleumi_pay_sdk_ruby

  • 1.0.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Bleumi Pay SDK for Ruby

GitHub license

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

Gem

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:

# load the gem
require 'bleumi_pay_sdk_ruby'
# setup authorization
BleumiPay.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['x-api-key'] = '<YOUR_API_KEY>'
end

api_instance = BleumiPay::HostedCheckoutsApi.new
create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new # CreateCheckoutUrlRequest | Specify checkout URL creation parameters.

begin

  create_checkout_url_request = BleumiPay::CreateCheckoutUrlRequest.new # CreatePayoutRequest | Specify payout creation parameters.
  create_checkout_url_request.id = '<ID>' # Eg. 1
  create_checkout_url_request.currency = "<CURRENCY>" # Eg. USD
  create_checkout_url_request.amount = "<AMOUNT>" # Eg. 10
  create_checkout_url_request.success_url = "<SUCCESS_URL>" # Eg. https://demo.store/api/completeOrder
  create_checkout_url_request.cancel_url = "<CANCEL_URL>" # Eg. https://demo.store/api/cancelOrder
  create_checkout_url_request.token = '<TOKEN>' # Replace <TOKEN>  by anyone of the following values: 'ETH' or 'XDAI' or 'XDAIT' or ECR-20 Contract Address or 'RBTC' or RSK ECR-20 Contract Address or 'Asset ID' of Algorand Standard Asset. | Optional
  create_checkout_url_request.chain = BleumiPay::Chain::GOERLI # Replace with any Chain as required

  #Generate a unique checkout URL to accept payment.
  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

ClassMethodHTTP requestDescription
BleumiPay::HostedCheckoutsApicreate_checkout_urlPOST /v1/payment/hcGenerate a unique checkout URL to accept payment.
BleumiPay::HostedCheckoutsApilist_tokensGET /v1/payment/hc/tokensRetrieve all tokens configured for the Hosted Checkout in your account in the Bleumi Pay Dashboard.
BleumiPay::HostedCheckoutsApivalidate_checkout_paymentPOST /v1/payment/hc/validateValidate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
BleumiPay::PaymentsApiget_paymentGET /v1/payment/{id}Retrieve the wallet addresses & token balances for a given payment
BleumiPay::PaymentsApilist_paymentsGET /v1/paymentRetrieve all payments created.
BleumiPay::PaymentsApisettle_paymentPOST /v1/payment/{id}/settleSettle 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::PaymentsApirefund_paymentPOST /v1/payment/{id}/refundRefund the balance of a token for a given payment to the buyerAddress
BleumiPay::PaymentsApiget_payment_operationGET /v1/payment/{id}/operation/{txid}Retrieve a payment operation for a specific payment.
BleumiPay::PaymentsApilist_payment_operationsGET /v1/payment/{id}/operationRetrieve all payment operations for a specific payment.
BleumiPay::PayoutsApicreate_payoutPOST /v1/payoutCreate a payout.
BleumiPay::PayoutsApilist_payoutsGET /v1/payoutReturns a list of payouts

Documentation for Models

Limitations

License

Copyright 2019 Bleumi, Inc.

Code licensed under the MIT License.

FAQs

Package last updated on 14 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc