Skip to content

Commit f0ea933

Browse files
authored
Merge pull request #4 from olotintemitope/feature/update-readme-and-config
Feature/update readme and config
2 parents aa68260 + 42c1496 commit f0ea933

File tree

8 files changed

+168
-226
lines changed

8 files changed

+168
-226
lines changed

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ return [
7070
* live or test
7171
*
7272
*/
73-
'mode' => 'test',
73+
'mode' => 'live', // test mode has been removed, the user must buy testing credit on the platform
7474

7575
/**
7676
* Public Key
@@ -81,6 +81,20 @@ return [
8181
];
8282
```
8383

84+
## Lumen Configuration
85+
- Open your bootstrap/app.php
86+
- Register your service provider
87+
- Add your Facade
88+
- Register the config
89+
90+
```php
91+
$app->register(Mujhtech\SendChamp\SendChampServiceProvider::class);
92+
$app->withFacades(true, [
93+
SendChamp::class => 'SendChamp',
94+
]);
95+
$app->configure('sendchamp');
96+
```
97+
8498
## Usage
8599

86100
Open your .env file and add your api key like so:
@@ -236,14 +250,14 @@ sendchamp()->sendWhatsappOtp($template_code, $message, $sender_number, $recipien
236250
/**
237251
* Send otp message
238252
* @param string $channel
239-
* @param string $token_type
240-
* @param int $token_length
241-
* The length of the token you want to send to your customer. Minimum is 4
253+
* @param string $token_type // numeric or alphanumeric
254+
* @param int $token_length
255+
* The length of the token you want to send to your customer. Minimum is 5
242256
* @param int $expiry_day
243-
* How long you want to the to be active for in minutes. (E.g 10 means 10 minutes )
257+
* How long you want to the to be active for in minutes. (E.g. 10 means 10 minutes )
244258
* @param string $customer_email
245259
* @param string $customer_mobile_number
246-
* @param array $meta_data
260+
* @param array $meta_data can be empty but you need to pass array like ['data' => []]
247261
* @param string $sender
248262
* Specify the sender you want to use. This is important
249263
* when using SMS OR Whatsapp Channel or we will select a
@@ -276,6 +290,9 @@ sendchamp()->confirmOtp($reference, $otp);
276290

277291
```
278292

293+
## Code Quality
294+
- Run `vendor/bin/pint`
295+
279296
## License
280297

281298
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
},
2626
"require-dev": {
2727
"phpunit/phpunit": "^9.5",
28-
"mockery/mockery": "^1.4"
28+
"mockery/mockery": "^1.4",
29+
"laravel/pint": "^1.2"
2930
},
3031
"authors": [
3132
{

config/sendchamp.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,29 @@
88
return [
99

1010
/**
11-
* Mode
11+
* Mode
1212
* live or test
13-
*
1413
*/
15-
'mode' => 'test',
16-
14+
'mode' => 'live',
1715

1816
/**
1917
* Live API url
20-
*
2118
*/
2219
'baseUrl' => 'https://api.sendchamp.com/api/v1',
2320

2421
/**
2522
* Test Api Url
26-
*
2723
*/
2824
'sandboxUrl' => 'https://sandbox-api.sendchamp.com/api/v1',
2925

3026
/**
3127
* Public Key
32-
*
3328
*/
3429
'publicKey' => getenv('SENDCHAMP_PUBLIC_KEY'),
3530

3631
/**
3732
* Webhook
38-
*
3933
*/
4034
'webhook' => getenv('SENDCHAMP_WEBHOOK'),
4135

42-
4336
];
44-
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22

3-
43
namespace Mujhtech\SendChamp\Exceptions;
54

65
use Exception;
76

87
class SendChampException extends Exception
98
{
10-
11-
}
9+
}

src/Facades/SendChamp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*
77
*/
88

9-
109
namespace Mujhtech\SendChamp\Facades;
1110

1211
use Illuminate\Support\Facades\Facade;
@@ -15,10 +14,11 @@ class SendChamp extends Facade
1514
{
1615
/**
1716
* Get the registered name of the component
17+
*
1818
* @return string
1919
*/
2020
protected static function getFacadeAccessor()
2121
{
2222
return 'laravel-sendchamp';
2323
}
24-
}
24+
}

src/Helpers.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
*
77
*/
88

9-
if (! function_exists("sendchamp"))
10-
{
11-
function sendchamp() {
12-
9+
if (! function_exists('sendchamp')) {
10+
function sendchamp()
11+
{
1312
return app()->make('laravel-sendchamp');
1413
}
15-
}
14+
}

0 commit comments

Comments
 (0)