Skip to content

Commit

Permalink
Implement SMS OTP timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
fraudlabspro committed Sep 3, 2020
1 parent 6e210f6 commit 6085082
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 FraudLabsPro.com
Copyright (c) 2020 FraudLabsPro.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ FraudLabsPro\Order::feedback([
| ------------- | :-----------: | ------------------------------------------------------------ |
| tel | string | The recipient mobile phone number in E164 format which is a plus followed by just numbers with no spaces or parentheses. |
| mesg | string | The message template for the SMS. Add <otp> as placeholder for the actual OTP to be generated. Max length is 140 characters. |
| otp_timeout | integer | Timeout feature for OTP value in seconds. Default is 3600 seconds(1 hour). Max timeout is 86400 seconds(24 hours). |
| 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. |

```
Expand All @@ -183,7 +184,8 @@ FraudLabsPro\Configuration::apiKey('YOUR_API_KEY');
FraudLabsPro\SMSVerification::sendsms([
'tel' => '+15616288674',
'mesg' => 'Hi, your OTP is <otp>.',
'country_code' => 'US',
'otp_timeout' => 3600,
'country_code' => 'US',
]);
```

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"type": "library",
"description": "FraudLabs Pro PHP SDK to help merchants to detect fraud order and therefore reduce chargebacks.",
"license": "MIT",
"version": "2.0.3",
"version": "2.1.0",
"authors": [
{
"name": "FraudLabs Pro",
"homepage": "http://www.fraudlabspro.com"
"homepage": "https://www.fraudlabspro.com"
}
],
"require": {
Expand Down
1 change: 1 addition & 0 deletions lib/FraudLabsPro/SMSVerification.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static function sendsms($params = [])
'key' => Configuration::apiKey(),
'format' => 'json',
'tel' => (isset($params['tel'])) ? $params['tel'] : '',
'otp_timeout' => (isset($params['otp_timeout'])) ? $params['otp_timeout'] : 3600,
'mesg' => (isset($params['mesg'])) ? $params['mesg'] : '',
'country_code' => (isset($params['country_code'])) ? $params['country_code'] : '',
];
Expand Down

0 comments on commit 6085082

Please sign in to comment.