Skip to content

Commit 6adaca7

Browse files
Version bump 4.2.1
* Fixed custom order status update * Version bump 4.2.1
1 parent 35dccc3 commit 6adaca7

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

Controller/Payment/Validate.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,20 @@ public function execute()
305305
($order->canInvoice() === false or
306306
$this->config->canAutoGenerateInvoice() === false))
307307
{
308+
// This ensures the custom status flow is maintained after payment authorization and capture
309+
$order->setState(static::STATUS_PROCESSING)->setStatus($this->orderStatus);
310+
308311
$orderLink->setRzpUpdateOrderCronStatus(OrderCronStatus::INVOICE_GENERATION_NOT_POSSIBLE);
309312

310313
$this->logger->info('Invoice generation not possible for id : '. $order->getIncrementId());
314+
}
315+
else if ($this->config->getPaymentAction() === \Razorpay\Magento\Model\PaymentMethod::ACTION_AUTHORIZE)
316+
{
317+
// For authorize-only payments, set the order status and state
318+
// This ensures the custom status flow is maintained after payment authorization
319+
$order->setState(static::STATUS_PROCESSING)->setStatus($this->orderStatus);
320+
321+
$this->logger->info('Order status updated for authorize-only payment for id: ' . $order->getIncrementId());
311322
}
312323
$orderLink->save();
313324
$order->save();

Model/Resolver/SetRzpPaymentDetailsForOrder.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
382382

383383
$this->invoiceSender->send($invoice);
384384

385+
$order->setState(static::STATUS_PROCESSING)->setStatus($this->orderStatus);
386+
385387
$order->addStatusHistoryComment(
386388
__('Notified customer about invoice #%1.', $invoice->getId())
387389
)->setIsCustomerNotified(true);
@@ -393,6 +395,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
393395
($order->canInvoice() === false or
394396
$this->config->canAutoGenerateInvoice() === false))
395397
{
398+
$order->setState(static::STATUS_PROCESSING)->setStatus($this->orderStatus);
396399
$orderLink->setRzpUpdateOrderCronStatus(OrderCronStatus::INVOICE_GENERATION_NOT_POSSIBLE);
397400
$this->logger->info('Invoice generation not possible for id : '. $order->getIncrementId());
398401
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "razorpay/magento",
33
"description": "Razorpay Magento 2.0 plugin for accepting payments.",
4-
"version": "4.2.0",
4+
"version": "4.2.1",
55
"require": {
66
"php": "7.*|^8.1",
77
"razorpay/razorpay": "2.*"

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Razorpay_Magento" setup_version="4.2.0">
3+
<module name="Razorpay_Magento" setup_version="4.2.1">
44
<sequence>
55
<module name="Magento_Sales" />
66
<module name="Magento_Payment" />

0 commit comments

Comments
 (0)