diff --git a/README.md b/README.md index a3bda2b..0bc3db5 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,14 @@ The SDK needs to be instantiated using your username and API key, which you can ```php send($options); ``` The options array `$options` has the following keys: + +- `message`: SMS content. `REQUIRED` - `to`: A single recipient or an array of recipients. `REQUIRED` - array of recipients contains - `from`: Shortcode or alphanumeric ID that is registered with Africa's Talking account. -- `message`: SMS content. `REQUIRED` +- `enqueue`: Do not wait for an acknowledgement form telcos. #### Send Premium SMS diff --git a/example/composer.json b/example/composer.json index e149439..c0fdfca 100644 --- a/example/composer.json +++ b/example/composer.json @@ -3,7 +3,7 @@ "description": "Simple SDK usage", "require": { "php": ">=5.3.0", - "africastalking/africastalking": "2.0.0", + "africastalking/africastalking": "2.0.1", "altorouter/altorouter": "1.1.0" } } \ No newline at end of file diff --git a/example/composer.lock b/example/composer.lock index cb5a88a..96f722e 100644 --- a/example/composer.lock +++ b/example/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "73fc49b76ba9d8ba0b26bae9dec6da19", + "content-hash": "aba9d0587ebc14cee5eaa221c13ebbc8", "packages": [ { "name": "africastalking/africastalking", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/AfricasTalkingLtd/africastalking-php.git", - "reference": "66db63b06dfa99c5674991340ccd58a39ba3591a" + "reference": "0c30aacb9f19cec623a67d64746f1e6334d26e9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/AfricasTalkingLtd/africastalking-php/zipball/66db63b06dfa99c5674991340ccd58a39ba3591a", - "reference": "66db63b06dfa99c5674991340ccd58a39ba3591a", + "url": "https://api.github.com/repos/AfricasTalkingLtd/africastalking-php/zipball/0c30aacb9f19cec623a67d64746f1e6334d26e9d", + "reference": "0c30aacb9f19cec623a67d64746f1e6334d26e9d", "shasum": "" }, "require": { @@ -40,23 +40,8 @@ ], "authors": [ { - "name": "Ian Juma", - "email": "ijuma@africastalking.com", - "homepage": "https://www.africastalking.com" - }, - { - "name": "Stephen Afam-Osemene", - "email": "s.afamo@africastalking.com", - "homepage": "https://www.africastalking.com" - }, - { - "name": "Paul Bombo", - "email": "pbombo@africastalking.com", - "homepage": "https://www.africastalking.com" - }, - { - "name": "Salama Balekage", - "email": "sbalekage@africastalking.com", + "name": "Africas's Talking", + "email": "support@africastalking.com", "homepage": "https://www.africastalking.com" } ], @@ -71,7 +56,7 @@ "ussd", "voice" ], - "time": "2018-03-07T08:35:13+00:00" + "time": "2018-03-07T11:52:37+00:00" }, { "name": "altorouter/altorouter", diff --git a/src/SMS.php b/src/SMS.php index d249f30..b5a006a 100644 --- a/src/SMS.php +++ b/src/SMS.php @@ -20,6 +20,10 @@ protected function doSend ($options, $isBulk, $isPremium) ]; if ($isBulk === true){ + $data['bulkSMSMode'] = 1; + } + + if (array_key_exists('enqueue', $options) && $options['enqueue']) { $data['enqueue'] = 1; } diff --git a/tests/Fixtures.php b/tests/Fixtures.php deleted file mode 100644 index 8d44eec..0000000 --- a/tests/Fixtures.php +++ /dev/null @@ -1,152 +0,0 @@ - '4111111111111111', - 'cvvNumber' => 654, - 'expiryMonth' => 7, - 'expiryYear' => 2019, - 'authToken' => '2345', - 'countryCode' => 'NG', - ]; - public static $bankCode = ''; - public static $bankAccount = [ - 'accountName' => 'Test Bank Account', - 'accountNumber' => '1234567890', - 'bankCode' => 234001, - 'dateOfBirth' => '' - ]; - public static $metadata = ['name' => 'Lip Gallagher']; - public static $transactionId = 'ATPid_SampleTxnId1'; - public static $otp = '1234'; - public static $bankCheckoutToken = ''; - public static $B2BRecipients = array([ - 'name' => '', - 'phoneNumber' => '', - 'amount' => '', - 'providerChannel' => '', - 'reason' => '' - ]); - - public static $B2CRecipients = array([ - 'name' => 'PB', - 'phoneNumber' => '254724486449', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ]); - - public static $ElevenB2CRecipients = array([ - 'name' => 'PB', - 'phoneNumber' => '254724486449', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB1', - 'phoneNumber' => '254724486440', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB2', - 'phoneNumber' => '254724486441', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB3', - 'phoneNumber' => '254723486549', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB4', - 'phoneNumber' => '254723486449', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB5', - 'phoneNumber' => '254724486454', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB6', - 'phoneNumber' => '254724486446', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB7', - 'phoneNumber' => '254724486400', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB8', - 'phoneNumber' => '254724486408', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB9', - 'phoneNumber' => '254724486409', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - [ - 'name' => 'PB10', - 'phoneNumber' => '254724486410', - 'amount' => '60', - 'currencyCode' => 'KES', - 'reason' => 'SalaryPayment', - 'metadata' => ['notes' => 'Salary for January 2018'] - ], - ); -} \ No newline at end of file