Definition
/**
* Public event emitter to emitt SDK events to Brand
* */
BreadPayments.on(event: string, callback: () => void): EventEmitter2;
Example
window.BreadPayments.on("CARD:RECEIVE_APPLICATION_RESULT",(cardResult) => {
// Handle Application Result
switch(cardResult.result){
case 'APPROVED':
// Handle approved case
break;
case 'PENDING':
// Handle pending case
break;
case 'ACCOUNT_EXISTS':
// Handle account exists case
break;
case 'DECLINED':
// Handle declined case
break;
case 'ERROR':
// Handle error case
break;
}
});
Related
Updated almost 2 years ago