<?php
if(isset($_POST['amount']))
{
$company = $_POST["company"];
$invoice = $_POST["invoice"];
$subject = "New Payment";
$recipient = "
[email protected]";
$message = "Message from $company with Invoice # $invoice";
mail($recipient, $subject, $message);
// *********** Payment
$x_amount = $_POST['amount'];
$x_login = "don't post sensitive information"; // Take from Payment Page ID in Payment Pages interface
$transaction_key = "on a public forum"; // Take from Payment Pages configuration interface
$x_currency_code = "CAD"; // Needs to agree with the currency of the payment page
srand(time()); // initialize random generator for x_fp_sequence
$x_fp_sequence = rand(1000, 100000) + 123456;
$x_fp_timestamp = time(); // needs to be in UTC. Make sure webserver produces UTC
// The values that contribute to x_fp_hash
$hmac_data = $x_login . "^" . $x_fp_sequence . "^" . $x_fp_timestamp . "^" . $x_amount . "^" . $x_currency_code;
$x_fp_hash = hash_hmac('MD5', $hmac_data, $transaction_key);
$values = array('login' => $x_login, 'amount' => $x_amount, 'sequence' => $x_fp_sequence, 'timestamp' => $x_fp_timestamp, 'hash' => $x_fp_hash, 'currency' => $x_currency_code, 'company' => $company);
echo json_encode($values);
die;
}
?>
Hello,
I am having a bit of trouble in setting up a payment page. I am trying to do two things here.
The form has three fields - Company, Invoice, and Amount.
When the submit button is clicked, the action should take me to a payment page. This part works great.
However, I am trying to _POST the other two fields - Company and Invoice - so I can have this information emailed to myself once the client clicks "pay".
RIght now, when the button is clicked, it sends me to the payment page (good), and then the email also gets sent (which is also good). However, the email message doesn't work - it only shows the text without the variables.
Like: Message from with Invoice #
Without either variable posting through
Is something like this possible? Or am I doing it completely wrong?
Any help would be appreciated!
Justin