Thema: Postback
Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 02-08-2022, 14:38
mad1969
 Registrierter Benutzer
Links : Onlinestatus : mad1969 ist offline
Registriert seit: Aug 2022
Beiträge: 1
mad1969 befindet sich auf einem aufstrebenden Ast
Exclamation Postback

Das Postback läuft leider nicht, ich bekomme immer diese Fehlermeldung:

Failed Postback URL: https://meine domain.de/system/gateways/lootably.php/api/postback/lootably?userID=%7BUSER_ID%7D&ip=170.133.5.206&offerName=Loot.tv%20-%20Withdraw&siteRevenue=0.42&userCut=23100&hash=2ac71074ba605f78da56105037d1d4d5372030a7e4d1dca03ac9 b3ef7144f1be&transactionID=cl6bnh1d1006401yrc7bs6wk8&offerID=101-1&sid2=".
Sent At: 2022-08-02T04:04:16Z

We got this response from your server: "ERROR: Signature doesn't match"

Our system expects a response body of "1" for a successful postback and "0" in the event of an error.

Wo liegt der Fehler

<?php
define('BASEPATH', true);
require('../init.php');


// Security Check
$secret = $db->QueryFetchArray("SELECT config_value FROM `offerwall_config` WHERE `config_name`='lootably_hash'");
$secret = $secret['config_value'];

// Get postback
$userId = $db->EscapeString($_REQUEST['user_id']);
$ip = $db->EscapeString($_REQUEST['ip']);
$offer_name = $db->EscapeString(urldecode($_GET["offer_name"]));
$siteRevenue = $db->EscapeString(urldecode($_GET["revenue"]));
$userCut = $db->EscapeString(urldecode($_GET["currencyReward"]));
$hash = $db->EscapeString(urldecode($_GET["hash"]));
$transaction_id = $db->EscapeString($_REQUEST['transaction_id']);
$offer_id = $db->EscapeString(urldecode($_GET["offer_id"]));
$numericoffer_id = $db->EscapeString(urldecode($_GET["numericoffer_id"]));
$sid2 = $db->EscapeString($_REQUEST['sid2']);
$country = $db->EscapeString($_REQUEST['country']);
$payout = $db->EscapeString($_REQUEST['payout']);


// validate signature
if ($_REQUEST['hash'] != $secret){
echo "ERROR: Signature doesn't match";
return;
}

// validate signature
if(!(is_numeric($app_id) && is_numeric($reward) && is_numeric($campaign_id) && is_numeric($payout)))
{
echo "ERROR: Invalid user";
return;
}

if(!empty($userId) && $db->QueryGetNumRows("SELECT * FROM `completed_offers` WHERE `survey_id`='".$transaction."' AND `user_id`='".$subid."' LIMIT 1") == 0)
{
$user = $db->QueryFetchArray("SELECT `id` FROM `users` WHERE `id`='".$userId."' LIMIT 1");

if(!empty($user['id'])) {
$tc_points = (0.10*($amount*100));
$tc_points = ($tc_points < 1 ? 1 : number_format($tc_points, 0));
$db->Query("UPDATE `users` SET `ow_credits`=`ow_credits`+'".$reward."', `tasks_contest`=`tasks_contest`+'".$tc_points."' WHERE `id`='".$user['id']."'");
$db->Query("INSERT INTO `users_offers` (`uid`,`total_offers`,`total_revenue`,`last_offer`) VALUES ('".$user['id']."','1','".$reward."','".time()."') ON DUPLICATE KEY UPDATE `total_offers`=`total_offers`+'1', `total_revenue`=`total_revenue`+'".$reward."', `last_offer`='".time()."'");
$db->Query("INSERT INTO `completed_offers` (`user_id`,`survey_id`,`user_country`,`user_ip`,`revenue`,`reward`,`method`,`timestamp`) VALUES ('".$user['id']."','".$transaction."','".$country."','".$ip."','".$payout."','".$reward."','lootably','".time()."') ");
}

echo "OK";
}
?>
Mit Zitat antworten