solidus-returnly 0.6.2 → 0.7.0

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
  SHA1:
3
- metadata.gz: cdcc6a311bd8b506654e3f98002a2e5d50c5149f
4
- data.tar.gz: 639068f9abf9fdb9aa33b34f7315bd898a217234
3
+ metadata.gz: a0d71aa3fc918ca44c18793faf76d987bf02f6f7
4
+ data.tar.gz: dee66d85096e0b8ff6e934d8b2d256e8848727c6
5
5
  SHA512:
6
- metadata.gz: eee6692d5dfdf2c0c23ea2dafa60c42b4788dae0f6828962f1fc41f1b239cda93da934f448c0ecc290f12aa397015a631e254432e4bb8b98768e4a44bdae8593
7
- data.tar.gz: 1cd8a79ad38584d16619574af858a3759a0c3f4516ff2c04b1e5dce8e7eaa7e476d17f86e5ae62d5fafc6c4b8d8e3a429af97b506f8e5c99103bc5724cf6dc7c
6
+ metadata.gz: deb9e37418ecf8dac19d58a3fb6e93cc4c6efeb8e49f2cec3ea988604d194a1c3204edd8564f7bf4da566ceb1ab562b797728e52d1d123362bf8a7bb19dc525c
7
+ data.tar.gz: 980a0001ced5190de64c12b3a42370e9c4064ce3b0ae00d78300255688d1f5813d1b18a1dca3d0590e924466220cd0d20e202da36efa1dd2a6c58ba947a2b44a
data/README.md CHANGED
@@ -194,6 +194,7 @@ Returnly.configure do |config|
194
194
  config.refunder = CustomRefunder
195
195
  config.refund_calculator = CustomRefunderCalculator
196
196
  config.reimbursement_type_no_items = CustomOriginalPaymentNoItems
197
+ config.refund_presenter = CustomRefundPresenter
197
198
  end
198
199
  ```
199
200
 
@@ -2,15 +2,19 @@ module RefundMethods
2
2
  extend ActiveSupport::Concern
3
3
  included do
4
4
  class_attribute :eligible_refund_methods
5
- self.eligible_refund_methods = whitelisted_refund_methods || defined_refund_methods
5
+ self.eligible_refund_methods = whitelisted_refund_methods.empty? ? defined_refund_methods : whitelisted_refund_methods
6
6
  end
7
7
 
8
8
  class_methods do
9
9
  def whitelisted_refund_methods
10
10
  # Solidus 2.3.0 deprecates "Spree::Gateway::Bogus" and recommends using "Spree::PaymentMethod::BogusCreditCard" instead.
11
11
  %w[Spree::Gateway::Bogus Spree::PaymentMethod::SimpleBogusCreditCard Spree::PaymentMethod::BogusCreditCard Spree::PaymentMethod::Check Spree::PaymentMethod::StoreCredit].inject([]) do |methods, payment_method|
12
- methods << payment_method.constantize if Object.const_defined?(payment_method)
13
- methods
12
+ begin
13
+ methods << payment_method.constantize
14
+ methods
15
+ rescue
16
+ methods
17
+ end
14
18
  end
15
19
  end
16
20
 
@@ -3,7 +3,8 @@ module Returnly
3
3
  mattr_accessor :return_item_amount_calculator,
4
4
  :return_item_restock_policy,
5
5
  :refunder,
6
- :refund_calculator
6
+ :refund_calculator,
7
+ :refund_presenter
7
8
  end
8
9
 
9
10
  def self.configure(&block)
@@ -1,9 +1,10 @@
1
1
  module Returnly
2
2
  class RefundCalculator
3
3
  attr_accessor :line_items, :order
4
+ extend ::Returnly::RefundsConfiguration
4
5
 
5
6
  def self.process(order, line_items)
6
- RefundPresenter.present_estimate new(order, line_items)
7
+ refund_presenter_class.present_estimate new(order, line_items)
7
8
  end
8
9
 
9
10
  def initialize(order, line_items)
@@ -16,5 +16,9 @@ module Returnly
16
16
  def refund_calculator_class
17
17
  Returnly.refund_calculator || Returnly::RefundCalculator
18
18
  end
19
+
20
+ def refund_presenter_class
21
+ Returnly.refund_presenter || Returnly::RefundPresenter
22
+ end
19
23
  end
20
24
  end
@@ -1,5 +1,5 @@
1
1
  module Returnly
2
- VERSION = '0.6.2'
2
+ VERSION = '0.7.0'
3
3
 
4
4
  def platform_version
5
5
  defined?(Solidus)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus-returnly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Returnly Technologies, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-18 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus
@@ -373,7 +373,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
373
373
  version: '0'
374
374
  requirements: []
375
375
  rubyforge_project:
376
- rubygems_version: 2.4.5.1
376
+ rubygems_version: 2.6.11
377
377
  signing_key:
378
378
  specification_version: 4
379
379
  summary: Returnly integration with Solidus