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
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:
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
reference (for marrying the payment back to your system) is recommended.
Here is a list of fields:
|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.
3: Create the custom payment page link
To create a custom payment page link, use the following formula:
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.