The Server Integration Method (SIM) allows you to offload the payment experience to Authorize.Net. The AuthorizeNetSIM_Form class helps automate the creation of the hidden form fields required to securely initiate a transaction.
To create a 'Buy Now' button that redirects users to a hosted order page, you must generate a fingerprint using getFingerprint and then instantiate AuthorizeNetSIM_Form with the required transaction parameters. This ensures the request is authenticated and tied to a specific amount and sequence.
<form method="post" action="https://test.authorize.net/gateway/transact.dll">
<?php
$amount = "9.99";
$fp_sequence = "123";
$time = time();
$fingerprint = AuthorizeNetSIM_Form::getFingerprint($api_login_id, $transaction_key, $amount, $fp_sequence, $time);
$sim = new AuthorizeNetSIM_Form(
array(
'x_amount' => $amount,
'x_fp_sequence' => $fp_sequence,
'x_fp_hash' => $fingerprint,
'x_fp_timestamp' => $time,
'x_relay_response'=> "FALSE",
'x_login' => $api_login_id,
)
);
echo $sim->getHiddenFieldString();?>
<input type="submit" value="Buy Now">
</form>