flex_commerce_api 0.6.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/.env.example +6 -0
  3. data/.gitignore +14 -0
  4. data/.rspec +4 -0
  5. data/.rubocop.yml +1065 -0
  6. data/.ruby-gemset +1 -0
  7. data/.ruby-version +1 -0
  8. data/.travis.yml +3 -0
  9. data/Gemfile +4 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +56 -0
  12. data/Rakefile +1 -0
  13. data/app/models/address.rb +41 -0
  14. data/app/models/asset_file.rb +26 -0
  15. data/app/models/asset_folder.rb +14 -0
  16. data/app/models/bundle.rb +20 -0
  17. data/app/models/bundle_group.rb +15 -0
  18. data/app/models/cart.rb +136 -0
  19. data/app/models/category.rb +70 -0
  20. data/app/models/category_tree.rb +11 -0
  21. data/app/models/component.rb +8 -0
  22. data/app/models/container_coupon.rb +12 -0
  23. data/app/models/country.rb +11 -0
  24. data/app/models/coupon.rb +18 -0
  25. data/app/models/customer_account.rb +96 -0
  26. data/app/models/customer_account_authentication.rb +5 -0
  27. data/app/models/customer_segment.rb +6 -0
  28. data/app/models/customer_segment_member.rb +6 -0
  29. data/app/models/data_attribute.rb +6 -0
  30. data/app/models/data_store_record.rb +9 -0
  31. data/app/models/data_store_type.rb +9 -0
  32. data/app/models/discount_summary.rb +12 -0
  33. data/app/models/email.rb +5 -0
  34. data/app/models/ewis_opt_in.rb +8 -0
  35. data/app/models/external_url.rb +6 -0
  36. data/app/models/free_shipping_promotion.rb +12 -0
  37. data/app/models/import.rb +6 -0
  38. data/app/models/import_entry.rb +6 -0
  39. data/app/models/line_item.rb +34 -0
  40. data/app/models/line_item_discount.rb +7 -0
  41. data/app/models/markdown_price.rb +11 -0
  42. data/app/models/menu.rb +36 -0
  43. data/app/models/menu_item.rb +7 -0
  44. data/app/models/menu_item_item.rb +5 -0
  45. data/app/models/note.rb +18 -0
  46. data/app/models/order.rb +38 -0
  47. data/app/models/password_recovery.rb +20 -0
  48. data/app/models/payment_address_verification.rb +13 -0
  49. data/app/models/payment_process.rb +13 -0
  50. data/app/models/payment_provider.rb +15 -0
  51. data/app/models/payment_transaction.rb +13 -0
  52. data/app/models/product.rb +99 -0
  53. data/app/models/product_asset_file.rb +12 -0
  54. data/app/models/promotion.rb +19 -0
  55. data/app/models/promotion_qualifying_product_exclusion.rb +8 -0
  56. data/app/models/redirect.rb +14 -0
  57. data/app/models/refund.rb +14 -0
  58. data/app/models/remote_address.rb +22 -0
  59. data/app/models/remote_line_item.rb +11 -0
  60. data/app/models/remote_order.rb +15 -0
  61. data/app/models/remote_shipping_method.rb +12 -0
  62. data/app/models/report.rb +18 -0
  63. data/app/models/report_invocation.rb +18 -0
  64. data/app/models/retail_store.rb +18 -0
  65. data/app/models/role.rb +6 -0
  66. data/app/models/search_suggestion.rb +17 -0
  67. data/app/models/section.rb +9 -0
  68. data/app/models/session.rb +8 -0
  69. data/app/models/shipping_method.rb +26 -0
  70. data/app/models/slug.rb +19 -0
  71. data/app/models/static_page.rb +60 -0
  72. data/app/models/static_page_folder.rb +8 -0
  73. data/app/models/stock_level.rb +21 -0
  74. data/app/models/tax_code.rb +6 -0
  75. data/app/models/taxonomy.rb +5 -0
  76. data/app/models/template.rb +9 -0
  77. data/app/models/template_component.rb +11 -0
  78. data/app/models/template_definition.rb +12 -0
  79. data/app/models/template_section.rb +12 -0
  80. data/app/models/user.rb +8 -0
  81. data/app/models/user_profile.rb +6 -0
  82. data/app/models/v2/create_order.rb +10 -0
  83. data/app/models/v2/deallocate_order.rb +10 -0
  84. data/app/models/v2/line_item.rb +9 -0
  85. data/app/models/v2/order.rb +9 -0
  86. data/app/models/v2/unallocate_order.rb +10 -0
  87. data/app/models/variant.rb +18 -0
  88. data/app/models/webhook.rb +17 -0
  89. data/app/services/param_to_shql.rb +72 -0
  90. data/app/services/surrogate_keys.rb +44 -0
  91. data/bin/console +14 -0
  92. data/bin/setup +7 -0
  93. data/config/locales/payments.en.yml +3 -0
  94. data/flex-commerce-api.gemspec +41 -0
  95. data/lib/flex_commerce.rb +95 -0
  96. data/lib/flex_commerce_api.rb +21 -0
  97. data/lib/flex_commerce_api/api_base.rb +11 -0
  98. data/lib/flex_commerce_api/base_resource.rb +250 -0
  99. data/lib/flex_commerce_api/config.rb +55 -0
  100. data/lib/flex_commerce_api/error/access_denied.rb +6 -0
  101. data/lib/flex_commerce_api/error/bad_request.rb +10 -0
  102. data/lib/flex_commerce_api/error/base.rb +12 -0
  103. data/lib/flex_commerce_api/error/client_error.rb +7 -0
  104. data/lib/flex_commerce_api/error/connection_error.rb +6 -0
  105. data/lib/flex_commerce_api/error/internal_server.rb +37 -0
  106. data/lib/flex_commerce_api/error/not_found.rb +13 -0
  107. data/lib/flex_commerce_api/error/record_invalid.rb +16 -0
  108. data/lib/flex_commerce_api/error/unexpected_status.rb +7 -0
  109. data/lib/flex_commerce_api/errors.rb +13 -0
  110. data/lib/flex_commerce_api/json_api_client_extension/builder.rb +28 -0
  111. data/lib/flex_commerce_api/json_api_client_extension/capture_surrogate_keys_middleware.rb +16 -0
  112. data/lib/flex_commerce_api/json_api_client_extension/flexible_connection.rb +59 -0
  113. data/lib/flex_commerce_api/json_api_client_extension/has_many_association_proxy.rb +60 -0
  114. data/lib/flex_commerce_api/json_api_client_extension/included_data.rb +27 -0
  115. data/lib/flex_commerce_api/json_api_client_extension/json_format_middleware.rb +20 -0
  116. data/lib/flex_commerce_api/json_api_client_extension/logging_middleware.rb +24 -0
  117. data/lib/flex_commerce_api/json_api_client_extension/paginator.rb +26 -0
  118. data/lib/flex_commerce_api/json_api_client_extension/parse_json.rb +23 -0
  119. data/lib/flex_commerce_api/json_api_client_extension/parsers/parser.rb +16 -0
  120. data/lib/flex_commerce_api/json_api_client_extension/previewed_request_middleware.rb +17 -0
  121. data/lib/flex_commerce_api/json_api_client_extension/remote_builder.rb +29 -0
  122. data/lib/flex_commerce_api/json_api_client_extension/requestor.rb +42 -0
  123. data/lib/flex_commerce_api/json_api_client_extension/save_request_body_middleware.rb +20 -0
  124. data/lib/flex_commerce_api/json_api_client_extension/status_middleware.rb +40 -0
  125. data/lib/flex_commerce_api/v2/api_base.rb +13 -0
  126. data/lib/flex_commerce_api/version.rb +3 -0
  127. data/lib/json_erb.rb +9 -0
  128. data/lib/json_struct.rb +73 -0
  129. data/lib/patches.rb +4 -0
  130. data/lib/patches/json_api_client/resource.rb +50 -0
  131. data/lib/paypal_express.rb +3 -0
  132. data/lib/paypal_express/additional_info.rb +45 -0
  133. data/lib/paypal_express/api.rb +86 -0
  134. data/lib/paypal_express/auth.rb +83 -0
  135. data/lib/paypal_express/cart_shipping_method.rb +38 -0
  136. data/lib/paypal_express/exception/access_denied.rb +10 -0
  137. data/lib/paypal_express/exception/connection_error.rb +10 -0
  138. data/lib/paypal_express/exception/not_authorized.rb +10 -0
  139. data/lib/paypal_express/exception/transaction.rb +15 -0
  140. data/lib/paypal_express/generate_summary.rb +118 -0
  141. data/lib/paypal_express/process/paypal_params.rb +123 -0
  142. data/lib/paypal_express/process/response_parser.rb +146 -0
  143. data/lib/paypal_express/setup.rb +94 -0
  144. data/lib/paypal_express/shipping_methods_for_cart.rb +46 -0
  145. data/lib/retry.rb +20 -0
  146. data/schemas/jsonapi/schema.json +370 -0
  147. data/schemas/shift/v1/documents/collection/address.json +45 -0
  148. data/schemas/shift/v1/documents/collection/asset_file.json +43 -0
  149. data/schemas/shift/v1/documents/collection/asset_folder.json +43 -0
  150. data/schemas/shift/v1/documents/collection/customer_account.json +50 -0
  151. data/schemas/shift/v1/documents/collection/markdown_price.json +43 -0
  152. data/schemas/shift/v1/documents/collection/product.json +43 -0
  153. data/schemas/shift/v1/documents/collection/variant.json +43 -0
  154. data/schemas/shift/v1/documents/member/address.json +39 -0
  155. data/schemas/shift/v1/documents/member/asset_file.json +37 -0
  156. data/schemas/shift/v1/documents/member/asset_folder.json +39 -0
  157. data/schemas/shift/v1/documents/member/customer_account.json +44 -0
  158. data/schemas/shift/v1/documents/member/markdown_price.json +37 -0
  159. data/schemas/shift/v1/documents/member/product.json +39 -0
  160. data/schemas/shift/v1/documents/member/variant.json +46 -0
  161. data/schemas/shift/v1/resources/address.json +130 -0
  162. data/schemas/shift/v1/resources/asset_file.json +146 -0
  163. data/schemas/shift/v1/resources/asset_folder.json +188 -0
  164. data/schemas/shift/v1/resources/customer_account.json +339 -0
  165. data/schemas/shift/v1/resources/markdown_price.json +52 -0
  166. data/schemas/shift/v1/resources/product.json +230 -0
  167. data/schemas/shift/v1/resources/variant.json +298 -0
  168. data/tasks/json_schema.thor +275 -0
  169. data/todo.md +8 -0
  170. metadata +470 -0
