Skip to content

Commit 6085082

Browse files
committed
Implement SMS OTP timeout.
1 parent 6e210f6 commit 6085082

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 FraudLabsPro.com
3+
Copyright (c) 2020 FraudLabsPro.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ FraudLabsPro\Order::feedback([
171171
| ------------- | :-----------: | ------------------------------------------------------------ |
172172
| tel | string | The recipient mobile phone number in E164 format which is a plus followed by just numbers with no spaces or parentheses. |
173173
| mesg | string | The message template for the SMS. Add <otp> as placeholder for the actual OTP to be generated. Max length is 140 characters. |
174+
| otp_timeout | integer | Timeout feature for OTP value in seconds. Default is 3600 seconds(1 hour). Max timeout is 86400 seconds(24 hours). |
174175
| country_code | string | ISO 3166 country code for the recipient mobile phone number. If parameter is supplied, then some basic telephone number validation is done. |
175176

176177
```
@@ -183,7 +184,8 @@ FraudLabsPro\Configuration::apiKey('YOUR_API_KEY');
183184
FraudLabsPro\SMSVerification::sendsms([
184185
'tel' => '+15616288674',
185186
'mesg' => 'Hi, your OTP is <otp>.',
186-
'country_code' => 'US',
187+
'otp_timeout' => 3600,
188+
'country_code' => 'US',
187189
]);
188190
```
189191

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"type": "library",
44
"description": "FraudLabs Pro PHP SDK to help merchants to detect fraud order and therefore reduce chargebacks.",
55
"license": "MIT",
6-
"version": "2.0.3",
6+
"version": "2.1.0",
77
"authors": [
88
{
99
"name": "FraudLabs Pro",
10-
"homepage": "http://www.fraudlabspro.com"
10+
"homepage": "https://www.fraudlabspro.com"
1111
}
1212
],
1313
"require": {

lib/FraudLabsPro/SMSVerification.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public static function sendsms($params = [])
2727
'key' => Configuration::apiKey(),
2828
'format' => 'json',
2929
'tel' => (isset($params['tel'])) ? $params['tel'] : '',
30+
'otp_timeout' => (isset($params['otp_timeout'])) ? $params['otp_timeout'] : 3600,
3031
'mesg' => (isset($params['mesg'])) ? $params['mesg'] : '',
3132
'country_code' => (isset($params['country_code'])) ? $params['country_code'] : '',
3233
];

0 commit comments

Comments
 (0)