Skip to content

onsendev/omise-ruby

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Omise Ruby Client

Code Climate

Installation

Install using bundle (via github only at this time).

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

Examples

First configure your api key.

Omise.api_key = "skey_test_4xa89ox4z4bcfrikkh2"

Then you're ready to go. Here's how to create customer:

customer = Omise::Customer.create({
  description: "John Doe",
  email: "[email protected]"
})

puts customer.attributes
# {
#   "object" => "customer",
#   "id" => "...",
#   "livemode" => false,
#   "location" => "/customers/...",
#   "default_card" => nil,
#   "email" => "[email protected]",
#   "description" => "John Doe",
#   "created" => "2014-09-05T09:03:05Z",
#   "cards" =>  {
#     "object": "list",
#     ...
#   }
# }

Then find, update and destroy that customer.

customer = Omise::Customer.find("cust_test_4xald9y2ttb5mvplw0c")

customer.update description: "John W. Doe"
customer.description # => "John W. Doe"

customer.destroy
customer.destroyed? # => true

Releases

No releases published

Packages

No packages published