https://github.com/gnapse/2checkout-ruby
2Checkout Ruby Library
https://github.com/gnapse/2checkout-ruby
Last synced: about 2 months ago
JSON representation
2Checkout Ruby Library
- Host: GitHub
- URL: https://github.com/gnapse/2checkout-ruby
- Owner: gnapse
- License: mit
- Created: 2012-08-20T21:13:52.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2012-08-20T21:21:34.000Z (almost 13 years ago)
- Last Synced: 2025-02-05T23:01:10.694Z (4 months ago)
- Language: Ruby
- Size: 99.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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.
```shell
git clone https://github.com/craigchristenson/2checkout-ruby.git
```Or import into your Gemfile
```ruby
gem 'twocheckout', :git => "git://github.com/craigchristenson/2checkout-ruby.git"
```Full documentation for each binding will be provided in the [Wiki](https://github.com/craigchristenson/2checkout-ruby/wiki).
Example API Usage
-----------------*Example Usage:*
```ruby
Twocheckout.api_credentials=({'username' => 'APIuser1817037', 'password' => 'APIpass1817037'})@action = Twocheckout::Sale.refund({'sale_id' => 4769044324, 'comment' => "test refund", 'category' => 1})
puts @action
```*Example Response:*
```json
{
"response_code" : "OK",
"response_message" : "refund added to invoice"
}
```Example Checkout Usage:
-----------------------*Example Usage:*
```ruby
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:*
```ruby
require "sinatra"post '/' do
@@response = Twocheckout::Return.request({ :credentials => {'sid' => '532001', 'secret' => 'tango'}, :params => params})
@@response.inspect
end
```*Example Response:*
```json
{
"code" : "PASS",
"message" : "Hash Matched"
}
```Example INS Usage:
------------------*Example Usage:*
```ruby
require "sinatra"post '/' do
@@response = Twocheckout::Ins.request({ :credentials => {'sid' => 532001, 'secret' => 'tango'}, :params => params})
@@response.inspect
end
```*Example Response:*
```json
{
"code" : "PASS",
"message" : "Hash Matched"
}
```Full documentation for each binding will be provided in the [Wiki](https://github.com/craigchristenson/2checkout-ruby/wiki).