effective_orders 2.1.6 → 2.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/app/controllers/effective/providers/app_checkout.rb +3 -3
- data/app/controllers/effective/providers/ccbill.rb +2 -4
- data/app/controllers/effective/providers/moneris.rb +1 -1
- data/app/controllers/effective/providers/paypal.rb +2 -4
- data/app/helpers/effective_orders_helper.rb +5 -3
- data/app/views/effective/orders/moneris/_form.html.haml +1 -1
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 241819ceeb137196d59b1383c99ff092e65e1fa7
|
4
|
+
data.tar.gz: d79d5f2798e61e92ab25f686f1db9624d2706dec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c74dcef00e1d2506b7a425582b3b51eaee276c007861e90ea5a275b78d1e40ff089332c7c084bf4cb63aaf9126b1004f146a68f2dfa3a24e00ba7c345f37f115
|
7
|
+
data.tar.gz: 1087399127980e9089fb2f1dd41d5d01eb2a850ac4f96e6074b82540b7f8ea4214aca1b0404ecba099cd6de13367c5a6bc192af83052cfd37d47d1c21615bae8
|
data/README.md
CHANGED
@@ -793,12 +793,14 @@ Order totals ending in .05 will be Declined
|
|
793
793
|
|
794
794
|
And there's a whole bunch more. Please refer to:
|
795
795
|
|
796
|
-
https://www.
|
796
|
+
https://www.collinsharper.com/downloadable/download/sample/sample_id/5/
|
797
797
|
|
798
798
|
2. Moneris will not process a duplicate order ID
|
799
799
|
|
800
800
|
Once Order id=1 has been purchased/declined, you will be unable to purchase an order with id=1 ever again.
|
801
801
|
|
802
|
+
effective_orders works around this by appending a timestamp to the order ID.
|
803
|
+
|
802
804
|
|
803
805
|
## Paying via Stripe
|
804
806
|
|
@@ -4,13 +4,13 @@ module Effective
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
included do
|
7
|
-
if defined?(CanCan)
|
8
|
-
skip_authorization_check only: [:app_checkout]
|
9
|
-
end
|
10
7
|
end
|
11
8
|
|
12
9
|
def app_checkout
|
13
10
|
@order = Order.find(params[:id])
|
11
|
+
|
12
|
+
(EffectiveOrders.authorized?(self, :update, @order) rescue false)
|
13
|
+
|
14
14
|
checkout = EffectiveOrders.app_checkout[:service].call(order: @order)
|
15
15
|
if checkout.success?
|
16
16
|
order_purchased(details: payment_details(checkout), provider: 'app_checkout', card: 'none')
|
@@ -5,16 +5,14 @@ module Effective
|
|
5
5
|
|
6
6
|
included do
|
7
7
|
skip_before_filter :verify_authenticity_token, only: [:ccbill_postback]
|
8
|
-
|
9
|
-
if defined?(CanCan)
|
10
|
-
skip_authorization_check only: [:ccbill_postback]
|
11
|
-
end
|
12
8
|
end
|
13
9
|
|
14
10
|
def ccbill_postback
|
15
11
|
postback = Effective::Providers::CcbillPostback.new(params)
|
16
12
|
@order ||= Effective::Order.find(postback.order_id)
|
17
13
|
|
14
|
+
(EffectiveOrders.authorized?(self, :update, @order) rescue false)
|
15
|
+
|
18
16
|
if @order.present? && postback.verified?
|
19
17
|
if @order.purchased?
|
20
18
|
order_purchased(details: postback.order_details, provider: 'ccbill')
|
@@ -10,7 +10,7 @@ module Effective
|
|
10
10
|
def moneris_postback
|
11
11
|
@order ||= Effective::Order.find(params[:response_order_id])
|
12
12
|
|
13
|
-
EffectiveOrders.authorized?(self, :update, @order)
|
13
|
+
(EffectiveOrders.authorized?(self, :update, @order) rescue false)
|
14
14
|
|
15
15
|
# Delete the Purchased and Declined Redirect URLs
|
16
16
|
purchased_redirect_url = params.delete(:rvar_purchased_redirect_url)
|
@@ -5,15 +5,13 @@ module Effective
|
|
5
5
|
|
6
6
|
included do
|
7
7
|
skip_before_filter :verify_authenticity_token, :only => [:paypal_postback]
|
8
|
-
|
9
|
-
if defined?(CanCan)
|
10
|
-
skip_authorization_check only: [:paypal_postback]
|
11
|
-
end
|
12
8
|
end
|
13
9
|
|
14
10
|
def paypal_postback
|
15
11
|
@order ||= Effective::Order.where(id: (params[:invoice].to_i rescue 0)).first
|
16
12
|
|
13
|
+
(EffectiveOrders.authorized?(self, :update, @order) rescue false)
|
14
|
+
|
17
15
|
if @order.present?
|
18
16
|
if @order.purchased?
|
19
17
|
order_purchased(details: params, provider: 'paypal', card: params[:payment_type])
|
@@ -1,10 +1,12 @@
|
|
1
1
|
module EffectiveOrdersHelper
|
2
|
-
def price_to_currency(price)
|
2
|
+
def price_to_currency(price, options = {})
|
3
3
|
raise 'price_to_currency expects an Integer representing the number of cents in a price' unless price.kind_of?(Integer)
|
4
|
-
|
4
|
+
options[:precision] ||= 2
|
5
|
+
number_to_currency(price / 100.0, options)
|
5
6
|
end
|
6
7
|
|
7
|
-
def tax_rate_to_percentage(tax_rate)
|
8
|
+
def tax_rate_to_percentage(tax_rate, options = {})
|
9
|
+
options[:strip_insignificant_zeros] = true if options[:strip_insignificant_zeros].nil?
|
8
10
|
number_to_percentage(tax_rate, strip_insignificant_zeros: true)
|
9
11
|
end
|
10
12
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
= hidden_field_tag(:email, order.user.try(:email))
|
14
14
|
= hidden_field_tag(:cust_id, order.user.to_param)
|
15
15
|
|
16
|
-
= hidden_field_tag(:order_id, [order.to_param, order.billing_name.try(:parameterize).presence].compact.join('-'))
|
16
|
+
= hidden_field_tag(:order_id, [order.to_param, order.billing_name.try(:parameterize).presence, Time.zone.now.to_i].compact.join('-'))
|
17
17
|
= hidden_field_tag(:gst, '%.2f' % (order.tax / 100.0))
|
18
18
|
= hidden_field_tag(:charge_total, '%.2f' % (order.total / 100.0))
|
19
19
|
|
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: 2.1.
|
4
|
+
version: 2.1.7
|
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: 2016-04-
|
11
|
+
date: 2016-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|