Skip to content

Commit

Permalink
Check if quote increment id has same value that Ds_Order in Redsys ca…
Browse files Browse the repository at this point in the history
…llback
  • Loading branch information
oriolauge committed May 25, 2022
1 parent 148b6d5 commit 0102bdb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Controller/Callback/Processpayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ public function execute()
return $this->returnJsonError('Quote not found');
}

/**
* We don't know if quote was loaded by increment id or quote_id, so we
* will check if current increment id is the same that Redsys
* send to our system
*/
if ($quote->getReservedOrderId() != $merchantParameters['Ds_Order']) {
return $this->returnJsonError('Quote Increment Id is not the same');
}

if (empty($merchantParameters['Ds_Amount']) ||
$this->totalAmount->execute($quote) != $merchantParameters['Ds_Amount']) {
return $this->returnJsonError('Quote amount is not the same');
Expand Down

0 comments on commit 0102bdb

Please sign in to comment.