cancel
Showing results for 
Search instead for 
Did you mean: 

Using SIM for a basic payment system

Hi all,

 

I modified the basic code sample for the SIM to submit payments through an html form post to https://secure.authorize.net/gateway/transact.dll

 

The problem I'm having is prior to making the form page that submits to https://secure.authorize.net/gateway/transact.dll, you must already have the fingerprint hash code made, but the fingerprint hash code is partially based on the amount for the transaction, but the amount isn't known until after the user fills out the form.

 

The only thing I can think of is having Page A with a form asking for the amount, then it goes to Page B (which grabs the amount from Page A), then Page B can make the fingerprint hash code, and create the final form which will pass on the rest of the info (billing, cc info, fingerprint hash, amount, etc) to https://secure.authorize.net/gateway/transact.dll

 

The above example I've coded out, and it works fine, but the client wants it to start from Page B. It's for a doctor's office where the patient can go to the form, input their doctor's name, invoice number, amount owed, etc. Hence the reason for having the amount specified by the user.

 

Anyone know a workaround, or better way to do this?

stefanhinote
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Have everything entered on page A. Page B will then generate the form entirely as hidden form fields, including the fingerprint, then auto-submit on page load. Just add this in your body tag:

 

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

 

View solution in original post

TJPride
Expert
2 REPLIES 2

Have everything entered on page A. Page B will then generate the form entirely as hidden form fields, including the fingerprint, then auto-submit on page load. Just add this in your body tag:

 

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

 

TJPride
Expert

I never knew of a good way to auto submit a form, aside from server side.

 

This is perfect, and simple, Thank you!