Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMS-7107: Add fraud_check param support #291

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Change Log
## [5.45.3](https://github.com/plivo/plivo-java/tree/v5.45.3)(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.2](https://github.com/plivo/plivo-java/tree/v5.45.2) (2024-10-14)
**Feature - Fix all null returning params in MMS API Responses**
- Fix MMS API parameters returning NULL and match response with Public APIs
Expand All @@ -8,7 +13,7 @@
**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
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ] && \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.2/plivo-java-5.45.2.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.3/plivo-java-5.45.3.jar).


If you are using Maven, use the following XML to include the Plivo SDK as a dependency.
Expand All @@ -19,13 +19,13 @@ If you are using Maven, use the following XML to include the Plivo SDK as a depe
<dependency>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.45.2</version>
<version>5.45.3</version>
</dependency>
```

If you are using Gradle, use the following line in your dependencies.
```
compile 'com.plivo:plivo-java:5.45.2'
compile 'com.plivo:plivo-java:5.45.3'
```

### To Install Beta release
Expand Down
2 changes: 1 addition & 1 deletion pom.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Written manually.

version=5.45.2
version=5.45.3
groupId=com.plivo
artifactId=plivo-java

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.45.2</version>
<version>5.45.3</version>
<name>plivo-java</name>
<description>A Java SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML</description>
<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(){}
Expand Down Expand Up @@ -47,4 +49,7 @@ public Integer getCodeLength(){
public Integer getDtmf(){
return dtmf;
}
public String getFraudCheck(){
return fraudCheck;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -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() {
Expand Down Expand Up @@ -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<SessionCreateResponse> obtainCall() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/com/plivo/api/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.45.2
5.45.3
4 changes: 2 additions & 2 deletions src/test/java/com/plivo/api/VerifySessionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ 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();
}

@Test
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();
}

Expand Down
Loading