Skip to content

gnapse/2checkout-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2Checkout Ruby Library

This library provides developers with a simple set of bindings to the 2Checkout purchase routine, Instant Notification Service and Back Office API.

To use, download or clone the repository.

git clone https://github.com/craigchristenson/2checkout-ruby.git

Or import into your Gemfile

gem 'twocheckout', :git => "git://github.com/craigchristenson/2checkout-ruby.git"

Full documentation for each binding will be provided in the Wiki.

Example API Usage

Example Usage:

Twocheckout.api_credentials=({'username' => 'APIuser1817037', 'password' => 'APIpass1817037'})

@action = Twocheckout::Sale.refund({'sale_id' => 4769044324, 'comment' => "test refund", 'category' => 1})
puts @action

Example Response:

{
   "response_code" : "OK",
   "response_message" : "refund added to invoice"
}

Example Checkout Usage:

Example Usage:

require "sinatra"

get '/' do
  @@form = Twocheckout::Charge.submit({'sid' => 1817037, 'cart_order_id' => 'Example Sale', 'total' => 1.00})
  @@form
end

Example Return Usage:

Example Usage:

require "sinatra"

post '/' do
  @@response = Twocheckout::Return.request({ :credentials => {'sid' => '532001', 'secret' => 'tango'}, :params => params})
  @@response.inspect
end

Example Response:

{
   "code" : "PASS",
   "message" : "Hash Matched"
}

Example INS Usage:

Example Usage:

require "sinatra"

post '/' do
 @@response = Twocheckout::Ins.request({ :credentials => {'sid' => 532001, 'secret' => 'tango'}, :params => params})
 @@response.inspect
end

Example Response:

{
   "code" : "PASS",
   "message" : "Hash Matched"
}

Full documentation for each binding will be provided in the Wiki.

About

2Checkout Ruby Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages