Object that covers different options for getting a postback response when action has been completed upon a particular API-generated page.
Parameter | Type | Description |
---|---|---|
enableClientSidePostBack | Boolean | Defaults to True. Use only if presenting ClientPay page within iframe. If True, will send a windows.post message to parent window with full response object. |
clientSideReturnAddress | String | If enableClientSidePostBack is set to TRUE, then ClientPay will check to see if the clientSideReturnAddress matches the URL of the parent window. If match, client side postback occurs. If no match, nothing will be posted to parent window. |
serverSideReturnAddress | String | ClientPay will send a server side response message to the URL provided in this field. The contents of the response are the same as the client side response. |
"responseOptions": {
"enableClientSidePostBack": true,
"clientSideReturnAddress": "https://www.yourdomain.com",
"serverSideReturnAddress": "https://www.yourdomain.com/endpointlisteningforpostback"
}
Please note that when the end user submits the payment on the page, two responses are sent. The first right when the payment is initiated and the second once the payment is approved. Below is a sample of each.
Response/Message 1: Processing
{
"requestID": "f2467932-f431-4fd6-8b7b-a8df1e499c6a",
"status": "Processing",
"paymentID": "",
"success": true
}
Response/Message 2: Success
{
"success": true,
"requestID": "f2467932-f431-4fd6-8b7b-a8df1e499c6a",
"paymentID": "11546095",
"sessionID": null,
"customerRefNumber": null,
"paymentStatus": "Approved",
"paymentPageUrlStatus": "Completed",
"paymentDate": "2020-05-01T09:27:10.7631475-05:00",
"paymentDateUtc": "2020-05-01T14:27:10.7631475Z",
"paymentMethodType": 0,
"statusByType": 0,
"paymentAmount": 2200,
"paymentTaxAmount": 0,
"surchargeAmount": 0,
"paymentPageUrl": "https://app.clientpay.com/app/api/#/invoicePaymentPage/f2467932-f431-4fd6-8b7b-a8df1e499c6a",
"paymentItems": [
{
"itemId": 0,
"sku": "12345",
"productName": "Jane Doe",
"paymentAmount": 1500,
"paymentTaxAmount": 0,
"clientId": "10001",
"clientName": "Jane Doe",
"invoiceId": 36869,
"invoiceNumber": "12345",
"orderNumber": "12345",
"description": "Payment API Invoice Nbr: 12345",
"quantity": 1,
"amountRefunded": 0,
"amountVoided": 0,
"isRefund": false,
"isVoid": false
},
{
"itemId": 0,
"sku": "23456",
"productName": "Jane Doe",
"paymentAmount": 700,
"paymentTaxAmount": 0,
"clientId": "10001",
"clientName": "Jane Doe",
"invoiceId": 36870,
"invoiceNumber": "23456",
"orderNumber": "23456",
"description": "Payment API Invoice Nbr: 23456",
"quantity": 1,
"amountRefunded": 0,
"amountVoided": 0,
"isRefund": false,
"isVoid": false
}
],
"payer": null,
"cardInfo": {
"cardNumberMasked": "****2226",
"expirationDateMonth": 12,
"expirationDateYear": 2021,
"cardBrand": "MasterCard",
"zipCode": null
},
"checkInfo": null,
"errorMessage": ""
}