You can listen to various events in the ResetPinFlow
using the onEvent
prop.
import { ResetPinFlow } from '@card91/react-native-reset-pin-flow';
export function ResetPinPage() {
const onResetPinEvent = (event) => {
switch (event) {
case "C91_RESET_PIN_MISSING_PARAMETER":
// Do something to indicate that Parameter is missing
break;
case "C91_RESET_PIN_AUTHENTICATION_FAILURE":
// Do something to indicate that the API calls have Unauthorized
break;
case "C91_RESET_PIN_SERVER_FAILURE":
// Do something to indicate that the API calls have Server Error
break;
case "C91_RESET_PIN_SUCCESS":
// Do something to indicate that the API calls have succeeded
break;
case 'C91_RESET_PIN_FAIL':
// Do something to indicate that the API calls have failed
break;
case "C91_OTP_SEND_FAIL":
// Do something to indicate that the API calls have succeeded
break;
case 'C91_OTP_VERIFICATION_FAIL':
// Do something to indicate that the API calls have failed
break;
}
};
return (
<View>
<ResetPinFlow ... onEvent={onResetPinEvent} />
</View>
);
}
The events are as follows:
Event Name | Description |
---|---|
C91_RESET_PIN_SUCCESS | Called when the server-side APIs load successfully. |
C91_RESET_PIN_FAIL | Called when the server-side APIs fail to load. |
C91_RESET_PIN_AUTHENTICATION_FAILURE | Called when Token is expired or invalid Parameter |
C91_RESET_PIN_SERVER_FAILURE | Called when the server-side APIs fail to load. |
C91_RESET_PIN_MISSING_PARAMETER | Called when Input props are missing. |
C91_OTP_SEND_FAIL | Called when the server-side APIs fail to load. |
C91_OTP_VERIFICATION_FAIL | Called when the server-side APIs fail to load. |