workarea-sezzle 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: be87020a46f155631d5dea416c434b671a902daa3c3160788cfb53d33332adf3
4
- data.tar.gz: 31120de1aaea7033e0ffd48a522e753bc756e08cad483e7ad9551b6384d82571
3
+ metadata.gz: 1f64801c67844cdc36f81d900b207460bd0a5fc3a07583ce69d62d5460a3aafa
4
+ data.tar.gz: 93e04f04ad21cbe38e222d3197120fcdcf60dc5fff94e5f575c179955c143246
5
5
  SHA512:
6
- metadata.gz: 6afd0ccedf88ea81ac3f85f1ffe2b34e9bdfc7355444fee837ba0d3fc3b3d94f2aa57200903ccef0e9662e31804085f8d4ad6d77c5731fb241b6f3fc9d66c62f
7
- data.tar.gz: 514f6181d64f6d4b5bce6819da5879460b608fd29e228bb7db9640db656f80c326d3d7dfbd0039b736c58a0d72a4ab67c6ee61fdc777f5522a260111bc93a97e
6
+ metadata.gz: 9ad298f476db067ae3ae3250c30ea43bb97a9642f5535788b0dd749986eb88b582f3fdbefa7211809114967ea9a37104a2eaea082ea4103e0ae2b37997a7ed78
7
+ data.tar.gz: d14a015cef5f988db405f20085b08be82136c7056311937ee2032909c1f18dd28b7f85ec58104023904f853171d446d2a4d657f7a7d7a3538fd28e35581fe538
data/CHANGELOG.md CHANGED
@@ -1,25 +1,57 @@
1
- Workarea Sezzle 1.0.3 (2021-01-08)
1
+ Workarea Sezzle 1.0.5 (2021-05-13)
2
2
  --------------------------------------------------------------------------------
3
3
 
4
- * Bump version to 1.0.3
4
+ * Ensure return URLs sent to sezzle include locale when not default
5
+
6
+
7
+ Matt Duffy
8
+
9
+ * Prep new release
5
10
 
6
11
 
7
12
  Jeff Yucis
8
13
 
9
- * SEZZ-4 Change from ID to class select. For package product considerations.
14
+ * Verify that that the authorization was successful when completing a sezzle purchase.
15
+
10
16
 
17
+ Jeff Yucis
18
+
19
+ * SEZZ-5 Add multi-language support
20
+
21
+ Only supports EN and FR, per Sezzle docs.
22
+ Add new helper for getting Rails locale.
23
+ Remove translation templates as they were the defaults anyway.
24
+ Add language to script.
11
25
 
12
26
  James Dobson
13
27
 
14
28
 
15
29
 
16
- Workarea Sezzle 1.0.2 (2021-01-06)
30
+ Workarea Sezzle 1.0.4 (2021-03-29)
17
31
  --------------------------------------------------------------------------------
18
32
 
19
- * Bump verision to v1.0.2
20
-
33
+ * Verify that that the authorization was successful when completing a sezzle purchase.
21
34
 
22
35
  Jeff Yucis
23
36
 
37
+ * SEZZ-5 Add multi-language support
38
+
39
+ Only supports EN and FR, per Sezzle docs.
40
+ Add new helper for getting Rails locale.
41
+ Remove translation templates as they were the defaults anyway.
42
+ Add language to script.
43
+
44
+ James Dobson
45
+
46
+
47
+
48
+ Workarea Sezzle 1.0.3 (2021-01-08)
49
+ --------------------------------------------------------------------------------
50
+
51
+ * SEZZ-4 Change from ID to class select. For package product considerations.
52
+
53
+
54
+ James Dobson
55
+
24
56
 
25
57
 
@@ -1,7 +1,7 @@
1
1
  module Workarea
2
2
  module Sezzle
3
3
  class OrderBuilder
4
- module ProductUrl
4
+ module Routing
5
5
  include Workarea::I18n::DefaultUrlOptions
6
6
  include Storefront::Engine.routes.url_helpers
7
7
  extend self
@@ -114,14 +114,14 @@ module Workarea
114
114
  end
115
115
 
116
116
  def complete_url
117
- Storefront::Engine.routes.url_helpers.complete_sezzle_url(
117
+ Routing.complete_sezzle_url(
118
118
  host: Workarea.config.host,
119
119
  order_id: order.id
120
120
  )
121
121
  end
122
122
 
123
123
  def cancel_url
124
- Storefront::Engine.routes.url_helpers.cancel_sezzle_url(
124
+ Routing.cancel_sezzle_url(
125
125
  host: Workarea.config.host,
126
126
  order_id: order.id
127
127
  )
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module Sezzle
3
- VERSION = '1.0.4'.freeze
3
+ VERSION = '1.0.5'.freeze
4
4
  end
5
5
  end
@@ -3,6 +3,22 @@ require 'test_helper'
3
3
  module Workarea
4
4
  module Sezzle
5
5
  class OrderBuilderTest < Workarea::TestCase
6
+ setup :set_i18n
7
+ teardown :reset_i18n
8
+
9
+ def set_i18n
10
+ @_default_locale = ::I18n.config.default_locale
11
+ @_locale = ::I18n.locale
12
+
13
+ ::I18n.config.default_locale = :en
14
+ ::I18n.locale = :en
15
+ end
16
+
17
+ def reset_i18n
18
+ ::I18n.config.default_locale = @_default_locale
19
+ ::I18n.locale = @_locale
20
+ end
21
+
6
22
  def test_build
7
23
  create_order_total_discount
8
24
  order = create_order
@@ -16,8 +32,23 @@ module Workarea
16
32
 
17
33
  order.reload
18
34
  payment.reload
35
+
36
+ ::I18n.locale = :fr
19
37
  order_hash = Workarea::Sezzle::OrderBuilder.new(order).build
20
38
 
39
+ assert_includes(order_hash[:cancel_url][:href], 'locale=fr')
40
+ assert_includes(order_hash[:complete_url][:href], 'locale=fr')
41
+
42
+ assert_nothing_raised { order_hash.to_json }
43
+
44
+ ::I18n.locale = :en
45
+ order_hash = Workarea::Sezzle::OrderBuilder.new(order).build
46
+
47
+ assert_nothing_raised { order_hash.to_json }
48
+
49
+ refute_includes(order_hash[:cancel_url][:href], 'locale=')
50
+ refute_includes(order_hash[:complete_url][:href], 'locale=')
51
+
21
52
  customer = order_hash[:customer]
22
53
  assert_equal(order.email, customer[:email])
23
54
  assert_equal('Bob', customer[:first_name])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-sezzle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Yucis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
11
+ date: 2021-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea