diff --git a/ONFIDO.md b/ONFIDO.md new file mode 100644 index 0000000000..86e512ca69 --- /dev/null +++ b/ONFIDO.md @@ -0,0 +1,11 @@ +export applicant_id=$(curl -s https://api.eu.onfido.com/v3.6//applicants \ + -H "Authorization: Token token=$ONFIDO" \ + -d 'first_name=Theresa' \ + -d 'last_name=May' | jq -r .id) + +export token=$(curl -s https://api.onfido.com/v3/sdk_token \ + -H "Authorization: Token token=$ONFIDO" \ + -F "applicant_id=$applicant_id" \ + -F 'application_id=com.galoy' | jq -r .token) + +echo $token \ No newline at end of file diff --git a/app/screens/developer-screen/debug-screen.tsx b/app/screens/developer-screen/debug-screen.tsx index 9063b9ad59..d75acab1ac 100644 --- a/app/screens/developer-screen/debug-screen.tsx +++ b/app/screens/developer-screen/debug-screen.tsx @@ -18,6 +18,13 @@ import { InAppBrowser } from "react-native-inappbrowser-reborn" import { useNavigation } from "@react-navigation/native" import { StackNavigationProp } from "@react-navigation/stack" import { RootStackParamList } from "@app/navigation/stack-param-lists" +import { + Onfido, + OnfidoCaptureType, + OnfidoCountryCode, + OnfidoDocumentType, + OnfidoTheme, +} from "@onfido/react-native-sdk" gql` query debugScreen { @@ -182,6 +189,30 @@ export const DeveloperScreen: React.FC = () => { saveToken(newToken || "") } + const onfidoStart = async () => { + try { + const res = await Onfido.start({ + sdkToken: + "eyJhbGciOiJFUzUxMiJ9.eyJleHAiOjE2OTU0MDA3NDksInBheWxvYWQiOnsiYXBwIjoiZTY0OWU0M2QtYzg3Yy00MDg2LWI5NWMtM2QwODY1NWNhZmIwIiwiYXBwbGljYXRpb25faWQiOiJjb20uZ2Fsb3kiLCJjbGllbnRfdXVpZCI6ImI0ZTZhNWMzLTMwNWQtNGNiZS05OGY0LTFlMmMzNTNlNmQ4ZCIsImlzX3NhbmRib3giOnRydWUsImlzX3NlbGZfc2VydmljZV90cmlhbCI6dHJ1ZSwiaXNfdHJpYWwiOnRydWUsInNhcmRpbmVfc2Vzc2lvbiI6IjA0MDU5YjJkLTQ1ODYtNDBjYi1hMzdlLTVjYTk2M2Q2YjkzNCIsImhhc191c2FnZV9wbGFuIjpmYWxzZX0sInV1aWQiOiJwbGF0Zm9ybV9zdGF0aWNfYXBpX3Rva2VuX3V1aWQiLCJ1cmxzIjp7ImRldGVjdF9kb2N1bWVudF91cmwiOiJodHRwczovL3Nkay5vbmZpZG8uY29tIiwic3luY191cmwiOiJodHRwczovL3N5bmMub25maWRvLmNvbSIsImhvc3RlZF9zZGtfdXJsIjoiaHR0cHM6Ly9pZC5vbmZpZG8uY29tIiwiYXV0aF91cmwiOiJodHRwczovL2FwaS5vbmZpZG8uY29tIiwib25maWRvX2FwaV91cmwiOiJodHRwczovL2FwaS5vbmZpZG8uY29tIiwidGVsZXBob255X3VybCI6Imh0dHBzOi8vYXBpLm9uZmlkby5jb20ifX0.MIGHAkIBhLY6Cqb5nMv_zx3Vx72kPMj-HXP5u2Ss9-JM9Upswb8UAe5n8EyeypaC6_rMvL9E71XC8O6T_xiAvRPwUG2nc94CQWtGAOu0-EMPkoVRi7iizMI_XEHw4yBClOFl-coZWMaizqOBHh6QBswaWNFFYZQKyjC0VkJQofO5kT4wmQ6GxTDW", + theme: OnfidoTheme.AUTOMATIC, + flowSteps: { + welcome: true, + captureFace: { + type: OnfidoCaptureType.MOTION, + }, + captureDocument: { + docType: OnfidoDocumentType.DRIVING_LICENCE, + countryCode: OnfidoCountryCode.FRA, + }, + }, + }) + + console.log(res, "success12") + } catch (err) { + console.log(err, "error") + } + } + return ( @@ -255,6 +286,12 @@ export const DeveloperScreen: React.FC = () => { }) } /> +