Clients are stupid. After approval of the new accept.js payment form, and going live with it - THEN they come up with, "Oh, we need to be able to accept 3rd party payments, so that form MUST have billing address fields available ...".
Currently, I don't think there's an option to actually be able to do that with the embedded form, and I'd really like to NOT have to rewrite this whole thing again using a custom form. Client is like "just add the d**n fields, what's your problem??"
Has anybody figured a hack to do this, is there a planned update to do this ... or am I screwed and I get to do a custom form? (The sample HTML pagewith the custom form doesn'tseem to actually work, by the way)
I've got an extremely ugly hack started that will actually pass the fields to my processing page, but getting the input fields to integrate into the presented form is proving a challege...
Solved! Go to Solution.
07-05-2019 05:00 PM
07-06-2019 10:46 AM
07-05-2019 06:56 PM - edited 07-05-2019 06:56 PM
The full app is a multi-page tourism insurance application. Normally, the person applying for the insurance is the same persion paying for it. When that's the case, the standard embedded accept.js generated form, with the name and postal code fields turned off, is more than fine, as we already have that information encrypted and stored elsewhere.
However there's a "Option B" where the payee might be a 3rd party entity - a medical tourism travel agency or something. If that's the case, that specific information isn't recorded along with the application, and may not even be known until later after the completed application is approved and ready for payment. If that's the case, then I need to have company, name, address fields available on the payment form. Unfortunitely, the embedded generated form doesn't have the option to display address fields.
Doing some experimentation, I've found I can wrap my own extra needed fields inside the accept.js form tag inside a div, style them to look like I want, and when the form is submitted, the credit card info is passed directly to authorize.net, bypassing our servers as it should be, and the custom fields are sent directly to the processing page where I can add those fields to the processing script along with the nonce information that's submitted for payment.
A couple of conditional statements pick where the the name and address information is coming from - either a database call to the original record, or the custom fields in case of a 3rd party.
Initial tests seem OK.
I just wish I understood why authorize.net decided NOT to include billing address fields on the generated forms, as that would solve my entire problem with no addition coding needed. Should be an option!
07-05-2019 11:29 PM
07-06-2019 12:06 AM
The embeded form has an option:
data-billingAddressOptions='{"show":true, "required":true}'
If set to show:false, the form shows card number, security code, and expiry date
If set to show:true, addiional fields for first and last name, plus postal code are generated
I don't see any other options listed here that will add address fields:
https://developer.authorize.net/api/reference/features/acceptjs.html
What am I missing?
07-06-2019 01:20 AM - edited 07-06-2019 01:20 AM
07-06-2019 10:46 AM
The hack I've got going is working well enough. If the person that entered the enrollment is the same one paying, they're presented with the simple version of the form. If it's a third party, they check a box, are are presented with the additional needed fields BEFORE they hit the "Pay" button.
When I've got time, I'm going to go through the entire accept.js file. What I want might actually be in there, just not enabled. Seems really odd to me that you can't get address fields on the form!
07-06-2019 02:11 PM
07-06-2019 03:13 PM