Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 5
Registered: ‎04-15-2013

Allowing Users to Enter Their Own Payment Amount

Hi,

 

I am trying to find a code so a user can input their own payment amount instead of having a set amount in the payment form.

 

This is for a live account, using the Direct Post Method, following integration instructions here:

http://developer.authorize.net/integration/fifteenminutes/

 

Thanks!

Posts: 1,609
Topics: 15
Kudos: 209
Solutions: 121
Registered: ‎06-23-2011

Re: Allowing Users to Enter Their Own Payment Amount

Just use a two-stage process. The first stage has them choose an amount; the second is the regular DPM form. Alternately, you can cheat and use AJAX to pass the amount to a separate page and get back the field values you need to update in the form for it to work for that value. That will require some knowledge of Javascript, though, and you need to remember to set a minimum and maximum amount in the AJAX page so they can't charge 1 cent or something.

Member
Posts: 5
Registered: ‎04-15-2013

Re: Allowing Users to Enter Their Own Payment Amount

Sounds complicated. I am not very familiar with this. I know with some services you can just remove the amount from the code and it will open up that field for editing by the user. I tried that with this service but it didn't work.

 

Any chance there is a simple line of code I can addor edit to the direct_post.php?

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

Re: Allowing Users to Enter Their Own Payment Amount

Or you can use the "Simple Checkout", just login to the merchant account to setup one up. Set it as a donation and then the "Allow donors to specify the amount they wish to donate" checkbox.

 

Else you could hire one of the certified developers