Skip to content

Instantly share code, notes, and snippets.

@wehub
Created April 21, 2017 18:22
Show Gist options
  • Select an option

  • Save wehub/3cb91dd8cc8f5c932f41f027e4e4086a to your computer and use it in GitHub Desktop.

Select an option

Save wehub/3cb91dd8cc8f5c932f41f027e4e4086a to your computer and use it in GitHub Desktop.
# WePay Ruby SDK - http://git.io/a_c2uQ
require 'wepay'
# oauth2 parameters
code = params[:code]; # the code parameter from step 2
redirect_uri = "http://www.example.com/oauth2_redirect_uri"; # this is the redirect_uri you used in step 1
# application settings
client_id = 123456789
client_secret = '1a3b5c7d9'
# set _use_stage to false for live environments
wepay = WePay::Client.new(client_id, client_secret, _use_stage = true)
# create an account for a user
response = wepay.oauth2_token(code, redirect_uri)
# display the response
p response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment