Class: Commerce::Service

Inherits:
BaseController show all
Defined in:
lib/commerce/service.rb

Instance Attribute Summary

Attributes inherited from BaseController

#http_call_back, #http_client

Class Method Summary collapse

Methods inherited from BaseController

#initialize

Constructor Details

This class inherits a constructor from Commerce::BaseController

Class Method Details

.locale_list_countries(_query_parameters = []) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/commerce/service.rb', line 4

def self.locale_list_countries( _query_parameters = [])

  _query_builder = Commerce.api_base.dup
  _query_builder << '/services/locale/countries'



  _query_url = APIHelper.clean_url _query_builder


  _request = @@http_client.GET _query_url

  CustomHeaderAuth.apply(_request)

  _request.headers = @@global_headers.clone.merge(_request.headers)

  _response = @@http_client.execute_as_string(_request)

  context = HttpContext.new(_request, _response)

  return context.response.array

end

.locale_list_shipping_countries(checkout_token_id, _query_parameters = []) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/commerce/service.rb', line 28

def self.locale_list_shipping_countries(checkout_token_id,  _query_parameters = [])

  _query_builder = Commerce.api_base.dup
  _query_builder << '/services/locale/{checkout_token_id}/countries'

  _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {
          'checkout_token_id' => checkout_token_id
      }


  _query_url = APIHelper.clean_url _query_builder


  _request = @@http_client.GET _query_url

  CustomHeaderAuth.apply(_request)

  _request.headers = @@global_headers.clone.merge(_request.headers)

  _response = @@http_client.execute_as_string(_request)

  context = HttpContext.new(_request, _response)

  return context.response.array

end

.locale_list_shipping_subdivisions(checkout_token_id, country_code, _query_parameters = []) ⇒ Object



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/commerce/service.rb', line 55

def self.locale_list_shipping_subdivisions(checkout_token_id, country_code,  _query_parameters = [])

  _query_builder = Commerce.api_base.dup
  _query_builder << '/services/locale/{checkout_token_id}/countries/{country_code}/subdivisions'

  _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {
          'checkout_token_id' => checkout_token_id,
          'country_code' => country_code
      }


  _query_url = APIHelper.clean_url _query_builder


  _request = @@http_client.GET _query_url

  CustomHeaderAuth.apply(_request)

  _request.headers = @@global_headers.clone.merge(_request.headers)

  _response = @@http_client.execute_as_string(_request)

  context = HttpContext.new(_request, _response)

  return context.response.array

end

.locale_list_subdivisions(country_code, _query_parameters = []) ⇒ Object



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/commerce/service.rb', line 83

def self.locale_list_subdivisions(country_code,  _query_parameters = [])

  _query_builder = Commerce.api_base.dup
  _query_builder << '/services/locale/{country_code}/subdivisions'

  _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {
          'country_code' => country_code
      }


  _query_url = APIHelper.clean_url _query_builder


  _request = @@http_client.GET _query_url

  CustomHeaderAuth.apply(_request)

  _request.headers = @@global_headers.clone.merge(_request.headers)

  _response = @@http_client.execute_as_string(_request)

  context = HttpContext.new(_request, _response)

  return context.response.array

end