spree_frontend 3.2.0.rc1 → 3.2.0.rc2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d492783cc7c2e03af5aa464ff106164671d47e16
|
4
|
+
data.tar.gz: 33eb524b36fa06355a1330b7f9d909bd71221664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 498a2359ded88634cb12d3c93e0f575a046418d07b148465536d9cdbdce1fc4250b7da9805482b5bbf4153b785f7691ac4d1ee2104b9ba18bafed9fa863de977
|
7
|
+
data.tar.gz: 51d160a36d15c5cdd16eac4dc30733cb554df9f6e48d0cf1ba4bf63f805941ef318b691bff3715b49246212621e31a5364ebe90146c81f879132b0aeff5af0e9
|
@@ -169,6 +169,7 @@ module Spree
|
|
169
169
|
|
170
170
|
# Remove other payment method parameters.
|
171
171
|
params[:order].delete(:payments_attributes)
|
172
|
+
params[:order].delete(:existing_card)
|
172
173
|
params.delete(:payment_source)
|
173
174
|
|
174
175
|
# Return to the Payments page if additional payment is needed.
|
@@ -458,5 +458,58 @@ describe Spree::CheckoutController, type: :controller do
|
|
458
458
|
order.reload
|
459
459
|
expect(order.state).to eq 'confirm'
|
460
460
|
end
|
461
|
+
|
462
|
+
context 'with store credits payment' do
|
463
|
+
let(:user) { create(:user) }
|
464
|
+
let(:credit_amount) { order.total + 1.00 }
|
465
|
+
let(:put_attrs) do
|
466
|
+
{
|
467
|
+
state: 'payment',
|
468
|
+
apply_store_credit: 'Apply Store Credit',
|
469
|
+
order: {
|
470
|
+
payments_attributes: [{ payment_method_id: payment_method_id }],
|
471
|
+
}
|
472
|
+
}
|
473
|
+
end
|
474
|
+
before do
|
475
|
+
create(:store_credit_payment_method)
|
476
|
+
create(:store_credit, user: user, amount: credit_amount)
|
477
|
+
end
|
478
|
+
|
479
|
+
def expect_one_store_credit_payment(order, amount)
|
480
|
+
expect(order.payments.count).to eq 1
|
481
|
+
expect(order.payments.first.source).to be_a Spree::StoreCredit
|
482
|
+
expect(order.payments.first.amount).to eq amount
|
483
|
+
end
|
484
|
+
|
485
|
+
it 'can fully pay with store credits while removing other payment attributes' do
|
486
|
+
spree_put :update, put_attrs
|
487
|
+
|
488
|
+
order.reload
|
489
|
+
expect(order.state).to eq 'confirm'
|
490
|
+
expect_one_store_credit_payment(order, order.total)
|
491
|
+
end
|
492
|
+
|
493
|
+
it 'can fully pay with store credits while removing an existing card' do
|
494
|
+
credit_card = create(:credit_card, user: user, payment_method: Spree::PaymentMethod.first)
|
495
|
+
put_attrs[:order][:existing_card] = credit_card.id
|
496
|
+
spree_put :update, put_attrs
|
497
|
+
|
498
|
+
order.reload
|
499
|
+
expect(order.state).to eq 'confirm'
|
500
|
+
expect_one_store_credit_payment(order, order.total)
|
501
|
+
end
|
502
|
+
|
503
|
+
context 'partial payment' do
|
504
|
+
let(:credit_amount) { order.total - 1.00 }
|
505
|
+
it 'returns to payment for partial store credit' do
|
506
|
+
spree_put :update, put_attrs
|
507
|
+
|
508
|
+
order.reload
|
509
|
+
expect(order.state).to eq 'payment'
|
510
|
+
expect_one_store_credit_payment(order, credit_amount)
|
511
|
+
end
|
512
|
+
end
|
513
|
+
end
|
461
514
|
end
|
462
515
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_frontend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.0.
|
4
|
+
version: 3.2.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.2.0.
|
19
|
+
version: 3.2.0.rc2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.2.0.
|
26
|
+
version: 3.2.0.rc2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.2.0.
|
33
|
+
version: 3.2.0.rc2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.2.0.
|
40
|
+
version: 3.2.0.rc2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bootstrap-sass
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|