Skip to content

Commit 9865e5e

Browse files
Merge pull request #1311 from buckaroo-it/BP-4524-Capture-from-Plaza-not-working-for-Credit-Cards
BP-4524-Capture-from-Plaza-not-working-for-Credit-Cards
2 parents 7e50740 + 112b15e commit 9865e5e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Model/Push.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,30 @@ public function processSucceededPush($newStatus, $message)
14831483

14841484
$this->logging->addDebug(__METHOD__ . '|2|');
14851485

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+
14861510
if ($paymentMethod->canPushInvoice($this->postData)) {
14871511
$this->logging->addDebug(__METHOD__ . '|3|');
14881512
$description = 'Payment status : <strong>' . $message . "</strong><br/>";

0 commit comments

Comments
 (0)