All Projects → omise → omise-ruby

omise / omise-ruby

Licence: MIT license
Omise Ruby Library

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to omise-ruby

Offset
Offset payment engine
Stars: ✭ 152 (+300%)
Mutual labels:  payments
Ledgersmb
Repository for the LedgerSMB project -- web app for accounting & ERP
Stars: ✭ 222 (+484.21%)
Mutual labels:  payments
pos-android-sdk
A selection of APIs and associated samples that enables developers to build applications for different stages of the point of sale journey
Stars: ✭ 18 (-52.63%)
Mutual labels:  payments
Killbill
Open-Source Subscription Billing & Payments Platform
Stars: ✭ 2,396 (+6205.26%)
Mutual labels:  payments
Braintree python
Braintree Python library
Stars: ✭ 217 (+471.05%)
Mutual labels:  payments
Eclair Mobile
An Android wallet for the Lightning Network
Stars: ✭ 231 (+507.89%)
Mutual labels:  payments
Card
💳 make your credit card form better in one line of code
Stars: ✭ 11,365 (+29807.89%)
Mutual labels:  payments
Far-From-Home
A cross-platform mobile developed using Flutter and Firestore for House Rental Application with integrated payment module
Stars: ✭ 27 (-28.95%)
Mutual labels:  payments
Easyupipayment Android
📱Android Library to implement UPI Payment integration easily in Android App 💳💸
Stars: ✭ 219 (+476.32%)
Mutual labels:  payments
awesome-bitcoin-cash
Bitcoin Cash projects & resources
Stars: ✭ 28 (-26.32%)
Mutual labels:  payments
Alipay
Alipay Node.js SDK 基于最新版蚂蚁金服 支付宝开发文档
Stars: ✭ 203 (+434.21%)
Mutual labels:  payments
Quilt
Hyperledger Quilt - An implementation of the Interledger Protocol
Stars: ✭ 212 (+457.89%)
Mutual labels:  payments
Pay Gateway
pay gateway. support alipay,wechatpay,unionpay,jdpay etc.
Stars: ✭ 247 (+550%)
Mutual labels:  payments
Stripe Billing Typographic
⚡️Typographic is a webfont service (and demo) built with Stripe Billing.
Stars: ✭ 186 (+389.47%)
Mutual labels:  payments
afterpay
PHP Afterpay Integration exposing the Merchant and InStore APIs - Unsupported since April 2021
Stars: ✭ 12 (-68.42%)
Mutual labels:  payments
Raiden
Raiden Network
Stars: ✭ 1,825 (+4702.63%)
Mutual labels:  payments
Breezmobile
Lightning Network mobile client
Stars: ✭ 225 (+492.11%)
Mutual labels:  payments
killbill-stripe-plugin
Kill Bill plugin for Stripe
Stars: ✭ 16 (-57.89%)
Mutual labels:  payments
yookassa-sdk-python
Python SDK for YooKassa Payments API
Stars: ✭ 31 (-18.42%)
Mutual labels:  payments
ShareLoginPay
ThirdParty login,share and pay lib
Stars: ✭ 16 (-57.89%)
Mutual labels:  payments

Omise Ruby Client

Maintainability GitHub Actions status Gem

Installation

Add the following to your Gemfile and run bundle install to install via RubyGems:

gem 'omise'

Or use the cutting-edge version by installing via GitHub:

gem 'omise', github: 'omise/omise-ruby'

Requirements

Tested on Ruby 2.5 and above

Configuration

First configure your secret key:

require "omise"

Omise.api_key = "skey_test_xxxxxxxxxxxxxxxxxxx"

After you have implemented Omise.js on your frontend you can charge the card by passing the token generated by Omise.js into the card attribute.

# Charge 1000.00 THB
charge = Omise::Charge.create({
  amount: 1_000_00,
  currency: "thb",
  card: params[:omise_token]
})

if charge.paid
  # handle success
  puts "thanks"
else
  # handle failure
  raise charge.failure_code
end

You can check the complete documentation at omise.co/docs.

API version

In case you want to enforce API version the application use, you can specify it by setting the api_version. The version specified by this settings will override the version setting in your account. This is useful if you have multiple environments with different API versions (e.g. development on the latest but production on the older version).

Omise.api_version = "2019-05-29"

It is highly recommended to set this version to the current version you're using.

Logging

To enable logging you can set Omise.logger with a Ruby logger. All HTTP requests and responses will be logged.

To disable logging, just configure Omise.logger to nil. Default is disabled.

An example configuring Rails logger:

Omise.logger = Rails.logger

Development

The test suite can be run with bundle exec rake test.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].