Reply
Member
Posts: 2
Registered: ‎03-26-2012

Donation / Fill-in Amount with DPM

Hi, I've downloaded and tested the sample code for DPM. Is it possible to have the user fill in the amount rather than set that in the PHP on the front-end? I see that Simple Checkout allows this but my requirements from the client are that the user stays on the client's page instead of going over to authorize.net to enter their info.

 

Does anyone have sample code that would work? I tried to modify AuthorizeNetDPM.php to show the amount in the form but got this error code:

 

Sorry, an error occurred: This transaction cannot be accepted.

 

If there is another API I should use, let me know. I just can't find anything mentioning this in the blogs or documenation.

 

thanks in advance!

 

 

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

Re: Donation / Fill-in Amount with DPM

That's a tough one. The problem is that the amount is part of the fingerprint hash, so you need to know the amount before the fingerprint is generated, and DPM obviously has to submit direct to Authorize.net. What you -could- do is use AJAX to cheat and fill in the fingerprint when they update the amount on the form. Short of that, have them enter the amount on one form and then submit that to the form with the credit card info and so on.

Member
Posts: 2
Registered: ‎03-26-2012

Re: Donation / Fill-in Amount with DPM

Thanks for your response. I've spent the afternoon trying to make it work with AJAX or with a form on the front-end and it keeps throwing errors from the DPM API so I don't think it will let me pass a value in that way. Do you think another API would work or are we stuck with using the Simple Checkout form?

 

 

Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: Donation / Fill-in Amount with DPM

Hi,

 

The only other option that you have is to make the checkout a two step process.  You can collect the amount in the first step and use it to generate the fingerprint that is embedded into the second step where the payment details are collected.

 

Thanks,

Joy