πPostback Security
You should verify the signature received in the postback to ensure that the call comes from our servers.
Signature parameter should match MD5 of user_id transaction_id payout secret_key. You can find your secret in your placement page.
Postback Examples (GET):
<?php
$secret = "SECRET_KEY"; // Get your secret from placement settings
$user_id = isset($_GET['user_id']) ? $_GET['user_id'] : null;
$transaction_id = isset($_GET['transaction_id']) ? $_GET['transaction_id'] : null;
$payout = isset($_GET['payout']) ? $_GET['payout'] : null;
$signature = isset($_GET['signature']) ? $_GET['signature'] : null;
// Validate Signature
if(md5($user_id . $transaction_id . $payout . $secret) != $signature)
{
echo "ERROR: Signature doesn't match";
return;
}
// Further processing can be done here
echo "Signature is valid. Process the postback.";
?>from flask import Flask, request, jsonify
import hashlib
app = Flask(__name__)
secret = "SECRET_KEY" # Get your secret from placement settings
@app.route('/postback', methods=['GET'])
def postback():
user_id = request.args.get('user_id')
transaction_id = request.args.get('transaction_id')
payout = request.args.get('payout')
signature = request.args.get('signature')
# Validate Signature
if hashlib.md5((user_id + transaction_id + payout + secret).encode()).hexdigest() != signature:
return "ERROR: Signature doesn't match", 400
# Further processing can be done here
return "Signature is valid. Process the postback."
if __name__ == '__main__':
app.run()Donβt forget to check the transaction_id against your database to ensure it doesnβt already exist.
Status Code
Please return status code 200, if you have successfully processed the postback.
Whitelisting
In order to ensure the integrity of the postbacks, you can whitelist our server IP. Postbacks are exclusively sent from this IP address:
Last updated