Reply
Highlighted
Member
Posts: 8
Registered: ‎04-15-2013
Accepted Solution

SIM Integration with different amounts

I want to use the SIM integration for handling payments through one part of my website. This integration has to handle payments for events, which each have a different and unique price. The "Golf"-event could cost $65, while the "Annual Business Meeting" would only cost $10. How would I handle different amounts that is easy for my client to handle himself (i.e. through a panel or the backend of Authorize.Net)?

Because it seems like there's no way of doing this by looking at the Quick Start Guide using PHP (https://developer.authorize.net/integration/fifteenminutes/#hosted):

<?php
require_once 'anet_php_sdk/AuthorizeNet.php'; // Include the SDK you downloaded in Step 2
$api_login_id = 'YOUR_API_LOGIN_ID';
$transaction_key = 'YOUR_TRANSACTION_KEY';
$amount = "5.99";
$fp_timestamp = time();
$fp_sequence = "123" . time(); // Enter 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>

 

I really need your help. I've been trying to figure this out for ages now.

 

Thanks in advance,


Frederick Andersen

 


Accepted Solutions
Highlighted
Solution
Accepted by topic author FredrixDesign
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: SIM Integration with different amounts

Couldn't you pass the $ amount from another page? or use multiple checkout page? or if else statement?

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author FredrixDesign
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: SIM Integration with different amounts

Couldn't you pass the $ amount from another page? or use multiple checkout page? or if else statement?

Highlighted
Member
Posts: 8
Registered: ‎04-15-2013

Re: SIM Integration with different amounts

How would you setup multiple checkout pages easily? It would probably would be the smartest solution, because the client has to be able to create an event in WordPress and through a custom field link to the SIM payment gateway.

 

You have any ideas?

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: SIM Integration with different amounts

Sorry, I don't work with php.

Highlighted
Member
Posts: 8
Registered: ‎04-15-2013

Re: SIM Integration with different amounts

Would you be able to accomplish it using JavaScript?

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: SIM Integration with different amounts

Not with just javascript because it need the x_fp_hash which required the transactionKey. And you do NOT want it get out.

Highlighted
Member
Posts: 8
Registered: ‎04-15-2013

Re: SIM Integration with different amounts

Is there anyway at all you could help me with the necessary code? I really need help. I'm getting very frustrated, because I'm not able to myself.

Thanks for the reponses so far, Raynor!

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: SIM Integration with different amounts

Highlighted
Member
Posts: 4
Registered: ‎05-24-2013

Re: SIM Integration with different amounts

On your local checkout page, calculate the amount you want to submit:

<?php

    $totalcost = round($subtotal + $taxcost + $shipping,2);

?>

 

Then pass that variable over to the AuthorizeNET form:

<?php

  $totalcost = round($subtotal + $taxcost + $shipping,2);

  $amount = $totalcost;

?>