From cc1b7ab2aedaad0f98f2ef190b8bcecd2102d81a Mon Sep 17 00:00:00 2001 From: Ram Prakash Singh Date: Tue, 8 Dec 2020 16:31:51 +0530 Subject: [PATCH] added capture message with trasnaction ID --- Controller/Payment/Validate.php | 9 ++++++++- composer.json | 2 +- etc/module.xml | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Controller/Payment/Validate.php b/Controller/Payment/Validate.php index b270fbf9..309d05b7 100644 --- a/Controller/Payment/Validate.php +++ b/Controller/Payment/Validate.php @@ -11,6 +11,7 @@ use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Sales\Api\OrderRepositoryInterface; +use Magento\Sales\Model\Order\Payment\State\CaptureCommand; class Validate extends \Razorpay\Magento\Controller\BaseController implements CsrfAwareActionInterface { @@ -149,12 +150,18 @@ public function execute() $payment->setParentTransactionId($payment->getTransactionId()); $payment->addTransactionCommentsToOrder( - $paymentId, + "$paymentId", + (new CaptureCommand())->execute( + $payment, + $order->getGrandTotal(), + $order + ), "" ); $transaction = $payment->addTransaction(\Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH, null, true, ""); $transaction->setIsClosed(true); + $transaction->save(); $order->save(); diff --git a/composer.json b/composer.json index 7d086191..2fdc5af0 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "razorpay/magento", "description": "Razorpay Magento 2.0 plugin for accepting payments.", - "version": "beta-3.3.1", + "version": "beta-3.3.2", "require": { "php": "~5.5.0|~5.6.0|^7.0", "razorpay/razorpay": "2.*" diff --git a/etc/module.xml b/etc/module.xml index e86990a5..f82d5c60 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +