Created
April 21, 2017 18:22
-
-
Save wehub/3cb91dd8cc8f5c932f41f027e4e4086a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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