Download the PHP package phelix/safaricom-sdp without Composer
On this page you can find all versions of the php package phelix/safaricom-sdp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package safaricom-sdp
Safaricom SDP SDK by Phelix Juma
This is a PHP SDK wrapper for Safaricom SDP. Safaricom SDK allows PRSP content providers to integrate their systems with Safaricom's platform.
Included SDP Services
- Token
- Get Token API : getting a token
- Refresh Token API : getting a refresh token
- Subscription API
- Activate API : for subscribing a new user
- Deactivate API : for deactivating a user from the subscription
- Premium SMS
- SendSMS API : Sending SMS to a user in a premium service
- Bulk SMS
- Bulk SMS API : Sending Bulk SMS to a set of users
Requirements
- PHP >= 7.1
- ext-json
- ext-openssl
- ext-mbstring
- ext-openssl
- ext-iconv
- ext-curl
- guzzlehttp/guzzle: "^7.1"
Installation
composer require phelix/safaricom-sdp
How To test
To test the package, copy the file "LoadEnv.php.example" in src/tests directory to "LoadEnv.php" and fill in the configuration values required and then run the following command
phpunit test
Documentation
The docs folder has the technical documentation of each of the classes,methods, properties, namespaces et al. In order for you to make references to know what a class does or what a function does or what each of the method parameters mean, then the docs have an elaborate description for each of them.
1. Send Premium SMS
This is used when sending a premium SMS service to a user; typically an MT message.
1. Activate a Subscription
This is used when subscribing a new user to a service
3. Deactivate a Subscription
This is used when unsubscribing a user from a service
4. Send Bulk SMS
This is used when sending bulk sms to users
5. Bulk SMS Callback
This is used when getting and handling bulk sms callback
6. SDK General Response Structure
- success: Can be true | false. It implies success in submitting request to SDP. should not be confused to mean success of the operation eg sending sms
- statusCode: Http status code from SDP eg 200,400,401,500. Standard definitions apply
- statusText: Http status text corresponding to the status code. standard definitions apply
- errorCode: Error code from SDP. This depends on the SDP error codes for the specific SDP API eg sendSMS, bulkSMS, subscription APIs could each have their own error codes denoting different meanings
- errorMessage: The message from SDP describing the error
- data: Has the response data from SDP in case of a success. If "success" is false, this value will be null. The data comes in different formats depending on the specific API being used
- debugTrace: This contains a request and response trace. If 'SFC_SDP_DEBUG' is set to 1, this value will be set and can help debug an error. If the config value is 0, then this field will be null
7. Sample Response Examples
- All the response structures described below apply for the "data" key of the response structure described in section 6.
i.Get Token API
ii.Refresh Token API
iii.Activate Subscription API
iv.Deactivate Subscription API
v.Send SMS
vi.Bulk SMS
vii. Bulk SMS Callback
Credits
- Phelix Juma from Kuza Lab Ltd ([email protected])
All versions of safaricom-sdp with dependencies
ext-openssl Version *
ext-iconv Version *
ext-curl Version *
guzzlehttp/guzzle Version ~6.0