@@ -0,0 +1,60 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Static Page model
5
+ #
6
+ # This model provides access to the flex commerce static pages.
7
+ # As managing the static pages is the job of the administration panel, this
8
+ # model is read only.
9
+ #
10
+ # It is used much like an active record model.
11
+ #
12
+ # Examples:
13
+ #
14
+ #
15
+ #
16
+ # # Fetching all static pages
17
+ #
18
+ # FlexCommerce::StaticPage.all #fetches all static pages (actually the first page in case there are thousands)
19
+ #
20
+ # # Pagination
21
+ #
22
+ # FlexCommerce::StaticPage.paginate(page:2).all # Fetches page 2 of static pages.
23
+ # The page size is predefined on the server side
24
+ #
25
+ # # Finding static pages
26
+ #
27
+ # FlexCommerce::StaticPage.find(25) # Finds the static page with this unique id
28
+ #
29
+ #
30
+ class StaticPage < FlexCommerceApi::ApiBase
31
+ # @method find
32
+ # @param [String] spec
33
+ # Finds a static page
34
+ # @return [FlexCommerce::Product] The static page
35
+ # @raise [FlexCommerceApi::Error::NotFound] If not found
36
+
37
+ # @method all
38
+ # Returns all static pages
39
+ # @return [FlexCommerce::StaticPage[]] An array of static pages or an empty array
40
+
41
+ # @method paginate
42
+ # Paginates the list of static pages by a preset page size
43
+ # @param [Hash] options The options to paginate with
44
+ # @param options [Numeric|String] :page The page to fetch
45
+
46
+ has_many :slugs, class_name: "::FlexCommerce::Slug"
47
+ has_one :template_definition, class_name: "::FlexCommerce::TemplateDefinition"
48
+ has_one :template, class_name: "::FlexCommerce::Template"
49
+
50
+ # @TODO Document other popular methods that we will support
51
+ self.query_builder = ::FlexCommerceApi::JsonApiClientExtension::Builder
52
+
53
+ class << self
54
+ def_delegators :_new_scope, :temp_search
55
+ def path(params, *args)
56
+ super
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,8 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ class StaticPageFolder < FlexCommerceApi::ApiBase
4
+
5
+ has_many :static_pages, class_name: "::FlexCommerce::StaticPage"
6
+
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Stock Level model
5
+ #
6
+ # This model provides access to the flex commerce stock level
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ #
13
+ #
14
+ # # Fetching stock levels for specific skus
15
+ # FlexCommerce::StockLevel.where(skus: "sku1,sku2,sku3").all
16
+ #
17
+ #
18
+ #
19
+ class StockLevel < FlexCommerceApi::ApiBase
20
+ end
21
+ end
@@ -0,0 +1,6 @@
1
+ require "flex_commerce_api/api_base"
2
+
3
+ module FlexCommerce
4
+ class TaxCode < FlexCommerceApi::ApiBase
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ class Taxonomy < FlexCommerceApi::ApiBase
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce template
5
+ #
6
+ class Template < FlexCommerceApi::ApiBase
7
+ has_many :sections, class_name: "::FlexCommerce::Section"
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce template component model
5
+ #
6
+ # This model provides access to the flex commerce template component
7
+ #
8
+ #
9
+ class TemplateComponent < FlexCommerceApi::ApiBase
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce template definition model
5
+ #
6
+ # This model provides access to the flex commerce template definition
7
+ #
8
+ #
9
+ class TemplateDefinition < FlexCommerceApi::ApiBase
10
+ has_many :template_sections, class_name: "::FlexCommerce::TemplateSection"
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce template section model
5
+ #
6
+ # This model provides access to the flex commerce template section
7
+ #
8
+ class TemplateSection < FlexCommerceApi::ApiBase
9
+ belongs_to :template_definition, class_name: "::FlexCommerce::TemplateDefinition"
10
+ has_many :template_components, class_name: "::FlexCommerce::TemplateComponent"
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ require "flex_commerce_api/api_base"
2
+
3
+ module FlexCommerce
4
+ class User < FlexCommerceApi::ApiBase
5
+ has_one :role, class_name: "FlexCommerce::Role"
6
+ has_one :user_profile, class_name: "FlexCommerce::UserProfile"
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ require "flex_commerce_api/api_base"
2
+
3
+ module FlexCommerce
4
+ class UserProfile < FlexCommerceApi::ApiBase
5
+ end
6
+ end
@@ -0,0 +1,10 @@
1
+ require "flex_commerce_api/v2/api_base"
2
+ module FlexCommerce
3
+ module V2
4
+ class CreateOrder < FlexCommerceApi::V2::ApiBase
5
+ def self.table_name
6
+ "create_order"
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ require "flex_commerce_api/v2/api_base"
2
+ module FlexCommerce
3
+ module V2
4
+ class DeallocateOrder < FlexCommerceApi::V2::ApiBase
5
+ def self.table_name
6
+ "deallocate_order"
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ require "flex_commerce_api/v2/api_base"
2
+
3
+ module FlexCommerce
4
+ module V2
5
+ class LineItem < FlexCommerceApi::V2::ApiBase
6
+ belongs_to :order, class_name: "::FlexCommerce::V2::Order"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require "flex_commerce_api/v2/api_base"
2
+
3
+ module FlexCommerce
4
+ module V2
5
+ class Order < FlexCommerceApi::V2::ApiBase
6
+ has_many :line_items, class_name: "::FlexCommerce::V2::LineItem"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ require "flex_commerce_api/v2/api_base"
2
+ module FlexCommerce
3
+ module V2
4
+ class UnallocateOrder < FlexCommerceApi::V2::ApiBase
5
+ def self.table_name
6
+ "unallocate_order"
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,18 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce variant model
5
+ #
6
+ # This model is used by the Product model as an association so is not
7
+ # usable directly on the API as there is no corresponding URL
8
+ #
9
+ #
10
+ class Variant < FlexCommerceApi::ApiBase
11
+ has_one :product
12
+ has_many :asset_files
13
+ has_many :markdown_prices
14
+ def add_markdown_prices(markdown_prices)
15
+ self.class.requestor.custom("relationships/markdown_prices", {request_method: :post}, {id: id, data: markdown_prices.map(&:as_relation)})
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ require "flex_commerce_api/api_base"
2
+ module FlexCommerce
3
+ #
4
+ # A flex commerce Webhooks model
5
+ #
6
+ # This model provides access to the Shift Webhooks feature.
7
+ #
8
+ # It is used much like an active record model.
9
+ #
10
+ # Examples:
11
+ #
12
+ # # Fetch all webhooks, paginated
13
+ # FlexCommerce::Webhook.all
14
+ #
15
+ class Webhook < FlexCommerceApi::ApiBase
16
+ end
17
+ end
@@ -0,0 +1,72 @@
1
+ #
2
+ # ParamToShql
3
+ #
4
+ # Service for converting UI-based filters (using common UI idioms such as
5
+ # checkboxes) into SHQL, the SHiftQueryLanguage understandable by the API.
6
+ #
7
+ # e.g.
8
+ # {"meta.colour"=>{"blue"=>"on", "red"=>"on"},"price"=>{"gt"=>"", "lt"=>""}}
9
+ # would become
10
+ # "or" => [{"meta.colour"=>{"eq"=>"blue"}},{"meta.colour"=>{"eq"=>"red"}}...]
11
+ #
12
+ # TODO: More documentation
13
+ #
14
+ module FlexCommerce
15
+ class ParamToShql
16
+
17
+ #
18
+ # initialize
19
+ #
20
+ def initialize(filter_param)
21
+ @filter_param = filter_param
22
+ end
23
+
24
+
25
+ #
26
+ # call
27
+ #
28
+ def call
29
+ return {} unless @filter_param
30
+
31
+ facet_filters = []
32
+ @filter_param.each do |label,facet|
33
+ facet_filter = []
34
+ if (facet.keys & ['lt', 'lte', 'gt', 'gte']).any?
35
+ range_filter = range_param_to_shql(label, facet)
36
+ facet_filter << range_filter if !(range_filter == "" || range_filter == nil)
37
+ else
38
+ facet.keys.each do |value|
39
+ facet_filter << { label => { "eq" => value } }
40
+ end
41
+ end
42
+ facet_filters << { "or" => facet_filter }
43
+ end
44
+ facet_filters.count == 1 ? facet_filters.first : { "and" => facet_filters }
45
+ end
46
+
47
+ private
48
+
49
+
50
+ #
51
+ # range_param_to_shql
52
+ #
53
+ # e.g. "variants.price"=>{"gt"=>10, "lt"=>20}
54
+ #
55
+ # name: e.g. variants.price
56
+ # attrs: e.g. { "gt" => 10 }
57
+ #
58
+ def range_param_to_shql(name, attrs)
59
+ range_filter = { "and" => [] }
60
+
61
+ attrs.each do |op,value|
62
+ next if (value == "" || value == nil)
63
+ range_filter["and"] << { name => { op => value } }
64
+ end
65
+ if range_filter["and"].any?
66
+ range_filter
67
+ else
68
+ nil
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,44 @@
1
+ # Class: SurrogateKeys
2
+ # This class implements the getter and setter methods for surrogate keys
3
+ # This is used in 'CartManagement' in rails-site
4
+ #
5
+ module FlexCommerce
6
+ class SurrogateKeys
7
+
8
+ # Returns the filtered external surrogate keys from api response,
9
+ # if no filter value is set, it will return all keys
10
+ #
11
+ # ===== Examples
12
+ # Thread.current[:shift_surrogate_keys] = ["matalanb%2Fcarts", "matalanb%2Fshipping_methods", "matalanb%2Fpromotion_shipping_methods"]
13
+ #
14
+ # FlexCommerce::SurrogateKeys.keys(filter: 'cart')
15
+ # # => ["matalanb%2Fcarts"]
16
+ # FlexCommerce::SurrogateKeys.keys
17
+ # # => ["matalanb%2Fcarts", "matalanb%2Fshipping_methods", "matalanb%2Fpromotion_shipping_methods"]
18
+
19
+ def self.keys(filter: nil)
20
+ surrogate_keys = Thread.current[:shift_surrogate_keys]
21
+ # Return all the surrogate keys, if not requested for a particular key
22
+ return surrogate_keys if filter.nil?
23
+ # Select only the surrogate keys, which includes the requested key
24
+ surrogate_keys.nil? ? [] : surrogate_keys.select { |k| k.include?(filter) }
25
+ end
26
+
27
+ # Appends the keys to the Thread shift_surrogate_keys variable.
28
+ #
29
+ # ==== Examples
30
+ # Thread.current[:shift_surrogate_keys] = ["matalanb%2Fcarts", "matalanb%2Fcart%2F31719184"]
31
+ # keys = ["matalanb%2Fcarts", "matalanb%2Fcart%2F31719184"]
32
+ #
33
+ # FlexCommerce::SurrogateKeys.append_keys(keys)
34
+ # # => ["matalanb%2Fcarts", "matalanb%2Fcart%2F31719184", "matalanb%2Fcarts", "matalanb%2Fcart%2F31719184"]
35
+ #
36
+ def self.append_keys(*keys)
37
+ # Check if surrogate key is available, if not initiate it
38
+ Thread.current[:shift_surrogate_keys] ||= []
39
+ Thread.current[:shift_surrogate_keys] += keys.flatten
40
+ Thread.current[:shift_surrogate_keys] = Thread.current[:shift_surrogate_keys].uniq
41
+ end
42
+
43
+ end
44
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "flex_commerce_api"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ en:
2
+ payment_setup:
3
+ shipping_method_not_available: "Shipping method not available"
@@ -0,0 +1,41 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "flex_commerce_api/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "flex_commerce_api"
8
+ spec.version = FlexCommerceApi::VERSION
9
+ spec.authors = ["Gary Taylor"]
10
+ spec.email = ["gary.taylor@flexcommerce.com"]
11
+
12
+ spec.summary = "Access the flex-commerce API"
13
+ spec.description = "Allows any ruby application to access the flex-commerce API"
14
+ spec.homepage = "https://github.com/shiftcommerce/flex-ruby-gem"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.9"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", "~> 3.3"
25
+ spec.add_development_dependency "webmock", "~> 1.21"
26
+ spec.add_development_dependency "factory_bot", "~> 4.8"
27
+ spec.add_development_dependency "faker", "~> 1.4"
28
+ spec.add_development_dependency "yard", "~> 0.8"
29
+ spec.add_development_dependency "json-schema", "~> 2.6"
30
+ spec.add_development_dependency "pry", "~> 0.10.0"
31
+ spec.add_development_dependency "dotenv"
32
+ spec.add_development_dependency "vcr"
33
+ spec.add_development_dependency "thor", "~> 0.19"
34
+ spec.add_development_dependency "json_matchers", ["~> 0.5", ">= 0.5.1"]
35
+
36
+ spec.add_dependency "oj", "~> 2.12"
37
+ spec.add_runtime_dependency "json_api_client", "1.1.1"
38
+ spec.add_runtime_dependency "activesupport", ">= 4.0"
39
+ spec.add_runtime_dependency "rack", ">= 1.6"
40
+ spec.add_runtime_dependency "faraday-http-cache", "1.3.0"
41
+ end