spree_vpago 2.3.8 → 2.3.9
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/Gemfile.lock +1 -1
- data/app/assets/javascripts/vpago/vpago_payments/user_informers/firebase.js +12 -9
- data/app/controllers/spree/vpago_payments_controller.rb +15 -9
- data/app/javascripts/vpago/vpago_payments/user_informers/firebase.js +11 -7
- data/lib/spree_vpago/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24c3243a11a22045eb530115ea1412bc74d8f9cc1d03ea821d5813f2859cf380
|
|
4
|
+
data.tar.gz: 26ade26146ad653b7dff55b117b099b3988fab1c210e04a5b27e6a25e2562df1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 821eb790249845feafc9f5cfa1349e24a47d3426c48b194051f4351ec518935f96f51863f2ac5e9dbd69e139baafef01492eae79ea18f1ffd6d369cd593a9a9a
|
|
7
|
+
data.tar.gz: fc8c75f49fba47c371442c8dd089d0185f125ee0b6316d569e6121d2c0dab98b0e5c64d182334cc674bd2289a2f2620e9f6d3a17139f791acacf06097fc420a7
|
data/Gemfile.lock
CHANGED
|
@@ -13693,10 +13693,10 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
13693
13693
|
firebaseConfigs,
|
|
13694
13694
|
documentReferencePath,
|
|
13695
13695
|
onPaymentIsProcessing,
|
|
13696
|
+
onPaymentIsRetrying,
|
|
13696
13697
|
onOrderIsProcessing,
|
|
13697
13698
|
onOrderIsCompleted,
|
|
13698
13699
|
onOrderProcessFailed,
|
|
13699
|
-
onPaymentIsRefunded,
|
|
13700
13700
|
onPaymentProcessFailed,
|
|
13701
13701
|
onCompleted
|
|
13702
13702
|
}) {
|
|
@@ -13713,6 +13713,9 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
13713
13713
|
let processing = documentData["processing"] === true;
|
|
13714
13714
|
let reasonCode = documentData["reason_code"];
|
|
13715
13715
|
let reasonMessage = documentData["reason_message"];
|
|
13716
|
+
if (window.parent !== window) {
|
|
13717
|
+
window.parent.postMessage(messageCode, "*");
|
|
13718
|
+
}
|
|
13716
13719
|
let orderCompleted = orderState === "complete";
|
|
13717
13720
|
if (orderCompleted) {
|
|
13718
13721
|
queueProcessor.queueStateChange({
|
|
@@ -13743,11 +13746,11 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
13743
13746
|
}
|
|
13744
13747
|
});
|
|
13745
13748
|
break;
|
|
13746
|
-
case "
|
|
13749
|
+
case "payment_is_retrying":
|
|
13747
13750
|
queueProcessor.queueStateChange({
|
|
13748
13751
|
minDelayInMs: 1500,
|
|
13749
13752
|
callback: async () => {
|
|
13750
|
-
await
|
|
13753
|
+
await onPaymentIsRetrying(
|
|
13751
13754
|
orderState,
|
|
13752
13755
|
paymentState,
|
|
13753
13756
|
processing,
|
|
@@ -13757,11 +13760,11 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
13757
13760
|
}
|
|
13758
13761
|
});
|
|
13759
13762
|
break;
|
|
13760
|
-
case "
|
|
13763
|
+
case "order_is_processing":
|
|
13761
13764
|
queueProcessor.queueStateChange({
|
|
13762
13765
|
minDelayInMs: 1500,
|
|
13763
13766
|
callback: async () => {
|
|
13764
|
-
await
|
|
13767
|
+
await onOrderIsProcessing(
|
|
13765
13768
|
orderState,
|
|
13766
13769
|
paymentState,
|
|
13767
13770
|
processing,
|
|
@@ -13771,11 +13774,11 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
13771
13774
|
}
|
|
13772
13775
|
});
|
|
13773
13776
|
break;
|
|
13774
|
-
case "
|
|
13777
|
+
case "order_is_completed":
|
|
13775
13778
|
queueProcessor.queueStateChange({
|
|
13776
13779
|
minDelayInMs: 1500,
|
|
13777
13780
|
callback: async () => {
|
|
13778
|
-
await
|
|
13781
|
+
await onOrderIsCompleted(
|
|
13779
13782
|
orderState,
|
|
13780
13783
|
paymentState,
|
|
13781
13784
|
processing,
|
|
@@ -13785,11 +13788,11 @@ This typically indicates that your device does not have a healthy Internet conne
|
|
|
13785
13788
|
}
|
|
13786
13789
|
});
|
|
13787
13790
|
break;
|
|
13788
|
-
case "
|
|
13791
|
+
case "order_process_failed":
|
|
13789
13792
|
queueProcessor.queueStateChange({
|
|
13790
13793
|
minDelayInMs: 1500,
|
|
13791
13794
|
callback: async () => {
|
|
13792
|
-
await
|
|
13795
|
+
await onOrderProcessFailed(
|
|
13793
13796
|
orderState,
|
|
13794
13797
|
paymentState,
|
|
13795
13798
|
processing,
|
|
@@ -8,11 +8,11 @@ module Spree
|
|
|
8
8
|
rescue_from ActiveRecord::RecordNotFound, with: :render_not_found
|
|
9
9
|
rescue_from CanCan::AccessDenied, with: :access_denied
|
|
10
10
|
|
|
11
|
+
before_action :find_payment, only: %i[checkout processing success]
|
|
12
|
+
after_action :allow_iframe_embedding, only: %i[checkout processing success]
|
|
13
|
+
|
|
11
14
|
# GET
|
|
12
15
|
def checkout
|
|
13
|
-
@payment = Vpago::PaymentFinder.new(params.permit!.to_h).find_and_verify
|
|
14
|
-
raise ActiveRecord::RecordNotFound unless @payment.present?
|
|
15
|
-
|
|
16
16
|
return redirect_to @payment.processing_url, allow_other_host: true unless @payment.checkout?
|
|
17
17
|
|
|
18
18
|
@order = @payment.order
|
|
@@ -22,9 +22,6 @@ module Spree
|
|
|
22
22
|
|
|
23
23
|
# GET
|
|
24
24
|
def processing
|
|
25
|
-
@payment = Vpago::PaymentFinder.new(params.permit!.to_h).find_and_verify
|
|
26
|
-
raise ActiveRecord::RecordNotFound unless @payment.present?
|
|
27
|
-
|
|
28
25
|
@order = @payment.order
|
|
29
26
|
|
|
30
27
|
VpagoLogger.log(label: 'Spree::VpagoPaymentsController#processing', data: vpago_log_context)
|
|
@@ -32,9 +29,6 @@ module Spree
|
|
|
32
29
|
|
|
33
30
|
# GET
|
|
34
31
|
def success
|
|
35
|
-
@payment = Vpago::PaymentFinder.new(params.permit!.to_h).find_and_verify
|
|
36
|
-
raise ActiveRecord::RecordNotFound unless @payment.present?
|
|
37
|
-
|
|
38
32
|
@order = @payment.order
|
|
39
33
|
raise CanCan::AccessDenied unless @order.completed?
|
|
40
34
|
|
|
@@ -147,6 +141,18 @@ module Spree
|
|
|
147
141
|
sanitized_params
|
|
148
142
|
end
|
|
149
143
|
|
|
144
|
+
def find_payment
|
|
145
|
+
@payment = Vpago::PaymentFinder.new(params.permit!.to_h).find_and_verify
|
|
146
|
+
raise ActiveRecord::RecordNotFound unless @payment.present?
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# frame-ancestors (set above) supersedes X-Frame-Options in modern
|
|
150
|
+
# browsers, but the default SAMEORIGIN header would still block legacy
|
|
151
|
+
# browsers from embedding these pages, so drop it for the iframe actions.
|
|
152
|
+
def allow_iframe_embedding
|
|
153
|
+
response.headers.delete('X-Frame-Options')
|
|
154
|
+
end
|
|
155
|
+
|
|
150
156
|
def render_not_found
|
|
151
157
|
respond_to do |format|
|
|
152
158
|
format.html { render file: Rails.public_path.join('404.html'), status: :not_found, layout: false }
|
|
@@ -31,6 +31,10 @@ async function listenToProcessingState({
|
|
|
31
31
|
let reasonCode = documentData["reason_code"];
|
|
32
32
|
let reasonMessage = documentData["reason_message"];
|
|
33
33
|
|
|
34
|
+
if (window.parent !== window) {
|
|
35
|
+
window.parent.postMessage(messageCode, "*");
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
let orderCompleted = orderState === "complete";
|
|
35
39
|
if (orderCompleted) {
|
|
36
40
|
queueProcessor.queueStateChange({
|
|
@@ -40,7 +44,7 @@ async function listenToProcessingState({
|
|
|
40
44
|
orderState,
|
|
41
45
|
paymentState,
|
|
42
46
|
reasonCode,
|
|
43
|
-
reasonMessage
|
|
47
|
+
reasonMessage,
|
|
44
48
|
);
|
|
45
49
|
},
|
|
46
50
|
});
|
|
@@ -57,7 +61,7 @@ async function listenToProcessingState({
|
|
|
57
61
|
paymentState,
|
|
58
62
|
processing,
|
|
59
63
|
reasonCode,
|
|
60
|
-
reasonMessage
|
|
64
|
+
reasonMessage,
|
|
61
65
|
);
|
|
62
66
|
},
|
|
63
67
|
});
|
|
@@ -71,7 +75,7 @@ async function listenToProcessingState({
|
|
|
71
75
|
paymentState,
|
|
72
76
|
processing,
|
|
73
77
|
reasonCode,
|
|
74
|
-
reasonMessage
|
|
78
|
+
reasonMessage,
|
|
75
79
|
);
|
|
76
80
|
},
|
|
77
81
|
});
|
|
@@ -85,7 +89,7 @@ async function listenToProcessingState({
|
|
|
85
89
|
paymentState,
|
|
86
90
|
processing,
|
|
87
91
|
reasonCode,
|
|
88
|
-
reasonMessage
|
|
92
|
+
reasonMessage,
|
|
89
93
|
);
|
|
90
94
|
},
|
|
91
95
|
});
|
|
@@ -99,7 +103,7 @@ async function listenToProcessingState({
|
|
|
99
103
|
paymentState,
|
|
100
104
|
processing,
|
|
101
105
|
reasonCode,
|
|
102
|
-
reasonMessage
|
|
106
|
+
reasonMessage,
|
|
103
107
|
);
|
|
104
108
|
},
|
|
105
109
|
});
|
|
@@ -113,7 +117,7 @@ async function listenToProcessingState({
|
|
|
113
117
|
paymentState,
|
|
114
118
|
processing,
|
|
115
119
|
reasonCode,
|
|
116
|
-
reasonMessage
|
|
120
|
+
reasonMessage,
|
|
117
121
|
);
|
|
118
122
|
},
|
|
119
123
|
});
|
|
@@ -127,7 +131,7 @@ async function listenToProcessingState({
|
|
|
127
131
|
paymentState,
|
|
128
132
|
processing,
|
|
129
133
|
reasonCode,
|
|
130
|
-
reasonMessage
|
|
134
|
+
reasonMessage,
|
|
131
135
|
);
|
|
132
136
|
},
|
|
133
137
|
});
|
data/lib/spree_vpago/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_vpago
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.3.
|
|
4
|
+
version: 2.3.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- You
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|