Setting Up the Payments Page
When setting up your payments page to support the Embedded Form, always put the embedded_js_url
value in a <script>
tag as a top-level document in the browser (not in an iframe). This prevents clickjacking.
You also must specify the DOM ID of the HTML element that will invoke the Embedded Form. Although the DOM ID is named “button,” it can reference any HTML tag that is clickable on the page. To include the DOM ID and any optional data values (listed below) in the Embedded Form, pass them in using either conventional URL parameters or as “data” attributes. For example, if you wanted to include the consumer’s name in the Form, you could pass in the following:
<script src="https://www.paynearme-sandbox.com/api/embedded/Ku6z6P5enC2PiTvrpazZ1g/script.js?name=Doe&button=Pay"></script>
Or use more modern “data” attributes:
<script src="https://www.paynearme-sandbox.com/api/embedded/Ku6z6P5enC2PiTvrpazZ1g/script.js" data-name=’Doe’ data-button=’Pay Now’></script>
The following optional parameters can be included in the form:
Parameter | Description |
---|---|
prompt | The Header in the Embedded Form modal |
footnote | The Footer in the Embedded Form Modal |
name | The account holder name of the bank, credit, or debit account. |
phone | The account holder’s phone number. |
email | The account holder’s email address. |
address | The billing street address of the account holder. |
zip | The postal code of the account holder. |
callback | The name of the callback function you’re using to capture the payment token for storage (instead of refreshing the Embedded Form modal). For example,<script src="<https://www.paynearme-sandbox.com/api/embedded/Ku6z6P5enC2PiTvrpazZ1g/script.js"> data-button=’Pay Now’ data-callback=echo></script> <script> function echo(results) { //do something with results.token or results.message }</script> |
only | A comma-separated list of payment methods allowed on the Embedded Form. Supported options include the following:
NOTE: This parameter cannot be used with the except parameter. |
except | A comma-separated list of payment methods not allowed on the Embedded Form. Supported options include the following:
NOTE: This parameter cannot be used with the only parameter. |
pay | Use the following supported options:
|
schedule | Use schedule=1 to enable the agent to create an Autopay payment schedule with the newly created payment method. |
Once the agent invokes the Embedded Form, the following screen displays asking him or her to select an existing payment method or create a new one:

The following parameters/options can be configured by PayNearMe to default to a set value:
prompt
footnote
only
except
Additionally, PayNearMe can configure whether the Embedded Form displays directly on your payment page in an embedded modal or displays in a new page/browser tab. If you want the form to display on a new page, you will need to enable pop-ups on your site from paynearme.com
. Contact your PayNearMe representative for more information.
Updated 6 months ago