File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1483,6 +1483,30 @@ public function processSucceededPush($newStatus, $message)
1483
1483
1484
1484
$ this ->logging ->addDebug (__METHOD__ . '|2| ' );
1485
1485
1486
+ // Check if this is a capture transaction (C800) that should create an invoice
1487
+ $ isCapture = isset ($ this ->postData ['brq_transaction_type ' ]) && $ this ->postData ['brq_transaction_type ' ] === 'C800 ' ;
1488
+ $ isCaptureMutation = isset ($ this ->postData ['brq_mutationtype ' ]) && strtolower ($ this ->postData ['brq_mutationtype ' ]) === 'collecting ' ;
1489
+
1490
+ if ($ isCapture || $ isCaptureMutation ) {
1491
+ $ this ->logging ->addDebug (__METHOD__ . '|CAPTURE_DETECTED| ' . var_export ([
1492
+ 'brq_transaction_type ' => $ this ->postData ['brq_transaction_type ' ] ?? 'not_set ' ,
1493
+ 'brq_mutationtype ' => $ this ->postData ['brq_mutationtype ' ] ?? 'not_set '
1494
+ ], true ));
1495
+
1496
+ // Force invoice creation for capture transactions
1497
+ $ description = 'Capture status : <strong> ' . $ message . "</strong><br/> " ;
1498
+ $ description .= 'Total amount of ' . $ this ->order ->getBaseCurrency ()->formatTxt ($ amount ) . ' has been captured. ' ;
1499
+
1500
+ if (!$ this ->saveInvoice ()) {
1501
+ $ this ->logging ->addDebug (__METHOD__ . '|CAPTURE_INVOICE_FAILED| ' );
1502
+ return false ;
1503
+ }
1504
+
1505
+ $ this ->updateOrderStatus ($ state , $ newStatus , $ description , $ forceState );
1506
+ $ this ->logging ->addDebug (__METHOD__ . '|CAPTURE_COMPLETE| ' );
1507
+ return true ;
1508
+ }
1509
+
1486
1510
if ($ paymentMethod ->canPushInvoice ($ this ->postData )) {
1487
1511
$ this ->logging ->addDebug (__METHOD__ . '|3| ' );
1488
1512
$ description = 'Payment status : <strong> ' . $ message . "</strong><br/> " ;
You can’t perform that action at this time.
0 commit comments