Hosted Payment Page
The Payrix platform offers the ability to utilise the Payrix Hosted Payment Page which is implemented via a re-direction to the Payrix Payment page. This offering is the simplest way to integrate a payment solution to your software with minimal development work required.
Functionality of a HPP:
Accepts payment via Card, PayTo/PayID and Wallet (Apple Pay or Google Pay)
can be set to single one-time payment with no intention to save payer data
OR supply the ‘savepayer’ paramater set to ‘true’ to save payer data to Payrix secure vault for ongoing payments
Note - Wallet Payment only available for single one-time payment
Does not accept BPAY payment
Payment submitted in real-time with real-time response
The process for using the Payrix HPP token is simply:
Call the POST Generate HPP Token to obtain a token and a redirect URL.
Redirect your customer to the URL you received with the token.
After your customer has completed the form we will redirect them back to your website using the returnURL you provided when generating the token.
Call the Token Lookup API endpoint to obtain the result of the token.
Please note the token is valid for 20 minutes. You may wish to use a landing page to trigger this if the page will not be completed as part of the flow.
For example - if your application intends to supply the customer an email of an invoice with a payment link, you will need a landing page to trigger the HPP as the token is only valid for 20 minutes.
The typical API workflow is noted below:
Use the endpoint - POST Generate HPP Token
Redirect your customer to the URL you received with the token.
Poll Token Lookup API to identify result of HPP.
If Successful and one-off payment, complete
If rejected, implement workflow to generate a subsequent HPP token to capture payment
If Saving Payer Payment Method for future payments, charge stored card (real-time transaction) or utilise scheduling API (2 business day transaction result)
Sample API flow for successful single/one-off payment via Payrix Hosted Payment Page (HPP)
API |
---|
Depending on the workflow of your application, the HPP payment can still be allocated to a Payer Reference only if a Payer Record has been created previously:
Refer to Token [HPP] Generate Model for more information around the API properties. |
Sample |
---|
Example Request {{url}}/businesses/{{business-id}}/services/tokens/hpp/ "ReturnUrl": "https://www.payrix.com.au?txn=123456789", "Template": "Basic", "Transaction": { "ProcessType": "COMPLETE", "Reference": "HPP-TOKEN-001", "Description": "Test HPP API Token", "Amount": 23.00 }, "Payer": { "SavePayer": false, "FamilyOrBusinessName": "Surname", "GivenName": "First Name", "Email": "payer.hpp.1@payrix.com.au", }, "Audit": { "Username": "Token Example", "UserIP": "1.2.3.4" } }' Example Request allocated to Payer record via UniqueReference {{url}}/businesses/{{business-id}}/services/tokens/hpp/ "ReturnUrl": "https://www.payrix.com.au?txn=123456789", "Template": "Basic", "Transaction": { "ProcessType": "COMPLETE", "Reference": "HPP-TOKEN-001", "Description": "Test HPP API Token", "Amount": 23.00 }, "Payer": { "SavePayer": false, "UniqueReference": "HPP-TOKEN-PAYER-U-1", "GroupReference": "HPP-TOKEN-PAYER-GRP-1", "FamilyOrBusinessName": "Surname", "GivenName": "First Name", "Email": "payer.hpp.1@payrix.com.au", }, "Audit": { "Username": "Token Example", "UserIP": "1.2.3.4" } }' Example Response { "token": "28e24e60-0fb8-44e2-918e-e38e038e52f3", "redirectToUrl": "https://sandbox.paymentsapi.io/ui/hpp/api/28e24e60-0fb8-44e2-918e-e38e038e52f3" } |
Next Steps once page is completed and submitted
API |
---|
Call the Token Lookup API endpoint to obtain the result of the token.
Please note the token event and token event status do not relate to the same meaning:
|
Sample |
---|
Example Request {{url}}/businesses/{{business-id}}/services/tokens/{{token-guid}} Example Response { "token": "28e24e60-0fb8-44e2-918e-e38e038e52f3", "type": "HPP", "time": "2019-03-03T18:02:00+10:00", "status": "PROCESSED_SUCCESSFUL", "statusDescription": "PROCESSED_SUCCESSFUL", "returnUrl": "https://www.payrix.com.au?txn=123456789", "redirectToUrl": "https://sandbox.hosted.paymentsapi.io/ui/hpp/api/05c6decc-8816-4b6f-a938-31ee9ea18e9b", "template": "68126866-ba79-42d5-bda2-cc57d5632f05", "templateName": "Basic", "transaction": { "business": { "businessId": "90129", "businessName": "Payrix Sandbox" }, "time": "2024-03-26T00:20:08.16+00:00", "transactionId": "3226115", "secondaryTransactionId": "RT1050829", "reference": "HPP-TOKEN-00134545453", "description": "Test HPP API Token", "scheduleReference": null, "amount": 23.00, "amountRequested": 23.00, "amountRefunded": 0.00, "currency": "AUD", "type": "RT", "typeDescription": "Realtime Payment - Website", "statusCode": "C", "subStatusCode": null, "statusDescription": "Cleared", "paymentMethod": "VISA", "payer": null, "card": { "cardNumber": "411111xxxxxx1111", "cardholderName": "TEST CARD", "cardExpires": "2024-12-01T00:00:00", "cardType": "Visa" }, "bankAccount": null, "rejectionRecovery": null, "verification": null, "source": null, "recurringReference": null, "cardStorageType": null, "cardAuthorizationType": null, "cardAuthorizationReference": "TG-27cfd68f-663f-4b42-8544-09f3121d8171", "profile": 1 }, "payer": null, "schedule": null, "requestHpp": { "returnUrl": "https://www.payrix.com.au?txn=123456789", "template": "Basic", "transaction": { "processType": "COMPLETE", "reference": "HPP-TOKEN-00134545453", "description": "Test HPP API Token", "amount": 23.00, "currencyCode": "AUD", "serviceDate": "2024-01-01T10:00:00+10:00" }, "payer": { "savePayer": false, "uniqueReference": null, "groupReference": null, "familyOrBusinessName": "Surname", "givenName": "First Name", "email": "payer.hpp.1@payrix.com.au", "phone": "0733332222", "mobile": "0411228833", "address": { "line1": "1 Test St", "line2": null, "suburb": "Testville", "state": "QLD", "postCode": "4001", "country": null }, "dateOfBirth": null, "extraInfo": null }, "audit": { "username": "Token Example", "userIP": "1.2.3.4" } }, "events": [ { "event": "WAITING", "time": "2024-03-26T00:20:00+00:00", "description": null, "username": "API: [Token Example]", "ip": "1.2.3.4" }, { "event": "VALIDATED", "time": "2024-03-26T00:20:00+00:00", "description": null, "username": null, "ip": "1.2.3.4" }, { "event": "PROCESSED_SUCCESSFUL", "time": "2024-03-26T00:20:00+00:00", "description": null, "username": null, "ip": "1.2.3.4" } ] } Example Request allocated to Payer record via UniqueReference {{url}}/businesses/{{business-id}}/services/tokens/{{token-guid}} { "token": "28e24e60-0fb8-44e2-918e-e38e038e52f3", "type": "HPP", "time": "2019-03-03T18:02:00+10:00", "status": "PROCESSED_SUCCESSFUL", "statusDescription": null, "returnUrl": "https://www.payrix.com.au?txn=123456789", "redirectToUrl": "https://sandbox.paymentsapi.io/ui/hpp/api/28e24e60-0fb8-44e2-918e-e38e038e52f3", "template": "479B33AD-EE41-4F30-A7B5-0A900A765D4E", "templateName": "Basic", "transaction": { "business": { "businessId": "1391", "businessName": "xUnit Rest Bus1 (T)" }, "time": "2019-03-03T18:01:37.307+10:00", "transactionId": "132426", "secondaryTransactionId": "RT80437", "reference": "HPP-TOKEN-001", "description": "Test HPP API Token", "scheduleReference": null, "amount": 23, "amountRequested": 23, "amountRefunded": 0, "currency": "AUD", "type": "RT", "typeDescription": "Realtime Payment - Website", "statusCode": "C", "subStatusCode": null, "statusDescription": "Cleared", "paymentMethod": "MASTERCARD", "payer": { "payerId": "140448", "uniqueReference": "HPP-TOKEN-PAYER-U-1", "groupReference": "HPP-TOKEN-PAYER-GRP-1", "familyOrBusinessName": "Surname", "givenName": "First Name", "address": null, "email": null, "phone": null, "mobile": null }, "card": { "cardNumber": "555555xxxxxx4444", "cardholderName": "HPP CC", "cardExpires": "2027-11-01T00:00:00", "cardType": "Mastercard" }, "bankAccount": null }, "payer": { "business": { "businessId": "1391", "businessName": "xUnit Rest Bus1 (T)" }, "payerId": "140448", "status": "ACTIVE", "statusCode": "A", "statusDescription": "Active", "statusChangeDate": null, "createdTime": "2019-03-03T18:01:37.223+10:00", "schedule": null, "uniqueReference": "HPP-TOKEN-PAYER-U-1", "groupReference": "HPP-TOKEN-PAYER-GRP-1", "familyOrBusinessName": "Surname", "givenName": "First Name", "email": "payer.hpp.1@payrix.com.au", "phone": "0411228833", "mobile": "0411228833", "address": { "line1": "1 Test St", "line2": "", "suburb": "Testville", "state": "QLD", "postCode": "4883", "country": "AUS" }, "extraInfo": { "xeroAutoDebitEnabled": false } }, "schedule": null, "requestHpp": { "returnUrl": "https://www.payrix.com.au/", "template": "TEST-84d463", "transaction": { "processType": "COMPLETE", "reference": "HPP-TOKEN-001", "description": "Test HPP API Token", "amount": 23, "currencyCode": "AUD" }, "payer": { "savePayer": false, "uniqueReference": "HPP-TOKEN-PAYER-U-1", "groupReference": "HPP-TOKEN-PAYER-GRP-1", "familyOrBusinessName": "Surname", "givenName": "First name", "email": "payer.hpp.1@payrix.com.au", "phone": "0733332222", "mobile": "0411228833", "address": { "line1": "1 Test St", "line2": null, "suburb": "Testville", "state": "QLD", "postCode": "4883", "country": null } }, "audit": { "username": "HppTokenTests", "userIP": "1.2.3.4" } }, "events": [ { "event": "WAITING", "time": "2019-03-03T18:02:00+10:00", "description": null, "username": "API: [HppTokenTests]", "ip": "1.2.3.4" }, { "event": "VALIDATED", "time": "2019-03-03T18:02:00+10:00", "description": null, "username": null, "ip": "1.2.3.4" }, { "event": "PROCESSED_SUCCESSFUL", "time": "2019-03-03T18:02:00+10:00", "description": null, "username": null, "ip": "1.2.3.4" } ] } |
Sample API flow for successful HPP Payment + Save Payer Data via Payrix Hosted Payment Page (HPP)
API |
---|
If payment is for one-off and no requirement to store payment details, set ‘SavePayer’ parameter = ‘false’
As seen in sample - Sample API flow for successful HPP Payment + NOT Save Payer Data Refer to Token [HPP] Generate Model for more information around the API properties. |
Sample |
---|
Example Request {{url}}/businesses/{{business-id}}/services/tokens/hpp/ "ReturnUrl": "https://www.payrix.com.au?txn=123456789", "Template": "Basic", "Transaction": { "ProcessType": "COMPLETE", "Reference": "HPP-TOKEN-001", "Description": "Test HPP API Token", "Amount": 23.00 }, "Payer": { "SavePayer": true, "UniqueReference": "HPP-TOKEN-PAYER-U-1", "GroupReference": "HPP-TOKEN-PAYER-GRP-1", "FamilyOrBusinessName": "Surname", "GivenName": "First Name", "Email": "payer.hpp.1@payrix.com.au", "Phone": "0733332222", "Mobile": "0411228833", "Address": { "Line1": "1 Test St", "Line2": null, "Suburb": "Testville", "State": "QLD", "PostCode": "4001", "Country": null } }, "Audit": { "Username": "Token Example", "UserIP": "1.2.3.4" } }' Example Response { "token": "28e24e60-0fb8-44e2-918e-e38e038e52f3", "redirectToUrl": "https://sandbox.paymentsapi.io/ui/hpp/api/28e24e60-0fb8-44e2-918e-e38e038e52f3" } |
Next Steps once page is completed and submitted
API |
---|
Call the Token Lookup API endpoint to obtain the result of the token.
Please note the token event and token event status do not relate to the same meaning:
|
Sample |
---|
Example Request {{url}}/businesses/{{business-id}}/services/tokens/{{token-guid}} Example Response { "token": "28e24e60-0fb8-44e2-918e-e38e038e52f3", "type": "HPP", "time": "2019-03-03T18:02:00+10:00", "status": "PROCESSED_SUCCESSFUL", "statusDescription": null, "returnUrl": "https://www.payrix.com.au?txn=123456789", "redirectToUrl": "https://sandbox.paymentsapi.io/ui/hpp/api/28e24e60-0fb8-44e2-918e-e38e038e52f3", "template": "479B33AD-EE41-4F30-A7B5-0A900A765D4E", "templateName": "Basic", "transaction": { "business": { "businessId": "1391", "businessName": "xUnit Rest Bus1 (T)" }, "time": "2019-03-03T18:01:37.307+10:00", "transactionId": "132426", "secondaryTransactionId": "RT80437", "reference": "HPP-TOKEN-001", "description": "Test HPP API Token", "scheduleReference": null, "amount": 23, "amountRequested": 23, "amountRefunded": 0, "currency": "AUD", "type": "RT", "typeDescription": "Realtime Payment - Website", "statusCode": "C", "subStatusCode": null, "statusDescription": "Cleared", "paymentMethod": "MASTERCARD", "payer": { "payerId": "140448", "uniqueReference": "HPP-TOKEN-PAYER-U-1", "groupReference": "HPP-TOKEN-PAYER-GRP-1", "familyOrBusinessName": "Surname", "givenName": "First Name", "address": null, "email": null, "phone": null, "mobile": null }, "card": { "cardNumber": "555555xxxxxx4444", "cardholderName": "HPP CC", "cardExpires": "2027-11-01T00:00:00", "cardType": "Mastercard" }, "bankAccount": null }, "payer": { "business": { "businessId": "1391", "businessName": "xUnit Rest Bus1 (T)" }, "payerId": "140448", "status": "ACTIVE", "statusCode": "A", "statusDescription": "Active", "statusChangeDate": null, "createdTime": "2019-03-03T18:01:37.223+10:00", "schedule": null, "uniqueReference": "HPP-TOKEN-PAYER-U-1", "groupReference": "HPP-TOKEN-PAYER-GRP-1", "familyOrBusinessName": "Surname", "givenName": "First Name", "email": "payer.hpp.1@payrix.com.au", "phone": "0411228833", "mobile": "0411228833", "address": { "line1": "1 Test St", "line2": "", "suburb": "Testville", "state": "QLD", "postCode": "4883", "country": "AUS" }, "extraInfo": { "xeroAutoDebitEnabled": false } }, "schedule": null, "requestHpp": { "returnUrl": "https://www.payrix.com.au/", "template": "TEST-84d463", "transaction": { "processType": "COMPLETE", "reference": "HPP-TOKEN-001", "description": "Test HPP API Token", "amount": 23, "currencyCode": "AUD" }, "payer": { "savePayer": true, "uniqueReference": "HPP-TOKEN-PAYER-U-1", "groupReference": "HPP-TOKEN-PAYER-GRP-1", "familyOrBusinessName": "Surname", "givenName": "First name", "email": "payer.hpp.1@payrix.com.au", "phone": "0733332222", "mobile": "0411228833", "address": { "line1": "1 Test St", "line2": null, "suburb": "Testville", "state": "QLD", "postCode": "4883", "country": null } }, "audit": { "username": "HppTokenTests", "userIP": "1.2.3.4" } }, "events": [ { "event": "WAITING", "time": "2019-03-03T18:02:00+10:00", "description": null, "username": "null", "ip": 1.2.3.4" }, { "event": "VALIDATED", "time": "2019-03-03T18:02:00+10:00", "description": null, "username": null, "ip": "1.2.3.4" }, { "event": "PROCESSED_SUCCESSFUL", "time": "2019-03-03T18:02:00+10:00", "description": null, "username": null, "ip": "1.2.3.4" } ] } |
Implement Recurring Payment solutions after Saving Payer Data via HPP
When you elect to save payer data via the Payrix HPP, the payer must agree to the Direct Debit Terms & Conditions. This allows Payrix to debit their nominated account as and when required directed by the business. To collect future payments, the Payrix platform offers 3 solutions:
Process a transaction using saved card details / charge stored card
Processes a real-time card transaction on the card account registered to the payers account
Schedule a single payment
A non real-time card transaction allowing you to schedule a payment to be processed on the current or future date
Schedule multiple future payments
A non real-time card transaction allowing you to schedule multiple future payments to be processed on the current and future date
Should your application intend to utilise the scheduling API, refer to the Scheduling API guide here for steps to initiate a scheduled debit.
Refer to the links to implement a recurring payment solution after saving payer data:
What if a payment via the Payrix Hosted Payment Page fails or is unsuccessful?
When a payment is declined through the Payrix Hosted Payment Page, a new HPP will need to be generated. This is due to the fact that a HPP token is valid for 20 minutes and is a one-time use token. Ensure to keep this in mind when implementing your desired workflow and have a solution in place to generate a new HPP to re-attempt payment.
The API flow will be the same for a rejected payment and to keep it simple, a sample flow is below when implementing a HPP without saving payer data.
Sample API flow for failed HPP Payment
API |
---|
Refer to Token [HPP] Generate Model for more information around the API properties. |
Sample |
---|
Example Request {{url}}/businesses/{{business-id}}/services/tokens/hpp/ "ReturnUrl": "https://www.payrix.com.au?txn=123456789", "Template": "Basic", "Transaction": { "ProcessType": "COMPLETE", "Reference": "HPP-TOKEN-001", "Description": "Test HPP API Token", "Amount": 23.00 }, "Payer": { "SavePayer": false, "FamilyOrBusinessName": "Surname", "GivenName": "First Name", "Email": "payer.hpp.1@payrix.com.au", "Phone": "0733332222", "Mobile": "0411228833", "Address": { "Line1": "1 Test St", "Line2": null, "Suburb": "Testville", "State": "QLD", "PostCode": "4001", "Country": null } }, "Audit": { "Username": "Token Example", "UserIP": "1.2.3.4" } }' Example Response { "token": "28e24e60-0fb8-44e2-918e-e38e038e52f3", "redirectToUrl": "https://sandbox.paymentsapi.io/ui/hpp/api/28e24e60-0fb8-44e2-918e-e38e038e52f3" } |
Next Steps once page is completed and submitted
API |
---|
Call the Token Lookup API endpoint to obtain the result of the token.
Please note the token event and token event status do not relate to the same meaning:
Here you can see that the Token Status and Token Event Status differ:
|
Sample |
---|
Example Request {{url}}/businesses/{{business-id}}/services/tokens/{{token-guid}} Example Response { "token": "18fe4852-b61c-4ee7-8b8f-473c59fe9563", "type": "HPP", "time": "2024-03-26T00:43:00+00:00", "status": "PROCESSED_REJECTED", "statusDescription": "PROCESSED_REJECTED", "returnUrl": "https://www.payrix.com.au?txn=123456789", "redirectToUrl": "https://sandbox.hosted.paymentsapi.io/ui/hpp/api/18fe4852-b61c-4ee7-8b8f-473c59fe9563", "template": "68126866-ba79-42d5-bda2-cc57d5632f05", "templateName": "Basic", "transaction": { "business": { "businessId": "90129", "businessName": "Payrix Sandbox" }, "time": "2024-03-26T00:43:09.58+00:00", "transactionId": "3226118", "secondaryTransactionId": "RT1050832", "reference": "HPP-TOKEN-00134590-9045453", "description": "Test HPP API Token", "scheduleReference": null, "amount": 23.51, "amountRequested": 23.51, "amountRefunded": 0.00, "currency": "AUD", "type": "RT", "typeDescription": "Realtime Payment - Website", "statusCode": "R", "subStatusCode": "R6", "statusDescription": "Rejected: Transaction Declined", "paymentMethod": "VISA", "payer": null, "card": { "cardNumber": "411111xxxxxx1111", "cardholderName": "TEST CARD", "cardExpires": "2024-12-01T00:00:00", "cardType": "Visa" }, "bankAccount": null, "rejectionRecovery": null, "verification": null, "source": null, "recurringReference": null, "cardStorageType": null, "cardAuthorizationType": null, "cardAuthorizationReference": "TG-d6b3ce96-8c57-4e1d-b847-d4b484f245e1", "profile": 1 }, "payer": null, "schedule": null, "requestHpp": { "returnUrl": "https://www.payrix.com.au?txn=123456789", "template": "Basic", "transaction": { "processType": "COMPLETE", "reference": "HPP-TOKEN-00134590-9045453", "description": "Test HPP API Token", "amount": 23.51, "currencyCode": "AUD", "serviceDate": "2022-03-01T10:00:00+10:00" }, "payer": { "savePayer": false, "uniqueReference": null, "groupReference": null, "familyOrBusinessName": "Surname", "givenName": "First Name", "email": "payer.hpp.1@payrix.com.au", "phone": "0733332222", "mobile": "0411228833", "address": { "line1": "1 Test St", "line2": null, "suburb": "Testville", "state": "QLD", "postCode": "4001", "country": null }, "dateOfBirth": null, "extraInfo": null }, "audit": { "username": "Token Example", "userIP": "1.2.3.4" } }, "events": [ { "event": "WAITING", "time": "2024-03-26T00:43:00+00:00", "description": null, "username": "API: [Token Example]", "ip": "1.2.3.4" }, { "event": "VALIDATED", "time": "2024-03-26T00:43:00+00:00", "description": null, "username": null, "ip": "1.2.3.4" }, { "event": "PROCESSED_SUCCESSFUL", "time": "2024-03-26T00:43:00+00:00", "description": null, "username": null, "ip": "1.2.3.4" } ] } |
This concludes the API workflow of implementing the Payrix Hosted Payment Page to your application. Refer to our other methods available for accepting payments.