Class: Booker::BusinessClient

Inherits:
Client
  • Object
show all
Includes:
BusinessREST
Defined in:
lib/booker/business_client.rb

Constant Summary collapse

ACCESS_TOKEN_HTTP_METHOD =
:post
ACCESS_TOKEN_ENDPOINT =
'/accountlogin'.freeze

Constants included from CommonREST

CommonREST::DEFAULT_PAGINATION_PARAMS

Constants inherited from Client

Client::TimeZone

Instance Attribute Summary collapse

Attributes inherited from Client

#base_url, #client_id, #client_secret, #temp_access_token, #temp_access_token_expires_at, #token_store, #token_store_callback_method

Instance Method Summary collapse

Methods included from BusinessREST

#add_cash_payment, #cancel_appointment, #create_special, #find_appointments, #find_customers, #find_employees, #find_locations, #find_treatments, #get_appointment, #get_location_day_schedules, #get_location_feature_settings, #get_location_notification_settings, #get_location_payment_settings, #get_logged_in_user, #place_order, #remove_payment, #take_deposit, #update_location_notification_settings

Methods included from CommonREST

#confirm_appointment, #get_location, #get_online_booking_settings

Methods inherited from Client

#access_token, #access_token_response, #full_url, #get, #get_access_token, #get_base_url, #get_booker_resources, #handle_errors!, #initialize, #paginated_request, #post, #put, #raise_invalid_api_credentials_for_empty_resp!, #update_token_store

Constructor Details

This class inherits a constructor from Booker::Client

Instance Attribute Details

#booker_account_nameObject

Returns the value of attribute booker_account_name.



8
9
10
# File 'lib/booker/business_client.rb', line 8

def 
  @booker_account_name
end

#booker_passwordObject

Returns the value of attribute booker_password.



8
9
10
# File 'lib/booker/business_client.rb', line 8

def booker_password
  @booker_password
end

#booker_usernameObject

Returns the value of attribute booker_username.



8
9
10
# File 'lib/booker/business_client.rb', line 8

def booker_username
  @booker_username
end

Instance Method Details

#access_token_optionsObject



14
15
16
17
18
19
20
# File 'lib/booker/business_client.rb', line 14

def access_token_options
  super.merge!(
      'AccountName' => self.,
      'UserName' => self.booker_username,
      'Password' => self.booker_password
  )
end

#default_base_urlObject



12
# File 'lib/booker/business_client.rb', line 12

def default_base_url; 'https://apicurrent-app.booker.ninja/webservice4/json/BusinessService.svc'; end

#env_base_url_keyObject



10
# File 'lib/booker/business_client.rb', line 10

def env_base_url_key; 'BOOKER_BUSINESS_SERVICE_URL'; end