Creating a custom payment page link

AffiniPay creates a payment page for each of a merchant’s processing accounts. Using the API, you can retrieve the URL for a payment page and display a link to the pre-populated payment page from within your application. Use the following steps:

  1. Retrieve the payment page.
  2. Define pre-filled fields.
  3. Create the custom payment page link.

1: Retrieve the payment page

Retrieve the link to the payment page. From within your application, the merchant must be able to choose which payment page they would like to access.

Example request: Retrieving a list of payment pages for the merchant
curl -X GET https://api.affinipay.com/payment-pages \ -H 'Authorization:Bearer<oauth-access-token>'

The API returns a list of all payment pages for the merchant and their corresponding URLs, such as:

https://secure.affinipay.com/pages/mybusiness/myaccount

2: Define pre-filled fields

You can pre-populate fields on the payment page by adding query parameters to the payment page URL. Although it is not required, populating amount and reference (for marrying the payment back to your system) is recommended.

Here is a list of fields:

ParameterURL Syntax
namename=Dave%20Bowman
amountamount=1000
address1address=2001%20Odyssey%20Ln
address2address2=Suite%20200
citycity=Austin
statestate=TX
postal_codepostal_code=78727
countrycountry=US
phonephone=5123214321
referencereference=1968
emailemail=devsupport@​affinipay.com
Invoice (note capital I)Invoice=3845

In addition, you can include the parameter readOnlyFields with a comma-separated list of other parameters in the payment page URL. This marks fields on the form uneditable as to not disrupt important information such as amount or reference.

To create a custom payment page link, use the following formula:

payment_page_URL?parameter1_name=parameter1_value&parameter2_name=parameter2_value&readOnlyFields=parameter3,parameter4

For example:

https://secure.affinipay.com/pages/mybusiness/myaccount?reference=Invoice% 208442&amount=1000&readOnlyFields=reference,amount

This link opens the MyBusiness merchant’s branded payment page for their MyAccount processing account. On the page, the reference fields is pre-populated with the text “Invoice 208442” and the amount field is pre-populated with the value “$10”. Neither of these fields can be edited by the user.