Предположим, что у меня есть форма Authorize.net открыл всплывающее окно этой формы:Authorize.net получить ответ от метода интеграции сервера
<?php
$api_login_id = 'YOUR_API_LOGIN_ID';
$transaction_key = 'YOUR_TRANSACTION_KEY';
$amount = "5.99";
$fp_timestamp = time();
$fp_sequence = "123" . time(); // Can be changed to an invoice or other unique number.
$fingerprint = AuthorizeNetSIM_Form::getFingerprint($api_login_id, $transaction_key,
$amount, $fp_sequence, $fp_timestamp);
?>
<form method='post' action="https://test.authorize.net/gateway/transact.dll">
<input type='hidden' name="x_login" value="<?php echo $api_login_id?>" />
<input type='hidden' name="x_fp_hash" value="<?php echo $fingerprint?>" />
<input type='hidden' name="x_amount" value="<?php echo $amount?>" />
<input type='hidden' name="x_fp_timestamp" value="<?php echo $fp_timestamp?>" />
<input type='hidden' name="x_fp_sequence" value="<?php echo $fp_sequence?>" />
<input type='hidden' name="x_version" value="3.1" />
<input type='hidden' name="x_show_form" value="payment_form" />
<input type='hidden' name="x_test_request" value="false" />
<input type='hidden' name="x_method" value="cc" />
<input type='submit' value="Click here for the secure payment form" />
</form>
После клиент Заполнив форму, а оплата будет завершена, как я получаю ответ от формы, чтобы я мог проверить, завершена ли оплата? Что-то вроде:
if ($response->approved) {
echo "Success! Transaction ID:" . $response->transaction_id;
} else {
echo "ERROR:" . $response->error_message;
}