effective_orders 4.0.0beta2 → 4.0.0beta3
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 +4 -4
- data/app/assets/stylesheets/effective_orders/_order.scss +0 -9
- data/app/controllers/admin/orders_controller.rb +2 -0
- data/app/helpers/effective_orders_helper.rb +6 -6
- data/app/models/concerns/acts_as_purchasable.rb +6 -1
- data/app/views/admin/customers/_actions.html.haml +2 -1
- data/app/views/admin/orders/_order_actions.html.haml +2 -1
- data/app/views/admin/orders/_order_item_fields.html.haml +5 -1
- data/app/views/effective/orders/_checkout_step1.html.haml +1 -1
- data/app/views/effective/orders/_checkout_step2.html.haml +29 -27
- data/app/views/effective/orders/cheque/_form.html.haml +3 -2
- data/app/views/effective/orders/declined.html.haml +3 -1
- data/app/views/effective/orders/free/_form.html.haml +3 -2
- data/app/views/effective/orders/mark_as_paid/_form.html.haml +3 -3
- data/app/views/effective/orders/moneris/_form.html.haml +2 -2
- data/app/views/effective/orders/paypal/_form.html.haml +4 -4
- data/app/views/effective/orders/pretend/_form.html.haml +2 -2
- data/app/views/effective/orders/purchased.html.haml +3 -1
- data/app/views/effective/orders/refund/_form.html.haml +3 -5
- data/app/views/effective/orders/stripe/_form.html.haml +2 -1
- data/db/migrate/01_create_effective_orders.rb.erb +2 -0
- 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: 41a725b2c451424ab930ca84057bfa76d9404a14
|
4
|
+
data.tar.gz: 90b4af7a1be8ad14966a6449b14620271677bb1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca7e090b0167792643e3a9d56d4c25d1127e30a7fa84a33df06c96c762a832633aefed1fca2074b37cc28511a1159ad4880f5a09b1501e1e76884c0028269ad7
|
7
|
+
data.tar.gz: a0cd6b57b48f61aef840cdff2339bac7ec5ff9bf5cf0846121535ffb88e719d30a0f4436eed781e7ca44ab2deeb298b7e5c0df3d8a850a6b6ee9d1e6dbecdc10
|
@@ -35,15 +35,6 @@
|
|
35
35
|
margin-bottom: 1rem;
|
36
36
|
}
|
37
37
|
|
38
|
-
// Checkout buttons. Bottom of order.
|
39
|
-
.effective-order-purchase-actions {
|
40
|
-
text-align: right;
|
41
|
-
|
42
|
-
> * {
|
43
|
-
display: inline-block;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
38
|
.effective-order-admin-purchase-actions {
|
48
39
|
margin-top: 0.5rem;
|
49
40
|
}
|
@@ -37,21 +37,21 @@ module EffectiveOrdersHelper
|
|
37
37
|
|
38
38
|
case processor
|
39
39
|
when :cheque
|
40
|
-
'Pay by
|
40
|
+
'Pay by Cheque'
|
41
41
|
when :free
|
42
|
-
'Checkout
|
42
|
+
'Checkout Free'
|
43
43
|
when :mark_as_paid
|
44
|
-
'Mark as
|
44
|
+
'Admin: Mark as Paid'
|
45
45
|
when :moneris
|
46
|
-
'Checkout with
|
46
|
+
'Checkout with Credit Card'
|
47
47
|
when :paypal
|
48
48
|
'Checkout with PayPal'
|
49
49
|
when :pretend
|
50
50
|
EffectiveOrders.pretend_purchase_in_production_enabled ? 'Purchase Order' : 'Purchase Order (development only)'
|
51
51
|
when :refund
|
52
|
-
'Complete
|
52
|
+
'Complete Refund'
|
53
53
|
when :stripe
|
54
|
-
'Checkout with
|
54
|
+
'Checkout with Credit Card'
|
55
55
|
else
|
56
56
|
'Checkout'
|
57
57
|
end
|
@@ -6,11 +6,16 @@ module ActsAsPurchasable
|
|
6
6
|
module ActiveRecord
|
7
7
|
def acts_as_purchasable(*options)
|
8
8
|
@acts_as_purchasable = options || []
|
9
|
-
include ::ActsAsPurchasable
|
10
9
|
|
11
10
|
instance = new()
|
12
11
|
raise 'must respond_to price' unless instance.respond_to?(:price)
|
13
12
|
raise 'must respond_to purchased_order_id' unless instance.respond_to?(:purchased_order_id)
|
13
|
+
|
14
|
+
if defined?(EffectiveQbSync)
|
15
|
+
raise 'must respond to qb_item_name' unless instance.respond_to?(:qb_item_name)
|
16
|
+
end
|
17
|
+
|
18
|
+
include ::ActsAsPurchasable
|
14
19
|
end
|
15
20
|
end
|
16
21
|
|
@@ -1 +1,2 @@
|
|
1
|
-
=
|
1
|
+
= dropdown(variation: :dropleft) do
|
2
|
+
= dropdown_link_to 'Manage', "https://dashboard.stripe.com/#{'test/' if Rails.env.development?}customers/#{customer.stripe_customer_id}"
|
@@ -2,8 +2,12 @@
|
|
2
2
|
.row.align-items-center
|
3
3
|
= f.fields_for :purchasable, (f.object.purchasable || Effective::Product.new) do |pf|
|
4
4
|
.col-md-1= f.number_field :quantity, input_html: { value: f.object.quantity || 1, min: 1 }
|
5
|
-
.col-md-
|
5
|
+
.col-md-4= pf.text_field :title, maxlength: 255
|
6
6
|
.col-md-2= pf.price_field :price
|
7
|
+
|
8
|
+
- if defined?(EffectiveQbSync)
|
9
|
+
.col-md-2= pf.text_field :qb_item_name, maxlength: 255, label: 'Quickbooks Item'
|
10
|
+
|
7
11
|
.col-md-2.mt-4= pf.check_box :tax_exempt, label: "Tax Exempt", title: 'When checked, tax will not be applied to this item'
|
8
12
|
.col-md-1.mt-4
|
9
13
|
= link_to_remove_association(f, 'data-confirm': 'Really remove this item?') do
|
@@ -4,40 +4,42 @@
|
|
4
4
|
.effective-order-change-items
|
5
5
|
= link_to 'Change Addresses', effective_orders.edit_order_path(order), rel: :nofollow, class: 'btn btn-secondary'
|
6
6
|
|
7
|
-
.effective-order
|
8
|
-
-
|
7
|
+
.effective-order-purchase-actions
|
8
|
+
.form-actions.form-actions-bordered.justify-content-end
|
9
|
+
- provider_locals = { order: order, purchased_url: purchased_url, declined_url: declined_url }
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
- if EffectiveOrders.free? && order.free?
|
12
|
+
= render partial: '/effective/orders/free/form', locals: provider_locals
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
- elsif EffectiveOrders.refunds? && order.refund?
|
15
|
+
-# Nothing
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
- else
|
18
|
+
- if EffectiveOrders.pretend?
|
19
|
+
= render partial: '/effective/orders/pretend/form', locals: provider_locals
|
19
20
|
|
20
|
-
|
21
|
-
|
21
|
+
- if EffectiveOrders.moneris?
|
22
|
+
= render partial: '/effective/orders/moneris/form', locals: provider_locals
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
- if EffectiveOrders.paypal?
|
25
|
+
= render partial: '/effective/orders/paypal/form', locals: provider_locals
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
- if EffectiveOrders.stripe?
|
28
|
+
= render partial: '/effective/orders/stripe/form', locals: provider_locals
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
- if EffectiveOrders.cheque? && order.user == current_user
|
31
|
+
= render partial: '/effective/orders/cheque/form', locals: provider_locals
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
- if EffectiveOrders.pretend? && Rails.env.production? && EffectiveOrders.pretend_purchase_in_production_message.present?
|
34
|
+
%br
|
35
|
+
%p= EffectiveOrders.pretend_purchase_in_production_message
|
35
36
|
|
36
|
-
|
37
|
-
- if EffectiveOrders.
|
38
|
-
.
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
|
38
|
+
- if EffectiveOrders.authorized?(controller, :admin, :effective_orders) && order.user != current_user
|
39
|
+
- if EffectiveOrders.refunds? && order.refund?
|
40
|
+
.effective-order-admin-purchase-actions
|
41
|
+
= render partial: '/effective/orders/refund/form', locals: provider_locals
|
42
|
+
- elsif EffectiveOrders.mark_as_paid?
|
43
|
+
.effective-order-admin-purchase-actions
|
44
|
+
= render partial: '/effective/orders/mark_as_paid/form', locals: provider_locals
|
43
45
|
|
@@ -1,4 +1,5 @@
|
|
1
|
-
=
|
1
|
+
= effective_form_with(scope: :cheque, url: effective_orders.pay_by_cheque_order_path(order), method: :post) do |f|
|
2
2
|
= hidden_field_tag(:purchased_url, purchased_url)
|
3
3
|
= hidden_field_tag(:declined_url, declined_url)
|
4
|
-
|
4
|
+
|
5
|
+
= f.submit order_checkout_label(:cheque), border: false
|
@@ -3,10 +3,12 @@
|
|
3
3
|
%p= flash[:danger]
|
4
4
|
|
5
5
|
%p.effective-orders-page-content
|
6
|
-
= link_to 'Home', root_path
|
6
|
+
= link_to 'Home', root_path
|
7
7
|
|
8
8
|
%p.effective-orders-page-content
|
9
9
|
- if current_cart.present?
|
10
10
|
Your #{link_to_current_cart(label: 'Cart')} items have been saved. Please try again.
|
11
11
|
- else
|
12
12
|
Please try again.
|
13
|
+
|
14
|
+
= link_to 'Continue', root_path, class: 'btn btn-primary'
|
@@ -1,4 +1,5 @@
|
|
1
|
-
=
|
1
|
+
= effective_form_with(scope: :free, url: effective_orders.free_order_path(order), method: :post) do |f|
|
2
2
|
= hidden_field_tag(:purchased_url, purchased_url)
|
3
3
|
= hidden_field_tag(:declined_url, declined_url)
|
4
|
-
|
4
|
+
|
5
|
+
= f.submit order_checkout_label(:free), border: false
|
@@ -1,5 +1,5 @@
|
|
1
|
-
.
|
2
|
-
.
|
1
|
+
.card
|
2
|
+
.card-body
|
3
3
|
%h2 Admin: Offline Payment
|
4
4
|
|
5
5
|
= effective_form_with(model: order, url: effective_orders.mark_as_paid_order_path(order), method: :post) do |f|
|
@@ -22,5 +22,5 @@
|
|
22
22
|
|
23
23
|
= f.text_area :note_to_buyer, hint: 'This message will be displayed on the receipt.'
|
24
24
|
|
25
|
-
=
|
25
|
+
= f.submit order_checkout_label(:mark_as_paid)
|
26
26
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
=
|
1
|
+
= effective_form_with(scope: :moneris, url: EffectiveOrders.moneris[:hpp_url], method: :post) do |f|
|
2
2
|
= hidden_field_tag(:ps_store_id, EffectiveOrders.moneris[:ps_store_id])
|
3
3
|
= hidden_field_tag(:hpp_key, EffectiveOrders.moneris[:hpp_key])
|
4
4
|
= hidden_field_tag(:lang, 'en-ca')
|
@@ -44,4 +44,4 @@
|
|
44
44
|
= hidden_field_tag(:ship_postal_code, address.postal_code)
|
45
45
|
= hidden_field_tag(:ship_country, address.country)
|
46
46
|
|
47
|
-
=
|
47
|
+
= f.submit order_checkout_label(:moneris), border: false
|
@@ -1,5 +1,5 @@
|
|
1
|
-
=
|
2
|
-
= hidden_field_tag
|
3
|
-
= hidden_field_tag
|
1
|
+
= effective_form_with(scope: :paypal, url: EffectiveOrders.paypal[:paypal_url], method: :post) do |f|
|
2
|
+
= hidden_field_tag(:cmd, '_s-xclick')
|
3
|
+
= hidden_field_tag(:encrypted, paypal_encrypted_payload(order))
|
4
4
|
|
5
|
-
=
|
5
|
+
= f.submit order_checkout_label(:paypal), border: false
|
@@ -1,2 +1,2 @@
|
|
1
|
-
=
|
2
|
-
=
|
1
|
+
= effective_form_with(scope: :pretend, url: effective_orders.pretend_order_path(order, purchased_url: purchased_url, declined_url: declined_url), method: :post) do |f|
|
2
|
+
= f.submit order_checkout_label(:pretend), border: false
|
@@ -1,9 +1,11 @@
|
|
1
1
|
%h1.effective-heading= @page_title
|
2
2
|
|
3
3
|
%p.effective-orders-page-content
|
4
|
-
= link_to 'Home', root_path
|
4
|
+
= link_to 'Home', root_path
|
5
5
|
|
6
6
|
%p.effective-orders-page-content
|
7
7
|
You have successfully purchased the following:
|
8
8
|
|
9
9
|
= render @order
|
10
|
+
|
11
|
+
= link_to 'Continue', root_path, class: 'btn btn-primary'
|
@@ -1,5 +1,5 @@
|
|
1
|
-
.
|
2
|
-
.
|
1
|
+
.card
|
2
|
+
.card-body
|
3
3
|
%h2 Admin: Complete Refund
|
4
4
|
|
5
5
|
= effective_form_with(model: order, url: effective_orders.refund_order_path(order), method: :post) do |f|
|
@@ -23,6 +23,4 @@
|
|
23
23
|
|
24
24
|
= f.text_area :note_to_buyer, hint: 'This is displayed to the buyer on all order receipts.'
|
25
25
|
|
26
|
-
.
|
27
|
-
= f.submit order_checkout_label(:refund), class: 'btn btn-primary'
|
28
|
-
|
26
|
+
= f.submit order_checkout_label(:refund)
|
@@ -4,4 +4,5 @@
|
|
4
4
|
= effective_form_with(model: @stripe_charge || Effective::Providers::StripeCharge.new(order: order), url: effective_orders.stripe_charge_orders_path) do |f|
|
5
5
|
= f.hidden_field :stripe_token
|
6
6
|
= f.hidden_field :effective_order_id
|
7
|
-
|
7
|
+
|
8
|
+
= f.submit order_checkout_label(:stripe), border: false
|
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: 4.0.
|
4
|
+
version: 4.0.0beta3
|
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: 2018-
|
11
|
+
date: 2018-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|