workarea-sezzle 1.0.4 → 1.0.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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1f64801c67844cdc36f81d900b207460bd0a5fc3a07583ce69d62d5460a3aafa
         | 
| 4 | 
            +
              data.tar.gz: 93e04f04ad21cbe38e222d3197120fcdcf60dc5fff94e5f575c179955c143246
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9ad298f476db067ae3ae3250c30ea43bb97a9642f5535788b0dd749986eb88b582f3fdbefa7211809114967ea9a37104a2eaea082ea4103e0ae2b37997a7ed78
         | 
| 7 | 
            +
              data.tar.gz: d14a015cef5f988db405f20085b08be82136c7056311937ee2032909c1f18dd28b7f85ec58104023904f853171d446d2a4d657f7a7d7a3538fd28e35581fe538
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,25 +1,57 @@ | |
| 1 | 
            -
            Workarea Sezzle 1.0. | 
| 1 | 
            +
            Workarea Sezzle 1.0.5 (2021-05-13)
         | 
| 2 2 | 
             
            --------------------------------------------------------------------------------
         | 
| 3 3 |  | 
| 4 | 
            -
            *    | 
| 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 | 
            -
            *    | 
| 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. | 
| 30 | 
            +
            Workarea Sezzle 1.0.4 (2021-03-29)
         | 
| 17 31 | 
             
            --------------------------------------------------------------------------------
         | 
| 18 32 |  | 
| 19 | 
            -
            *    | 
| 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  | 
| 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 | 
            -
                     | 
| 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 | 
            -
                     | 
| 124 | 
            +
                    Routing.cancel_sezzle_url(
         | 
| 125 125 | 
             
                      host: Workarea.config.host,
         | 
| 126 126 | 
             
                      order_id: order.id
         | 
| 127 127 | 
             
                    )
         | 
| @@ -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 | 
            +
              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- | 
| 11 | 
            +
            date: 2021-05-13 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: workarea
         |