effective_orders 6.14.0 → 6.14.1

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: cdbb9b1f68ae5470c0d64b4e7d27ca32cdcd21c99ce4cdcf36cd06182852bf85
4
- data.tar.gz: 91732e8679f53cc672cdcf888e79680882cf83fe92a955d95e8a299719eb18ba
3
+ metadata.gz: 6bd29353ae8797a9589a4a80bd592c376f008e82df8c216ec691967e4c4e5a96
4
+ data.tar.gz: 5bff3315e5bd67b4e23eb90c1fb17e8d5267c9a21d12efe5791230f7f675e729
5
5
  SHA512:
6
- metadata.gz: 974902ddc3095ec659b94e6af5ad8c45ae29ca52f1fa790cf6f787f22ecbc48d2bf1127c50ca0b9d396471700a928c30c734d8dd812b75a204d6ff1e4cc6f572
7
- data.tar.gz: 1b02ad24cb46a6377c68a68dbe705e23a201860f4696ca1122237c5d228e01ee72951a05dd74e4ebda2cc92c41fc2c01e2e1bf7f62881fc51cb58f46abfa543c
6
+ metadata.gz: b8bafbde6a79e146b216f982ee6b292c93966918e9f2d8e74a21b9951d352dbe10c8d57e5380eb9482b3163bb7f5ced4a17b69884c1987d6ca767020e904ddaa
7
+ data.tar.gz: 76f4706faff04901d8a4061125624560bfcad049bd2be920095c46cc53cf6f7954fb13668a808622135dd95b23f286db5322dea3290b51a7d4dfc22cd237ee6c
@@ -119,12 +119,13 @@ module EffectiveOrdersHelper
119
119
  end
120
120
  end
121
121
 
122
- def render_checkout_step1(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: false)
122
+ def render_checkout_step1(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: nil)
123
123
  locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url, namespace: namespace, skip_deferred: skip_deferred, skip_order: skip_order }
124
124
  render(partial: 'effective/orders/checkout_step1', locals: locals)
125
125
  end
126
126
 
127
- def render_checkout_step2(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: false)
127
+ def render_checkout_step2(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: nil)
128
+ skip_order = order.delayed_payment_date_upcoming? if skip_order.nil?
128
129
  locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url, namespace: namespace, skip_deferred: skip_deferred, skip_order: skip_order }
129
130
  render(partial: 'effective/orders/checkout_step2', locals: locals)
130
131
  end
@@ -566,6 +566,12 @@ module Effective
566
566
  "Your #{delayed_payment_method} will be charged $#{'%0.2f' % total_to_f} on #{delayed_payment_date.strftime('%F')}"
567
567
  end
568
568
 
569
+ def delayed_payment_date_past?
570
+ return false unless delayed?
571
+ delayed_payment_date <= Time.zone.now.to_date
572
+ end
573
+
574
+ # This is checked by an effective_orders view helper. When upcoming we only collect card info.
569
575
  def delayed_payment_date_upcoming?
570
576
  return false unless delayed?
571
577
  delayed_payment_date > Time.zone.now.to_date
@@ -576,11 +582,6 @@ module Effective
576
582
  delayed_payment_date == Time.zone.now.to_date
577
583
  end
578
584
 
579
- def delayed_payment_date_past?
580
- return false unless delayed?
581
- delayed_payment_date < Time.zone.now.to_date
582
- end
583
-
584
585
  def pending_refund?
585
586
  return false if EffectiveOrders.buyer_purchases_refund?
586
587
  return false if purchased?
@@ -9,7 +9,7 @@
9
9
  .effective-order-purchase-actions
10
10
  - provider_locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url }
11
11
 
12
- - if EffectiveOrders.delayed? && order.delayed?
12
+ - if EffectiveOrders.delayed? && order.delayed_payment_date_upcoming?
13
13
  = render partial: '/effective/orders/delayed/form', locals: provider_locals
14
14
 
15
15
  - elsif EffectiveOrders.free? && order.free?
@@ -5,6 +5,7 @@
5
5
  = render partial: 'effective/orders/order_header', locals: { order: order }
6
6
  = render partial: 'effective/orders/order_payment', locals: { order: order }
7
7
  = render partial: 'effective/orders/order_shipping', locals: { order: order }
8
+ = render partial: 'effective/orders/order_declined', locals: { order: order }
8
9
  = render partial: 'effective/orders/order_deferred', locals: { order: order }
9
10
  = render partial: 'effective/orders/order_notes', locals: { order: order }
10
11
  = render partial: 'effective/orders/order_items', locals: { order: order }
@@ -0,0 +1,10 @@
1
+ - if order.declined?
2
+ .effective-order-declined
3
+ %table.table
4
+ %thead
5
+ %tr
6
+ %th Payment Declined
7
+ %tbody
8
+ %tr
9
+ %td
10
+ Your card was declined by the payment processor: #{order.declined_reason}
@@ -13,4 +13,10 @@
13
13
  -# This is set by the deluxe.js javascript on Submit
14
14
  = f.hidden_field :payment_intent, required: true
15
15
 
16
+ - if EffectiveOrders.deluxe[:environment] == 'sandbox'
17
+ .alert.alert-info.mb-4
18
+ This is the #{Rails.env.upcase} SERVER.
19
+ %br
20
+ Use credit card number 4242 4242 4242 4242 with any future expiry and any CVC.
21
+
16
22
  = render('effective/orders/deluxe/element')
@@ -7,4 +7,10 @@
7
7
  -# This is set by the deluxe.js javascript on Submit
8
8
  = f.hidden_field :payment_intent, required: true
9
9
 
10
+ - if EffectiveOrders.deluxe[:environment] == 'sandbox'
11
+ .alert.alert-info.mb-4
12
+ This is the #{Rails.env.upcase} SERVER.
13
+ %br
14
+ Use credit card number 4242 4242 4242 4242 with any future expiry and any CVC.
15
+
10
16
  = render('effective/orders/deluxe_delayed/element')
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.14.0'.freeze
2
+ VERSION = '6.14.1'.freeze
3
3
  end
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: 6.14.0
4
+ version: 6.14.1
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: 2024-07-03 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -286,6 +286,7 @@ files:
286
286
  - app/views/effective/orders/_layout.html.haml
287
287
  - app/views/effective/orders/_order.html.haml
288
288
  - app/views/effective/orders/_order_actions.html.haml
289
+ - app/views/effective/orders/_order_declined.html.haml
289
290
  - app/views/effective/orders/_order_deferred.html.haml
290
291
  - app/views/effective/orders/_order_footer.html.haml
291
292
  - app/views/effective/orders/_order_header.html.haml