Skip to content

Commit

Permalink
added capture message with trasnaction ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Ram Prakash Singh committed Dec 8, 2020
1 parent 7940fbf commit cc1b7ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Controller/Payment/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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.*"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Razorpay_Magento" setup_version="beta-3.3.1">
<module name="Razorpay_Magento" setup_version="beta-3.3.2">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down

0 comments on commit cc1b7ab

Please sign in to comment.