Reply
Highlighted
Member
Posts: 6
Registered: ‎03-20-2013

Direct Post PHP Customer Enters Amount

Hello,
I'm trying to find a sample of code where a user enters a unique payment amount from their invoice, then the amount entered is displayed on the next page above the fields for payment information. Everything I have tried so far gives me the invalid amount error.
Best regards,
Chris
Administrator Administrator
Administrator
Posts: 563
Registered: ‎08-03-2011

Re: Direct Post PHP Customer Enters Amount

Hi,
 
There is not any sample code for this that we provide. When using Direct Post Method, the transaction amount must be collected to generate the fingerprint and so it takes place before any communication with Authorize.Net.
 
Thanks,
Joy
Member
Posts: 6
Registered: ‎03-20-2013

Re: Direct Post PHP Customer Enters Amount

Hi Joy, I understand completely, just looking for a little help.

 

I am trying to store the $amount variable from a user entered field on one page, then pass that value to the page with the checkout form.  Could anyone help me with this? I'm assuming this is relatively easy to do, I just can't seem to make it work. 

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

Re: Direct Post PHP Customer Enters Amount

Member
Posts: 6
Registered: ‎03-20-2013

Re: Direct Post PHP Customer Enters Amount

@RaynorC1emen7

Thank you for the link, that worked perfectly.  I'm also trying to allow the customer to enter invoice and description fields.  Using x_invoice_num and x_description doesn't seem to work.  I found the note below in the docs, but I don't quite understand:

 

The invoice number must be
created dynamically on the
merchant server or provided on a
per-transaction basis. The
payment gateway does not
perform this function.
Also, in order to be included on
the hosted payment form, the
attribute View must be
configured for this field in the
Merchant Interface payment form
settings.

 

 

Member
Posts: 6
Registered: ‎03-20-2013

Re: Direct Post PHP Customer Enters Amount

To clarify, these variables are passing between the pages without any problem.  When I receive the email reciept with the information entered, the invoice and description fields are still blank.  How do I capture that information during the transaction?

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

Re: Direct Post PHP Customer Enters Amount

Did the invoice# and description show up on the merchant account transaction detail screen?

Member
Posts: 6
Registered: ‎03-20-2013

Re: Direct Post PHP Customer Enters Amount

[ Edited ]

I'm honestly not sure where the merchant account transaction detail screen is located.

 

However, I got this working properly by adding hidden inputs to AuthorizeNetDPM.php:

 

<input type="hidden" name="x_invoice_num" VALUE="'.($_POST['invoiceNum']).'">
<input type="hidden" name="x_description" VALUE="'.($_POST['accountNumb']).'">

 

Also, I used cookies to get these variables (amount, invoice number, description) to show on the order reciept page.  Is that going to cause any PCI compliance issues?

 

 

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

Re: Direct Post PHP Customer Enters Amount

Is that going to cause any PCI compliance issues?

it is ok. as long as there is no Credit Card info.

Member
Posts: 6
Registered: ‎03-20-2013

Re: Direct Post PHP Customer Enters Amount

Thanks!