Skip to content

Commit

Permalink
Merge pull request #2 from razorpay/master-2.x
Browse files Browse the repository at this point in the history
Sync with parent repo.
  • Loading branch information
ankurvr authored Jun 13, 2020
2 parents 93c3e14 + acfb0bb commit 03fc65e
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

0 comments on commit 03fc65e

Please sign in to comment.