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:

NameDescription
applicationIdThe application id
lenderIdThe lender id
lenderNameThe lender name
availableCreditAn array of available credit with the lender. See AvailableCredit.
consumerDetailsThe consumer details. See ConsumerDetails.

What’s Next