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 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 Usage:
require "sinatra"
get '/' do
@@form = Twocheckout::Charge.submit({'sid' => 1817037, 'cart_order_id' => 'Example Sale', 'total' => 1.00})
@@form
end
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 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.