I have currently set up sitlent post back url. I have updated my script to include emails to know when the post back happens. I'm getting successful emails indicating authorize is posting back.
However, the issue, i'm getting is that the POST is empty.
The one issue that could be causing this is that i have a query parameter in the url:
https://mydomain.com/recurring.php?member=1
Would that cause an issue?
Here is a sample script that i have:
<?php
$admin_cnxn = mysql_connect ('localhost', 'test', 'test');
$church_cnxn = $admin_cnxn;
$admin_db = mysql_select_db ('churchdb_admin');
require_once ('../admin/includes/wcc_functions.php');
$church_dir = $_GET['church'];
$sql = 'SELECT * FROM churches WHERE Directory = ' . GetSQLValueString($church_dir, 'text');
$church_query = mysql_query($sql, $admin_cnxn);
// get the raw POST data
$rawData = file_get_contents("php://input");
$to = 'test@test.com';
$subject = 'Authorize Recurring' . (!empty($church_dir) ? ' - ' . $church_dir : 'No Church');
$message = ' Data:' . ($rawData);
$message .= ' Get: ';
foreach ($_GET as $key => $value) {
$message .= $key . ' -> ' . $value . '<br>';
}
$message .= ' POST: ';
foreach ($_POST as $key => $value) {
$message .= $key . ' -> ' . $value . '<br>';
}
$message .= ' REQUEST: ';
foreach ($_REQUEST as $key => $value) {
$message .= $key . ' -> ' . $value . '<br>';
}
$headers = 'From: no-reply@test.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject . " Initial", $message, $headers);
if(!empty($church_query) && mysql_num_rows($church_query) > 0) {
$church = mysql_fetch_assoc($church_query);
mail($to, $subject . " Before - Church " . $church['Name'], 'Church Found', $headers);
if(mysql_select_db($church['DBName']) && !empty($_REQUEST)) {
mail($to, $subject . " Church - Selected " . $church['Name'], 'Church Found', $headers);
$subscription_id = (int) $_POST['x_subscription_id'];
if(!empty($subscription_id)) {
mail($to, $subject . $church['Name'], "Subscription Id" . $subscription_id, $headers);
$response_code = (int) $_POST['x_response_code'];
$reason_code = (int) $_POST['x_response_reason_code'];
if ($response_code == 1) {
$authorization_code = $_POST['x_auth_code'];
$transaction_id = $_POST['x_trans_id'];
$customer_id = $_POST['x_cust_id'];
$previous_donation = mysql_query('SELECT * FROM donation_recurrings WHERE RecurringCancelled = 0 AND MemberId = ' . GetSQLValueString($customer_id, 'text') . ' AND RecurID = ' . GetSQLValueString($subscription_id, 'text'));
if(!empty($previous_donation) && mysql_num_rows($previous_donation) > 0) {
$prev_donation = mysql_fetch_assoc($previous_donation);
mail($to, $subject . $church['Name'], 'Previous Donation ' . $subscription_id . ' ' . $previous_donation, $headers);
}
if(!empty($prev_donation)) {
mail($to, $subject . $church['Name'], "After " . $add_donation . " - " . $subscription_id . ' - ' . $previous_donation . ' ' . $sql, $headers);
}
}
else {
}
}
}
}
?>
Your help is appreciated.
12-11-2013 11:49 PM - edited 12-11-2013 11:56 PM
I'm afraid that I don't have a real answer for you. I can confirm that the query string won't affect post data, I set up a quick test myself just to doublecheck., but I can't tell you why your script isn't capturing any data.
12-16-2013 03:10 PM
Do you happen to have SNI - SSL?
That would be a known bug, if so. Thats the only reason I can think why POST is empty. Since the request never comes at all.
12-26-2013 01:29 PM
If this is a known bug, are you faimilar with any work around this issue?
Thanks.
01-18-2014 03:25 PM