cancel
Showing results for 
Search instead for 
Did you mean: 

Solution for bill payments (variable amounts)

I am trying to figure out which solution (Simple Checkout, SIM or AIM) to use for my company which wants to allow its customers to pay their bills online. The amounts are variable and can change from customer to customer and from month to month. Simple Checkout would be ideal as there is only one item and we don't want to store any credit card or customer information. In fact, the donation feature is the perfect solution except on the payment screen the amount field is titled "Donation Amount" and it would be confusing to our customers to use this. Even though it's more robust than what we need I'm thinking that SIM is the best solution. I've read through a lot of information but I can't tell for sure if it meets our needs or not. We just want the customer to be able to enter their name, address, customer number, invoice number, payment amount and, of course, their credit card information. Is SIM the best way to do this? If so, then do I need to look for a shopping cart as well to handle the bill payment input? Is anyone else processing variable bill payments and if so what shopping cart and/or authorize.net solution (Simple Checkout, SIM or AIM) solution are you using?

 

Thanks in advance for any help or suggestions ...

skielly
Member
11 REPLIES 11

For what you need to do SIM will work perfectly fine. If you find you want more customization then SIM offers then use AIM.


-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post
stymiee
Expert
Expert

I'm interested in the same thing. We need to process payments from client invoices that vary. I'd like the end-user to be able to type in their invoice number, and the amount they're going to pay on the invoice.

 

I've used the SIM integration sample script from the developer section.

 

Everything works with amounts hard coded in the sample ie:  $amount              = "23.99";

 

I changed the 'hidden' input under the form post to text. When I don't change the amount displayed, and 'post' to the secure payment page, it works correctly, and the invoice amount is 23.99. If I change the 'default value' from what is hard coded in the $amount section, I get a (99) error.

 

It appears its trying to check the x_amount against the $amount, and when it doesn't match, it generates the error.

 

I'm a php noob, and I've dug around to see if I can solve this, but I can't seem to find any solution. Can I make the $amount an 'end user input variable'?

You can. You just need to recalculate the hash after the amount is provided. There are sample forms in this community that show you how to do this. A quick search should pull them up.


-------------------------------------------------------------------------------------------------------------------------------------------
John Conde :: Certified Authorize.Net Developer (Brainyminds) :: Official Authorize.Net Blogger

NEW! Handling Authorize.Net's Webhooks with PHP

Integrate Every Authorize.Net JSON API with One PHP Class (Sample code included)

Tutorials for integrating Authorize.Net with PHP: AIM, ARB, CIM, Silent Post
All About Authorize.Net's Silent Post
 

I am also looking for sample code to allow for variable amounts for a physician office. Can anyone help push me in the right direction to find a solution? This is all new to me and I'm very lost.

 

Thanks!

RicOrdea
Member

Instead of just one form that submits to Authorize.net, you have two forms. The first is just about the amount they're paying, either with them putting in the amount themselves, and/or putting in an invoice number and some other verification info. That submits to the second, which displays the amount they're going to be paying, inserts that value internally as well, and the rest of the form is just like your regular DPM integration. Basically, by the time you get to the second form, you know the amount, therefore the hash will match up correctly.

 

EDIT: Oh wait, this is SIM. Well, in the case of SIM, it's the same case, except the second form has everything hidden and auto-submits using something like:

 

body onload="document.forms.myformname.submit();">

 

Thanks TJ!

I understand what you are saying but have no idea how to make it work! I am extremely unexperienced with php and can't figure this out for the life of me. If I start wtih the following SIM sample code, how can I make the payment able to be input by the paying customer?

 

I basically only need to collect name, address, phone, email, patient name, patient account number, payment amount, and CC info. Please help! I have no idea what I am doing!!!

 

<?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>

 

 

Here is a -very- basic form for the first part of the payment process:

 

<form method="post" action="payment2.php">
Amount: $<input type="text" name="amount" size="6" maxlength="8"><br>
<input type="submit" value="Make Payment">
</form>

The Authorize.net code you pasted would go on payment2.php, and you'd reference the value the user put in on payment1.php using:

 

$amount = $_POST['amount'];

Obviously, you should validate this to make sure it falls into an acceptable range - you don't want people paying you 10 cents or $50,000.

 

To make the form on payment2.php autosubmit, name the form something, and then add that code I gave you to the <body...> tag in your page header:

 

<html>
<head>
<title>My page title</title>
</head>
<body onload="document.forms.myformname.submit();">

What this does is tell the form to submit automatically without them having to press anything. So as far as the user is concerned, as long as they enter a valid amount on the first part, it will seem like they're going straight to Authorize.net from that form - even though there's an invisible intermediate step to deal with the variable amount.

 

Honestly, if you still can't figure it out from here, you're probably better off hiring one of the certified developers for an hour or so to implement for you. Or anyone reasonably good with PHP.

Awesome! Thanks for the quick reply. I wil do my best. If I am not able to figure it out, is there a list of certified developers somewhere I can look at potentially hiring to help out?