solidus_bolt 0.3.0 → 0.4.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e25dd3c40e487372056178b18ffae03f5cddbd5b56756cf32874a7e0f761a5ac
|
4
|
+
data.tar.gz: 74bfbc7db9a0b6b9b47f501cbd67d6c141a9164549266eb99114a3de5a4de840
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df41aae33da5dc6d3c070507fe0c7a19410ece8ffabfef114f8dca23a387b5f3cdadb0317ef1121051d95807b08717782db0e802290668e277f7ae492f4464e
|
7
|
+
data.tar.gz: 840b8836eaf726ab402b807bed737d536c14adaac70d24d0bba4a030afd58d8677d715ae54ddcd8a2167f3ab4a829a39dcf49e7aefb028064bfd8f539722c49a
|
@@ -31,6 +31,11 @@ const redirectToNextStep = (frontend) => {
|
|
31
31
|
}
|
32
32
|
}
|
33
33
|
|
34
|
+
async function getResponseText(response) {
|
35
|
+
const text = await response.text();
|
36
|
+
return text;
|
37
|
+
}
|
38
|
+
|
34
39
|
const updateOrder = async (card, paymentMethodId, frontend) => {
|
35
40
|
await fetch(`/api/checkouts/${Spree.current_order_id}`, {
|
36
41
|
method: 'PATCH',
|
@@ -39,6 +44,7 @@ const updateOrder = async (card, paymentMethodId, frontend) => {
|
|
39
44
|
'X-Spree-Order-Token': Spree.current_order_token
|
40
45
|
},
|
41
46
|
body: JSON.stringify({
|
47
|
+
'state': 'payment',
|
42
48
|
'order': {
|
43
49
|
'payments_attributes': [{
|
44
50
|
'payment_method_id': paymentMethodId,
|
@@ -55,8 +61,14 @@ const updateOrder = async (card, paymentMethodId, frontend) => {
|
|
55
61
|
}
|
56
62
|
})
|
57
63
|
})
|
58
|
-
.then(() => {
|
59
|
-
|
64
|
+
.then((response) => {
|
65
|
+
if(response.ok) {
|
66
|
+
redirectToNextStep(frontend)
|
67
|
+
} else {
|
68
|
+
getResponseText(response).then(text => {
|
69
|
+
console.error(text);
|
70
|
+
});
|
71
|
+
}
|
60
72
|
})
|
61
73
|
.catch((response) => {
|
62
74
|
console.log('Error updating order')
|
data/lib/solidus_bolt/version.rb
CHANGED
data/solidus_bolt.gemspec
CHANGED
@@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency 'multi_json'
|
35
35
|
spec.add_dependency 'omniauth-bolt'
|
36
36
|
spec.add_dependency 'rails'
|
37
|
-
spec.add_dependency 'solidus_auth_devise'
|
38
37
|
spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 4']
|
39
38
|
spec.add_dependency 'solidus_social'
|
40
39
|
spec.add_dependency 'solidus_support', '~> 0.5'
|
@@ -7,6 +7,7 @@ RSpec.describe SolidusBolt::OrderDecorator do
|
|
7
7
|
it 'returns a hash with line items and price' do
|
8
8
|
result = {
|
9
9
|
total_amount: (order.total * 100).to_i,
|
10
|
+
tax_amount: (order.tax_total * 100).to_i,
|
10
11
|
order_reference: order.number,
|
11
12
|
currency: 'USD',
|
12
13
|
shipments: array_including(hash_including(:reference)),
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_bolt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- piyushswain
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-07-
|
13
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coffee-rails
|
@@ -96,20 +96,6 @@ dependencies:
|
|
96
96
|
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: solidus_auth_devise
|
101
|
-
requirement: !ruby/object:Gem::Requirement
|
102
|
-
requirements:
|
103
|
-
- - ">="
|
104
|
-
- !ruby/object:Gem::Version
|
105
|
-
version: '0'
|
106
|
-
type: :runtime
|
107
|
-
prerelease: false
|
108
|
-
version_requirements: !ruby/object:Gem::Requirement
|
109
|
-
requirements:
|
110
|
-
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: '0'
|
113
99
|
- !ruby/object:Gem::Dependency
|
114
100
|
name: solidus_core
|
115
101
|
requirement: !ruby/object:Gem::Requirement
|