effective_orders 6.19.3 → 6.19.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73f7c7e5f31c361565954b31a82a278a0c5127829cbd24be06b4c307205c5f74
4
- data.tar.gz: d7821ca6b2a5e7a9b22c9e5d67c69a6a22f49a6c7211b88961b6cb42a8f7698a
3
+ metadata.gz: 746dd5ee2144955c3aab3c11981e71972860cf759f149ce5f65d1a34cf151998
4
+ data.tar.gz: 97f67c034986af44dd68d626dec51dc30f85c03c21a002d8504051e60993ee33
5
5
  SHA512:
6
- metadata.gz: '0967f05a59940c88a2b1ea47a8125c3501a9e1a0e1497fd5280fe4542f74b7bea94253fb72fd192adf32f6df958cfbc5179231d5c3d1351f0bf41bbc7ce49b1d'
7
- data.tar.gz: 950b3b66593162a86e80a69dcea163415a0a7f1d1c0496dd3deeb886d8d1be7d9fb575fd3db334f8ab3e73662a8e9d3c3c2d8ec2d1fafd35fd49946a9dbf88ba
6
+ metadata.gz: 014db5a1ca6536d3a3e6dfdd050b30fdca4477ba3f320e7a0a05162f81a2b2bcb9019e60ae951f700c67bf193a7d8ee9a0eacf1cb9209ea306a8be7dc349e253
7
+ data.tar.gz: a4e6f6cdf0af9ff2df925bcecc1601b6b0d41c88d8ddd03de7c75e6cbd732243498dc472859003be022e9f9f412efec841ee8dda6e50d682fca69ae7e80fe3cd
@@ -100,7 +100,7 @@ module Effective
100
100
 
101
101
  # Create Payment
102
102
  def create_payment(order, payment_intent)
103
- response = post('/payments', params: create_payment_params(order, payment_intent))
103
+ response = post_once('/payments', params: create_payment_params(order, payment_intent))
104
104
 
105
105
  # Sanity check response
106
106
  raise('expected responseCode') unless response.kind_of?(Hash) && response['responseCode'].present?
@@ -386,6 +386,25 @@ module Effective
386
386
  http.read_timeout = (read_timeout || 30)
387
387
  http.use_ssl = true
388
388
 
389
+ result = with_retries do
390
+ puts "[POST] #{uri} #{params}" if Rails.env.development?
391
+
392
+ response = http.post(uri.path, params.to_json, headers)
393
+ raise Exception.new("#{response.code} #{response.body}") unless response.code == '200'
394
+
395
+ response
396
+ end
397
+
398
+ JSON.parse(result.body)
399
+ end
400
+
401
+ def post_once(endpoint, params:)
402
+ uri = URI.parse(api_url + endpoint)
403
+
404
+ http = Net::HTTP.new(uri.host, uri.port)
405
+ http.read_timeout = (read_timeout || 30)
406
+ http.use_ssl = true
407
+
389
408
  puts "[POST] #{uri} #{params}" if Rails.env.development?
390
409
 
391
410
  response = http.post(uri.path, params.to_json, headers)
@@ -13,7 +13,8 @@
13
13
 
14
14
  .col= pf.price_field :price
15
15
 
16
- .col
17
- .mt-4= qb_item_name_field(pf)
16
+ - if EffectiveOrders.use_item_names?
17
+ .col
18
+ .mt-4= qb_item_name_field(pf)
18
19
 
19
20
  .col= pf.check_box :tax_exempt, label: "Tax Exempt", title: 'When checked, tax will not be applied to this item'
@@ -1,3 +1,6 @@
1
1
  = form.price_field :price
2
- = qb_item_name_field(form)
2
+
3
+ - if EffectiveOrders.use_item_names?
4
+ = qb_item_name_field(form)
5
+
3
6
  = form.check_box :tax_exempt, label: "Yes, this #{etd(form.object)} is tax exempt"
@@ -23,6 +23,9 @@ EffectiveOrders.setup do |config|
23
23
  config.use_effective_qb_sync = false
24
24
  config.use_effective_qb_online = false
25
25
 
26
+ # Display the item name field on the orders#new screen
27
+ config.use_item_names = true
28
+
26
29
  # If set, the orders#new screen will render effective/orders/_order_note_fields to capture any Note info
27
30
  config.collect_note = false
28
31
  config.collect_note_required = false
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.19.3'.freeze
2
+ VERSION = '6.19.5'.freeze
3
3
  end
@@ -19,7 +19,7 @@ module EffectiveOrders
19
19
  :customers_table_name, :subscriptions_table_name, :products_table_name, :item_names_table_name,
20
20
  :layout,
21
21
  :orders_collection_scope, :order_tax_rate_method,
22
- :obfuscate_order_ids, :use_effective_qb_sync, :use_effective_qb_online,
22
+ :obfuscate_order_ids, :use_effective_qb_sync, :use_effective_qb_online, :use_item_names,
23
23
  :billing_address, :shipping_address,
24
24
  :collect_note, :collect_note_required, :collect_note_message,
25
25
  :terms_and_conditions, :terms_and_conditions_label, :minimum_charge,
@@ -212,6 +212,10 @@ module EffectiveOrders
212
212
  use_effective_qb_online && defined?(EffectiveQbOnline)
213
213
  end
214
214
 
215
+ def self.use_item_names?
216
+ use_item_names != false
217
+ end
218
+
215
219
  def self.quickbooks?
216
220
  use_effective_qb_sync || use_effective_qb_online
217
221
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.19.3
4
+ version: 6.19.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-04 00:00:00.000000000 Z
11
+ date: 2025-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails