From 0c4a6b9e90490d21273418b184ba0be31f3b6279 Mon Sep 17 00:00:00 2001 From: mehmet-yoti Date: Mon, 13 Nov 2023 15:43:30 +0000 Subject: [PATCH] SDK-2386 updated examples --- _examples/idv/handlers.session.go | 8 ++++++++ _examples/idv/models.sessionspec.go | 8 +++++--- _examples/idv/routes.go | 1 + _examples/profile/.env.example | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/_examples/idv/handlers.session.go b/_examples/idv/handlers.session.go index a9e30e569..2abe7d270 100644 --- a/_examples/idv/handlers.session.go +++ b/_examples/idv/handlers.session.go @@ -223,3 +223,11 @@ func showPrivacyPolicyPage(c *gin.Context) { render(c, gin.H{}, "privacy.html") return } + +func showErrorPage(c *gin.Context) { + render(c, gin.H{ + "ErrorTitle": "Error Code", + "ErrorMessage": c.Request.URL.Query().Get("yotiErrorCode")}, + "error.html") + return +} diff --git a/_examples/idv/models.sessionspec.go b/_examples/idv/models.sessionspec.go index da365a28a..6f7c47481 100644 --- a/_examples/idv/models.sessionspec.go +++ b/_examples/idv/models.sessionspec.go @@ -98,6 +98,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { WithErrorUrl("https://localhost:8080/error"). WithPrivacyPolicyUrl("https://localhost:8080/privacy-policy"). WithIdDocumentTextExtractionGenericAttempts(2). + WithAllowHandOff(true). Build() if err != nil { return nil, err @@ -158,7 +159,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) { sessionSpec, err = create.NewSessionSpecificationBuilder(). WithClientSessionTokenTTL(600). - WithResourcesTTL(86400). + WithResourcesTTL(87000). WithUserTrackingID("some-tracking-id"). WithRequestedCheck(faceMatchCheck). WithRequestedCheck(documentAuthenticityCheck). @@ -203,7 +204,8 @@ func buildDBSSessionSpec() (sessionSpec *create.SessionSpecification, err error) identityProfile := []byte(`{ "trust_framework": "UK_TFIDA", "scheme": { - "type": "RTW" + "type": "DBS", + "objective": "BASIC" } }`) @@ -221,7 +223,7 @@ func buildDBSSessionSpec() (sessionSpec *create.SessionSpecification, err error) sessionSpec, err = create.NewSessionSpecificationBuilder(). WithClientSessionTokenTTL(600). - WithResourcesTTL(86400). + WithResourcesTTL(87000). WithUserTrackingID("some-tracking-id"). WithSDKConfig(sdkConfig). WithIdentityProfileRequirements(identityProfile). diff --git a/_examples/idv/routes.go b/_examples/idv/routes.go index 9140a3d3a..9112caa06 100644 --- a/_examples/idv/routes.go +++ b/_examples/idv/routes.go @@ -13,4 +13,5 @@ func initializeRoutes() { router.GET("/success", showSuccessPage) router.GET("/media", getMedia) router.GET("/privacy-policy", showPrivacyPolicyPage) + router.GET("/error", showErrorPage) } diff --git a/_examples/profile/.env.example b/_examples/profile/.env.example index 53041900f..3bd56f8dd 100644 --- a/_examples/profile/.env.example +++ b/_examples/profile/.env.example @@ -1,3 +1,5 @@ YOTI_SCENARIO_ID= YOTI_CLIENT_SDK_ID= YOTI_KEY_FILE_PATH= +# Optional configuration +YOTI_API_URL= \ No newline at end of file