onApprovalStatusChange
This event is triggered before the Apply or Checkout flow ends and the completion callback is triggered. It provides immediate feedback on the customer’s application status.
It also should be called when the initial account status is determined without going through lenders.
Code samples
function onApprovalStatusChange(status, data){
// can be saved for tracking consumer journy or for marketing porpuses
}
// Apply
ChargeAfter.payments.present('apply', { ..., onApprovalStatusChange });
//Checkout
ChargeAfter.payments.present('checkout', { ..., onApprovalStatusChange });
const onApprovalStatusChange = (
status: OnApprovalStatusChangeStatus,
data: OnApprovalStatusChangeData
) => {
// can be saved for tracking consumer journy or for marketing porpuses
}
// Apply
ChargeAfter.payments.present('apply', { ..., onApprovalStatusChange });
//Checkout
ChargeAfter.payments.present('checkout', { ..., onApprovalStatusChange });
Properties
Status - string (Optional)
- PENDING
- PRE_APPROVED
- APPROVED
- DECLINE
Data - object (Optional)
This object contains information about the application:
Name | Description |
---|---|
applicationId | The application id |
lenderId | The lender id |
lenderName | The lender name |
availableCredit | An array of available credit with the lender. See AvailableCredit. |
consumerDetails | The consumer details. See ConsumerDetails. |
Updated 2 months ago
What’s Next