Custom code for payment system
Author: Andy G.
Visited 3838,
Followers 4,
Shared 0
Hi guys,
I really need some help on this one.
It’s in regards to the custom code for the shopping cart.
I’m told the Authorize.net merchant account system can be altered to make the entire purchase go through as one singular item. This is using their simple check out. My client has provided me with this code:
- <form name="PrePage" method = "post" action = "https://Simplecheckout.authorize.net/payment/CatalogPayment.aspx"> <input type = "hidden" name = "LinkId" value ="be6f38dc-3cbc-4585-89dd-1e4022d7ec2e" /> <input type = "hidden" name = "amount" value ="[PRICE]" /> <input type = "hidden" name = "order" value ="[ORDER_NO]" /> <input type = "submit" value = "PAY NOW" /> </form>
I don’t really get how this Authorize.net system works and despite my best efforts I am rather lost.
You guys have been immensely helpful in the past and I fully appreciate this is a big ask on my part. Any help would be very appreciated.
Posted on the
The same theme is also here
https://helpcenter.websitex5.com/post/133510
treated
Eg. Amount has the wrong format
Regards JJ.
Hello Andy,
We can help you with this but you'll need to help us first by providing some more information:
Is your client Joe Debellis? The LinkID's are exactly the same (https://helpcenter.websitex5.com/post/133510). If so then I will close that thread. It gets very confusing discussing the same topic on more than one thread.
Did your client get this code directly from Authorize.net?
Can you please forward the Simple Checkout documentation that was requested in your previous thread? (https://helpcenter.websitex5.com/post/132965)
Unfortunately we will not be able to assist further without knowledge of the nuts and bolts of how Simple Checkout operates: it's not possible for us to view the help files without an account. Once we have the Simple Checkout documentation (as opposed to the full-blown API documentation) then we should be able to advise you on the correct code to use for the checkout.
It's necessary to replace this line:
<input type = "hidden" name = "LinkId" value ="be6f38dc-3cbc-4585-89dd-1e4022d7ec2e" />
...with one which represents the entire order [ORDER_NO] - but other changes will be needed too... we really need to see the official help file.
Many thanks,
Paul
After a lot of searching I've managed to locate the following document on Authorize.net's Server Integration Method, which allows you to use a hosted payment form.
The guide offers sample code and a detailed description of the payment form fields.
In particular, it appears that [ORDER_NO] and [PRICE] could be passed to x_invoice_num and x_amount respectively.
Here is the link to the Developer Guide:
http://www.authorize.net/content/dam/authorize/documents/SIM_guide.pdf
Author
Hi Paul,
Thanks for the reply.
Yes Joe is my client. I didn't realise he was talking to you as well.
I have had a look at that documentation but it doesn't seem to explain how to get simple checkout working in a way that puts the entire order through as one singular payment. It doesn't appear able to transfer the final price from website x5 to the authorise.net payment gateway.
Author
Oh, yes he did get the code directly from authorise.net
The document doesn't relate to Simple Checkout, but it's not the full-blown API either. It describes using the Server Integration Method which allows you to create a button which sends the customer to a secure site hosted by Authorize.net. Once in the secure hosted area your customer can provide their credit card details, etc., and you as the webmaster are not liable for the PCI compliance side of things.
You pass the variables from WebSite X5 to Authorize.net using hidden fields in the form, as per the example in the guide:
<INPUT TYPE=HIDDEN NAME=”x_name_of_field” VALUE=”value of the field”>
WebSite X5 provides the final price in the form of the variable [PRICE] which you then pass as a VALUE to Authorize.net in the manner described above.
You can customise the look and feel of the hosted payment form, including which fields are incorporated, by following the instructions in the Developer Guide.
Author
Hi Paul,
Thanks again for the reply.
This option would still leave us in the position of having to enter the total amount of the order manually.
x_amount Value: The amount of the transaction.
for example: <INPUT TYPE=HIDDEN NAME="x_amount" VALUE="9.95">
The problem being is we dont know what the customer is purchasing and what the total amount would be. We only know it will not always be the same value so adding a paymenyt option for $9.95 Isn't helpful. Is there a way to transfer the total amount of the customers orders from the total field in X5?
X5 does total the amount before you get to choose the payment option (see attached).
"cc" is the authorize.net payment option i am testing.
Cheers Paul.
Yes, as I explained in my previous post:
i.e. <INPUT TYPE=HIDDEN NAME="x_amount" VALUE="[PRICE]">
[PRICE] is a variable. It is a dynamic value which will change with each order. You don't need to enter the total amount of the order manually: you let WebSite X5 do the work by passing the variable to Authorize.net.
Author
Oh i see,
Awesome. I'll giver this a try.
Thanks again Paul.
Author
I have written this using their documentation but it's not working.
<!--#INCLUDE FILE=”simlib.asp”-->
<FORM METHOD=POST ACTION= "https://secure.authorize.net/gateway/transact.dll">
<% ret = InsertFP (APIloginid, sequence, amount, txnkey) %>
<INPUT TYPE=HIDDEN NAME="x_version" VALUE="3.1">
<INPUT TYPE=HIDDEN NAME="x_login" VALUE="removed for this post">
<INPUT TYPE=HIDDEN NAME="x_show_form" VALUE="PAYMENT_FORM">
<INPUT TYPE=HIDDEN NAME="x_method" VALUE="CC">
<INPUT TYPE=HIDDEN NAME="x_amount" VALUE="[PRICE]">
<INPUT TYPE=SUBMIT VALUE="Click here for the secure payment form">
</FORM>
I've taken it directly from the authorise.net documentation and added your price code. Any ideas?
Author
I think the problem is with this line
<% ret = InsertFP (APIloginid, sequence, amount, txnkey) %>
But in the documentation it doesn't explain what this should be or how to replace it correctly. :/
The values in brackets look like parameters for the function InsertFP, which presumably is part of the simlib.asp file referred to in the line above. You will need to approach Authorize.net for appropriate support here, as unfortunately I have no way of knowing what's in that file. It will probably be necessary to include that file before posting the values from the form, just like the HTML comment infers:
<!--#INCLUDE FILE=”simlib.asp”-->
If the file is not included then you will most likely encounter issues with unreferenced and out of scope variables. What sort of error message do you get when you click on the payment form button?
Please also remember that you will need to include another hidden field with the order number [ORDER_NO], else you will have no way of knowing which payment relates to which order when the money starts coming through.
Author
No page, just a blank page.
I've found a forum for developer help with authorize,net so hopefully those guys can help out.
I appreciate your help with this as always Paul
You're the man.
No problem, you'll definitely be in safer hands on the Authorize.net developer forum, as they'll have specialist knowledge that I sadly lack.
One thing that I think you might want to check out is the fact that the included file is an ASP (Active Server Page) file. This might require the form to be processed in a separate page with an .asp file extension. It might also require some configuration of your server.
Alternatively, the support at Authorize.net might be able to offer you a similar script, but PHP based, which would be a more natural choice for a Linux/Apache environment.