Skip to content

Commit

Permalink
use the POST variables directly
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-cortizas-ponte committed Jun 9, 2022
1 parent d13b5d7 commit cdc85f3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plugin/buycourses/src/cecabank_response.php
Expand Up @@ -15,21 +15,19 @@
api_not_allowed(true);
}

$reference = $_POST['Num_operacion'];
$receivedAmount = (float) $_POST['Importe'];
$receivedSignature = $_POST['Firma'];

if (empty($reference) || empty($receivedAmount) || empty($receivedSignature)) {
if (empty($_POST['Num_operacion']) || empty($_POST['Firma']) || empty($receivedAmount)) {
api_not_allowed(true);
}

$signature = $plugin->getCecabankSignature($reference , $receivedAmount);
$signature = $plugin->getCecabankSignature($_POST['Num_operacion'] , $receivedAmount);

if($signature != $receivedSignature) {
if($signature != $_POST['Firma']) {
api_not_allowed(true);
}

$sale = $plugin->getSaleFromReference($reference);
$sale = $plugin->getSaleFromReference($_POST['Num_operacion']);

if (empty($sale) ) {
api_not_allowed(true);
Expand Down

0 comments on commit cdc85f3

Please sign in to comment.