From 18b80788bfec51ad36729629de2a9fa6bb4ac6ce Mon Sep 17 00:00:00 2001 From: irotech Date: Wed, 25 Oct 2023 16:57:44 +0100 Subject: [PATCH] SDK-2352: Add share error reason to example module --- .../examples/springboot/IdentityLoginController.java | 4 ++++ .../springboot/IdentitySessionController.java | 4 ++-- .../src/main/resources/templates/error.html | 11 ++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentityLoginController.java b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentityLoginController.java index 68438b53..33a22983 100644 --- a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentityLoginController.java +++ b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentityLoginController.java @@ -73,6 +73,10 @@ public String receipt(@RequestParam("receiptId") String receiptId, Model model) if (receipt == null || receipt.getError().isPresent()) { model.addAttribute("error", receipt.getError().get()); + + receipt.getErrorReason() + .ifPresent(reason -> model.addAttribute("errorReason", reason)); + return "error"; } diff --git a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentitySessionController.java b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentitySessionController.java index e037e484..78c06f57 100644 --- a/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentitySessionController.java +++ b/yoti-sdk-spring-boot-example/src/main/java/com/yoti/api/examples/springboot/IdentitySessionController.java @@ -37,8 +37,8 @@ public IdentitySessionController(DigitalIdentityClient client) { public String identityShareSession() { ShareSession session = client.createShareSession( // forMinimalShare() - forDynamicScenarioShare() - // forIdentityProfileShare() + // forDynamicScenarioShare() + forIdentityProfileShare() // forLocationExtensionShare() ); diff --git a/yoti-sdk-spring-boot-example/src/main/resources/templates/error.html b/yoti-sdk-spring-boot-example/src/main/resources/templates/error.html index eed82bc9..168507d4 100644 --- a/yoti-sdk-spring-boot-example/src/main/resources/templates/error.html +++ b/yoti-sdk-spring-boot-example/src/main/resources/templates/error.html @@ -18,10 +18,19 @@

Home

Oops, something went wrong.

-

Error:

+

Error:

+ +
+

Reason:

+

+      
+ +