File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
app/code/Magento/Sales/Model/Service Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -163,12 +163,6 @@ public function refund(
163
163
$ connection = $ this ->getResource ()->getConnection ('sales ' );
164
164
$ connection ->beginTransaction ();
165
165
try {
166
- $ order = $ this ->getRefundAdapter ()->refund (
167
- $ creditmemo ,
168
- $ creditmemo ->getOrder (),
169
- !$ offlineRequested
170
- );
171
- $ this ->getOrderRepository ()->save ($ order );
172
166
$ invoice = $ creditmemo ->getInvoice ();
173
167
if ($ invoice && !$ offlineRequested ) {
174
168
$ invoice ->setIsUsedForRefund (true );
@@ -178,6 +172,12 @@ public function refund(
178
172
$ creditmemo ->setInvoiceId ($ invoice ->getId ());
179
173
$ this ->getInvoiceRepository ()->save ($ creditmemo ->getInvoice ());
180
174
}
175
+ $ order = $ this ->getRefundAdapter ()->refund (
176
+ $ creditmemo ,
177
+ $ creditmemo ->getOrder (),
178
+ !$ offlineRequested
179
+ );
180
+ $ this ->getOrderRepository ()->save ($ order );
181
181
$ this ->creditmemoRepository ->save ($ creditmemo );
182
182
$ connection ->commit ();
183
183
} catch (\Exception $ e ) {
You can’t perform that action at this time.
0 commit comments