Skip to content

Commit

Permalink
Merge pull request #175 from razorpay/fixed_duplicate_order_version_b…
Browse files Browse the repository at this point in the history
…ump_2.9.3

SI-1187: fixed issue related with webhook processing duplicate order
  • Loading branch information
ramth05 authored May 18, 2020
2 parents 9704bd9 + ec5da0b commit acfb0bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Controller/Payment/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ protected function orderPaid(array $post)

$this->logger->warning("Razorpay Webhook processing started for Razorpay payment_id(:$paymentId)");

$payment_created_time = $post['payload']['payment']['entity']['created_at'];

//added check that webhook should not executed, during front end payment processing
if((time() - $payment_created_time) < 10)
{
$this->logger->warning("Razorpay Webhook: Order processing is active for quoteID: $quoteId and Razorpay payment_id(:$paymentId)");
header('Status: 409 Conflict, too early for processing', true, 409);
exit;
}

//validate if the quote Order is still active
$quote = $this->quoteRepository->get($quoteId);

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": "2.9.2",
"version": "2.9.3",
"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="2.9.2">
<module name="Razorpay_Magento" setup_version="2.9.3">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down

1 comment on commit acfb0bb

@iambaljitdhanoa
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello

We are using magento 2.3.5p1 as well as used razorpay extension but my payment in razorpay dashboard authorized not captured please help me

Please sign in to comment.