Commit 57bb766
authored
Add early returns when processing already created order when returning from PayPal to Sylius (#372)
| Q | A
| --------------- | -----
| Branch? | 1.7
| Bug fix? | yes
| New feature? | no
| Related tickets |
This PR introduces early return conditions in the checkout flow to
handle a specific edge case involving PayPal payments:
When a customer starts a PayPal payment and then returns to Sylius in a
different browser tab, they may complete the checkout again, either by
going through the entire process or by paying again via PayPal. If they
then switch back to the original tab (where the PayPal flow was first
initiated) and try to complete the order again, it may result in errors
because the order is already completed.
To prevent this, we now short-circuit the flow with early returns if the
order has already been placed and there is no payment in the `cart`
state, ensuring the customer cannot proceed further in such cases.1 file changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
| |||
144 | 154 | | |
145 | 155 | | |
146 | 156 | | |
147 | | - | |
| 157 | + | |
148 | 158 | | |
149 | 159 | | |
150 | 160 | | |
151 | 161 | | |
152 | 162 | | |
153 | | - | |
| 163 | + | |
154 | 164 | | |
155 | 165 | | |
156 | 166 | | |
| |||
0 commit comments