From dfa06d1ebaf977ddd9eba37fd8657f518cc3a41a Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Wed, 16 Oct 2024 17:40:18 +0530 Subject: [PATCH 1/3] SMS-7107: Add fraud_check param support --- CHANGELOG.md | 7 ++++++- README.md | 6 +++--- pom.properties | 2 +- pom.xml | 2 +- .../plivo/api/models/verify_session/AttemptDetail.java | 7 ++++++- .../plivo/api/models/verify_session/SessionCreator.java | 8 +++++++- .../plivo/api/models/verify_session/VerifySession.java | 4 ++-- src/main/resources/com/plivo/api/version.txt | 2 +- 8 files changed, 27 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83efe1ae..380f63bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,14 @@ # Change Log +## [5.45.2](https://github.com/plivo/plivo-java/tree/v5.45.2)(2024-10-16) +**Feature - fraudCheck param in Create, Get and List Session** +- Support for the `fraud_check` parameter in sms verify session request +- Added support for `fraud_check` in GET and LIST verify session + ## [5.45.1](https://github.com/plivo/plivo-java/tree/v5.45.1) (2024-10-10) **Feature - Dtmf param in Create, Get and List Session** - Support for the `dtmf` parameter in voice verify session request - Added support for `dtmf` in GET and LIST verify session -- + ## [5.45.0](https://github.com/plivo/plivo-java/tree/v5.45.0) (2024-09-30) **Feature - Adding new param support for Number Masking session with single party ** - Added `create_session_with_single_party`, `virtual_number_cooloff_period` and `force_pin_authentication` attributes in Masking Session diff --git a/README.md b/README.md index 74976adc..590fe5ff 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The Plivo Java SDK makes it simpler to integrate communications into your Java a ### To Install Stable release -You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.45.1/plivo-java-5.45.1.jar). +You can use this SDK by adding it as a dependency in your dependency management tool. Alternatively, you can use the [JAR file](https://search.maven.org/remotecontent?filepath=com/plivo/plivo-java/5.45.2/plivo-java-5.45.2.jar). If you are using Maven, use the following XML to include the Plivo SDK as a dependency. @@ -19,13 +19,13 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe com.plivo plivo-java - 5.45.1 + 5.45.2 ``` If you are using Gradle, use the following line in your dependencies. ``` -compile 'com.plivo:plivo-java:5.45.1' +compile 'com.plivo:plivo-java:5.45.2' ``` ### To Install Beta release diff --git a/pom.properties b/pom.properties index 2795cc05..495fdcbe 100644 --- a/pom.properties +++ b/pom.properties @@ -1,6 +1,6 @@ # Written manually. -version=5.45.1 +version=5.45.2 groupId=com.plivo artifactId=plivo-java diff --git a/pom.xml b/pom.xml index deb56acc..a17b448d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.plivo plivo-java - 5.45.1 + 5.45.2 plivo-java A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML diff --git a/src/main/java/com/plivo/api/models/verify_session/AttemptDetail.java b/src/main/java/com/plivo/api/models/verify_session/AttemptDetail.java index 456ee6dc..631a0766 100644 --- a/src/main/java/com/plivo/api/models/verify_session/AttemptDetail.java +++ b/src/main/java/com/plivo/api/models/verify_session/AttemptDetail.java @@ -9,8 +9,9 @@ public class AttemptDetail { private String appHash; private Integer codeLength; private Integer dtmf; + private String fraudCheck; - public AttemptDetail(String channel, String attemptUuid, String status, String time, String brandName, String appHash, Integer codeLength, Integer dtmf) { + public AttemptDetail(String channel, String attemptUuid, String status, String time, String brandName, String appHash, Integer codeLength, Integer dtmf, String fraudCheck) { this.channel = channel; this.attemptUuid = attemptUuid; this.status = status; @@ -19,6 +20,7 @@ public AttemptDetail(String channel, String attemptUuid, String status, String t this.appHash = appHash; this.codeLength = codeLength; this.dtmf = dtmf; + this.fraudCheck = fraudCheck; } public AttemptDetail(){} @@ -47,4 +49,7 @@ public Integer getCodeLength(){ public Integer getDtmf(){ return dtmf; } + public String getFraudCheck(){ + return fraudCheck; + } } diff --git a/src/main/java/com/plivo/api/models/verify_session/SessionCreator.java b/src/main/java/com/plivo/api/models/verify_session/SessionCreator.java index a992a457..830d28e0 100644 --- a/src/main/java/com/plivo/api/models/verify_session/SessionCreator.java +++ b/src/main/java/com/plivo/api/models/verify_session/SessionCreator.java @@ -27,8 +27,10 @@ public class SessionCreator extends Creator < SessionCreateResponse > { private String method = "POST"; @JsonProperty("dtmf") private Integer dtmf; + @JsonProperty("fraud_check") + private String fraud_check; - SessionCreator(String appUUID,String recipient, String channel, String url, String method, String locale, String brand_name, String app_hash, Integer code_length, Integer dtmf) { + SessionCreator(String appUUID,String recipient, String channel, String url, String method, String locale, String brand_name, String app_hash, Integer code_length, Integer dtmf, String fraud_check) { if (!Utils.allNotNull(recipient)) { throw new IllegalArgumentException("recipient should not be null"); } @@ -42,6 +44,7 @@ public class SessionCreator extends Creator < SessionCreateResponse > { this.app_hash = app_hash; this.code_length = code_length; this.dtmf = dtmf; + this.fraud_check = fraud_check; } public String appUUID() { @@ -74,6 +77,9 @@ public Integer code_length(){ public Integer dtmf(){ return this.dtmf; } + public String fraud_check(){ + return this.fraud_check; + } @Override protected Call obtainCall() { diff --git a/src/main/java/com/plivo/api/models/verify_session/VerifySession.java b/src/main/java/com/plivo/api/models/verify_session/VerifySession.java index 149cd875..f2c69240 100644 --- a/src/main/java/com/plivo/api/models/verify_session/VerifySession.java +++ b/src/main/java/com/plivo/api/models/verify_session/VerifySession.java @@ -26,8 +26,8 @@ public class VerifySession extends BaseResource { private Charges charges; private String createdAt; private String updatedAt; - public static SessionCreator creator(String appUUID, String recipient, String channel, String url, String method, String locale, String brand_name, String app_hash, Integer code_length, Integer dtmf) { - return new SessionCreator(appUUID, recipient, channel, url, method, locale, brand_name, app_hash, code_length, dtmf); + public static SessionCreator creator(String appUUID, String recipient, String channel, String url, String method, String locale, String brand_name, String app_hash, Integer code_length, Integer dtmf, String fraud_check) { + return new SessionCreator(appUUID, recipient, channel, url, method, locale, brand_name, app_hash, code_length, dtmf, fraud_check); } public static ValidateSession validation(String sessionUUID, String otp) { return new ValidateSession(sessionUUID, otp); diff --git a/src/main/resources/com/plivo/api/version.txt b/src/main/resources/com/plivo/api/version.txt index 8f04f20f..7eedc2d5 100644 --- a/src/main/resources/com/plivo/api/version.txt +++ b/src/main/resources/com/plivo/api/version.txt @@ -1 +1 @@ -5.45.1 +5.45.2 \ No newline at end of file From 4e8ed575ab77b850a992ad8c2c829c8c198a4ee1 Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Thu, 17 Oct 2024 16:31:19 +0530 Subject: [PATCH 2/3] Fix make start and UT --- Makefile | 6 +++++- src/test/java/com/plivo/api/VerifySessionTest.java | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2fa57549..a8dd5067 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,11 @@ build: start: docker-compose up --build --remove-orphans --detach - docker attach $(shell docker-compose ps -q javaSDK) + # Wait for the container to be running before attaching + @while [ -z "$$(docker-compose ps -q javaSDK)" ]; do \ + sleep 1; \ + done + docker attach $$(docker-compose ps -q javaSDK) test: @[ "${CONTAINER}" ] && \ diff --git a/src/test/java/com/plivo/api/VerifySessionTest.java b/src/test/java/com/plivo/api/VerifySessionTest.java index 5f02720d..affa0d2f 100644 --- a/src/test/java/com/plivo/api/VerifySessionTest.java +++ b/src/test/java/com/plivo/api/VerifySessionTest.java @@ -28,7 +28,7 @@ public void setUp() throws Exception { public void invalidSessionCreated() throws Exception { expectResponse("createSession.json", 202); - VerifySession.creator(null,null, null, null, null,null, null, null, 0, null) + VerifySession.creator(null,null, null, null, null,null, null, null, 0, null, null) .create(); } @@ -36,7 +36,7 @@ public void invalidSessionCreated() throws Exception { public void sessionCreated() throws Exception { expectResponse("createSession.json", 202); - VerifySession.creator(null,"+1234567890", null, null, null, null, null, null, 0, null) + VerifySession.creator(null,"+1234567890", null, null, null, null, null, null, 0, null, null) .create(); } From 04612e997a40835ab546ef0ab4d1c3fbc7f52fd0 Mon Sep 17 00:00:00 2001 From: mohsin-plivo Date: Wed, 23 Oct 2024 11:23:55 +0530 Subject: [PATCH 3/3] Update date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0294bf57..1add06c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Change Log -## [5.45.3](https://github.com/plivo/plivo-java/tree/v5.45.3)(2024-10-16) +## [5.45.3](https://github.com/plivo/plivo-java/tree/v5.45.3)(2024-10-23) **Feature - fraudCheck param in Create, Get and List Session** - Support for the `fraud_check` parameter in sms verify session request - Added support for `fraud_check` in GET and LIST verify session