Class: Booker::CustomerClient

Inherits:
Client
  • Object
show all
Includes:
CustomerREST
Defined in:
lib/booker/customer_client.rb

Constant Summary

Constants included from CommonREST

Booker::CommonREST::DEFAULT_PAGINATION_PARAMS

Constants inherited from Client

Booker::Client::ACCESS_TOKEN_ENDPOINT, Booker::Client::ACCESS_TOKEN_HTTP_METHOD, Booker::Client::TimeZone

Instance Attribute Summary

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 CustomerREST

#calculate_appointment_cost, #cancel_appointment, #create_appointment, #create_class_appointment, #create_customer, #create_incomplete_appointment, #find_employees, #find_treatments, #forgot_password, #get_appointment, #get_customer, #get_customer_appointments, #get_locations, #get_special_by_code, #get_treatment_categories, #login, #reset_password, #run_class_availability, #run_multi_service_availability, #run_multi_spa_multi_sub_category_availability, #update_customer

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!, #paginated_request, #post, #put, #raise_invalid_api_credentials_for_empty_resp!, #update_token_store

Constructor Details

#initialize(options = {}) ⇒ CustomerClient

Returns a new instance of CustomerClient.



5
6
7
8
9
# File 'lib/booker/customer_client.rb', line 5

def initialize(options={})
  super
  self.token_store ||= GenericTokenStore
  self.token_store_callback_method ||= :update_booker_access_token!
end

Instance Method Details

#access_token_optionsObject



15
# File 'lib/booker/customer_client.rb', line 15

def access_token_options; super.merge!(grant_type: 'client_credentials'); end

#default_base_urlObject



13
# File 'lib/booker/customer_client.rb', line 13

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

#env_base_url_keyObject



11
# File 'lib/booker/customer_client.rb', line 11

def env_base_url_key; 'BOOKER_CUSTOMER_SERVICE_URL'; end