You can listen to various events in the IssueCard
using the onEvent
prop.
import { IssueCard } from '@card91/react-native-issue-card';
export function IssueCardPage() {
const onIssueCardEvent = (event) => {
switch (event) {
case "C91_MIN_KYC_INITIALISED":
// Do something to indicate that library is initialized
break;
case "C91_MIN_KYC_SUCCESS":
// Do something to indicate that the API calls have succeeded
break;
case "C91_MIN_KYC_API_FAILURE":
// Do something to indicate that the API calls have failed
break;
case "C91_MIN_KYC_AUTHENTICATION_FAILURE":
// Do something to indicate that the API calls have Unauthorized
break;
case "C91_MIN_KYC_SERVER_FAILURE":
// Do something to indicate that the API calls have Server Error
break;
case 'C91_ISSUE_CARD_API_FAILURE':
// Do something to indicate that the API calls have failed
break;
case "C91_MIN_KYC_MISSING_PARAMETER":
// Do something to indicate that Parameter is missing
break;
case "C91_MIN_KYC_OTP_SEND_FAIL":
// Do something to indicate that the API fails to send the OTP
break;
case "C91_MIN_KYC_OTP_VERIFICATION_FAIL":
// Do something to indicate that the API MIN KYC Verification is failed
break;
case 'C91_MIN_KYC_MOBILE_ALREADY_EXIST_OR_INVALID':
// Do something to indicate that the KYC already done or mobile number invalid
// Check the payload to identify the two cases here
}
};
return (
<View>
<IssueCard ... onEvent={onIssueCardEvent} />
</View>
);
}
The events are as follows:
Event Name | Description |
---|---|
C91_MIN_KYC_INITIALISED | The NSDL MIN KYC screen has been initialised. |
C91_MIN_KYC_SUCCESS | The API request related to the NSDL MIN KYC screen was successful. |
C91_MIN_KYC_API_FAILURE | The API request related to theNSDL MIN KYC screen has failed. |
C91_MIN_KYC_AUTHENTICATION_FAILURE | Authentication for the NSDL MIN KYC screen has failed. |
C91_MIN_KYC_SERVER_FAILURE | The server encountered an error while processing the NSDL MIN KYC request. |
C91_MIN_KYC_MISSING_PARAMETER | A required parameter is missing in the NSDL MIN KYC request. |
C91_MIN_KYC_OTP_SEND_FAIL | The API request for generating the OTP for the NSDL MIN KYC has failed. |
C91_MIN_KYC_OTP_VERIFICATION_FAIL | The API request for validating the OTP has failed for the NSDL MIN KYC |
C91_MIN_KYC_MOBILE_ALREADY_EXIST_OR_INVALID | KYC for this mobile number is already done or the mobile number is not valid. Payload of both these event will be different. |