From 84638c7ffcaee20a64f07f3de61cc7c50ee73fed Mon Sep 17 00:00:00 2001 From: Mohamed Yousif Date: Thu, 21 Jul 2022 10:59:10 +0200 Subject: [PATCH] add helper methods to get keys from ebs response --- .../java/com/tuti/api/data/TutiResponse.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/src/main/java/com/tuti/api/data/TutiResponse.java b/lib/src/main/java/com/tuti/api/data/TutiResponse.java index 3db98ac..67062b9 100644 --- a/lib/src/main/java/com/tuti/api/data/TutiResponse.java +++ b/lib/src/main/java/com/tuti/api/data/TutiResponse.java @@ -3,6 +3,10 @@ import com.google.gson.annotations.SerializedName; import com.tuti.api.ebs.EBSResponse; +/** + * TutiResponse class the encapsulates all noebs responses. Reference class to get + * values for about any field + */ public class TutiResponse { private String message; private String code; @@ -11,6 +15,19 @@ public String getStatus() { return status; } + // get EBS public key for IPIN generation + public String getiPINKey() { + return this.getEbsResponse().getPubKeyValue(); + } + + /** + * get EBS public key for encryption (used throughout the code to encrypt all transactions except for IPIN generation. Check {@link #getiPINKey()} instead + */ + public String getKey() { + return this.getEbsResponse().getPubKeyValue(); + } + + public void setStatus(String status) { this.status = status; }