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 #218

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Change Log
## [7.53.1](https://github.com/plivo/plivo-go/tree/v7.53.1) (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.

## [7.53.0](https://github.com/plivo/plivo-go/tree/v7.53.0) (2024-10-10)
**Feature - Dtmf param in Create, Get and List Session**
- Support for the `dtmf` parameter in voice verify session request
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 goSDK)
# Wait for the container to be running before attaching
@while [ -z "$$(docker-compose ps -q goSDK)" ]; do \
sleep 1; \
done
docker attach $$(docker-compose ps -q goSDK)

test:
@[ "${CONTAINER}" ] && \
Expand Down
2 changes: 1 addition & 1 deletion baseclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"encoding/json"
"errors"
"fmt"
"io/ioutil"

Check failure on line 8 in baseclient.go

View workflow job for this annotation

GitHub Actions / lint

SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
"net/http"
"net/url"
"reflect"
Expand All @@ -13,7 +13,7 @@
"github.com/google/go-querystring/query"
)

const sdkVersion = "7.53.0"
const sdkVersion = "7.53.1"

const lookupBaseUrl = "lookup.plivo.com"

Expand Down
16 changes: 14 additions & 2 deletions fixtures/verifySessionListResponse.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,20 @@
"recipient": "918707046409",
"channel": "sms",
"status": "expired",
"count": 1,
"count": 2,
"attempt_details": [
{
"channel": "sms",
"attempt_uuid": "237bb45f-6238-40fc-a27e-355dbaa8ec02",
"status": "failed",
"time": "2023-07-20T07:50:36.623172Z"
},
{
"channel": "sms",
"attemp_uuid": "237bb45f-6238-40fc-a27e-355dbaa8ec03",
"status": "failed",
"time": "2023-07-20T07:50:36.623172Z",
"fraud_check": "disabled"
}
],
"charges": {
Expand All @@ -60,7 +67,12 @@
"attempt_uuid": "237bb45f-6238-40fc-a27e-355dbaa8ec02",
"channel": "sms",
"charge": "0.00000"
}
},
{
"attempt_uuid": "237bb45f-6238-40fc-a27e-355dbaa8ec03",
"channel": "sms",
"charge": "0.00000"
}
]
},
"created_at": "2023-07-20T07:50:36.612725Z",
Expand Down
2 changes: 2 additions & 0 deletions verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type AttemptDetails struct {
CodeLength int `json:"code_length,omitempty"`
Time time.Time `json:"time,omitempty"`
Dtmf *int `json:"dtmf,omitempty"`
FraudCheck string `json:"fraud_check,omitempty"`
}

type Charges struct {
Expand Down Expand Up @@ -75,6 +76,7 @@ type SessionCreateParams struct {
AppHash string `json:"app_hash,omitempty"`
CodeLength int `json:"code_length,omitempty"`
Dtmf *int `json:"dtmf,omitempty"`
FraudCheck string `json:"fraud_check,omitempty"`
}

type SessionCreateResponseBody struct {
Expand Down
Loading