Giter VIP home page Giter VIP logo

wepay's Introduction

WePay Ruby SDK

To use this SDK:

# creates a wepay object you can use to make calls.
# Set use_stage to true for test/stage, false for production.
wepay = WePay.new(client_id, client_secret, use_stage)

# get the authorization url 
# you send the user to this url to authorize the application, they will return to your redirect with a code in the get parameters
redirect_uri = "http://myexamplesite.com/wepay"
url = wepay.oauth2_authorize_url(redirect_uri)
redirect_to(url)

# once you have the code you can get an access token
response = wepay.oauth2_token(code, redirect_uri)
access_token = response['access_token']


# makes a call to the /user endpoint (which requires no parameters)
response = wepay.call('/user', access_token)

# you can also open a payment account for the user
response = wepay.call('/account/create', access_token, {:name => "test account", "description" => "this is only a test" })


# switching to production
When you want to switch to production, change the _use_stage parameter on the WePay constructer to false. 


check out our developer docs at https://stage.wepay.com/developer for more info

or email [email protected] if you have any questions.

wepay's People

Contributors

leblanc avatar iain-davis avatar lunks avatar

Watchers

 avatar James Cloos avatar

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.