Module: Yotpo::User
- Included in:
- Client
- Defined in:
- lib/yotpo/api/user.rb
Instance Method Summary collapse
- #anonymous_user_confirmation(params) ⇒ Object
-
#create_user(params) ⇒ Object
Registers a new User with Yotpo.
-
#get_login_url(params) ⇒ Object
To allow the login into www.yotpo.com using app_key and secret.
-
#get_oauth_token(params) ⇒ Hash
Retrieves an oauth bearer token from Yotpo.
Instance Method Details
#anonymous_user_confirmation(params) ⇒ Object
64 65 66 |
# File 'lib/yotpo/api/user.rb', line 64 def anonymous_user_confirmation(params) get("/users/anonymous/#{params[:token]}") end |
#create_user(params) ⇒ Object
Registers a new User with Yotpo
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/yotpo/api/user.rb', line 18 def create_user(params) user = { email: params[:email], display_name: params[:display_name], first_name: params[:first_name], last_name: params[:last_name], website_name: params[:website_name], password: params[:password], support_url: params[:support_url], callback_url: params[:callback_url], url: params[:url] } post('/users', {user: user}) end |
#get_login_url(params) ⇒ Object
To allow the login into www.yotpo.com using app_key and secret
56 57 58 59 60 61 62 |
# File 'lib/yotpo/api/user.rb', line 56 def get_login_url(params) request = { app_key: params[:app_key], secret: params[:secret] } get('/users/b2blogin.json', request) end |
#get_oauth_token(params) ⇒ Hash
Retrieves an oauth bearer token from Yotpo
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/yotpo/api/user.rb', line 40 def get_oauth_token(params) request = { client_id: params[:app_key], client_secret: params[:secret], grant_type: 'client_credentials' } response = post('/oauth/token', request) return response end |