GithubHelp home page GithubHelp logo

2checkout-ruby's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.