class Mpayer::Base
Public Class Methods
new(user_no, token)
click to toggle source
# File lib/mpayer/base.rb, line 9 def initialize(user_no, token) @user_no = user_no @token = token @auth = WSSE::header(@user_no, @token) @header = {'Content-Type'=> 'application/json', 'Accept' => 'application/json', 'X-WSSE' => "#{@auth}" } end
Public Instance Methods
login(username, password)
click to toggle source
# File lib/mpayer/base.rb, line 16 def login(username, password) login_url = "#{@@base_uri}/login" json_msg = { user: username, password: password } HTTParty.post(login_url.to_str, body: json_msg.to_json, headers: @header) end