Showing results for 
Search instead for 
Did you mean: 

Address Options for Embedded accept.js form

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...


Accepted Solutions

I didn’t look closely enough. The setting on the accept.js form loads fewer fields than the Accept Hosted form. That is rather odd.

View solution in original post


First, you are not doing a custom form. Custom payment form will up your client’s PCI scope to SAQ A-EP. when you explain the implications of that they will likely scrap that idea at all costs.

In regards to your issue, you have a form on your site and are trying to get the address on your form populated on the payment page?
All Star

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, 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 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!


I think you’re just still getting used to the API. It has a learning curve. You can set the form to show the name and address fields. It is submitted in json like everything else in the accept suite.

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:


What am I missing?




I didn’t look closely enough. The setting on the accept.js form loads fewer fields than the Accept Hosted form. That is rather odd.

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!


Have you thought of using the Accept Hosted form instead? It has the full address and you can pass it in the API call and have it prepopulated if they fill out info on your in house form? You wouldn’t have to modify your existing script much at all. Just copy and paste the sample code and pass your values.