Download the PHP package sparkworldke/kopokopo-laravel-support without Composer

On this page you can find all versions of the php package sparkworldke/kopokopo-laravel-support. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kopokopo-laravel-support

Laravel Kopokopo Package

A simple package for laravel developers to consume Kopokopo API for laravel 8.

Installation

You can easily install this package using composer and an installation command

Configuration

Next, after the package has been installed run this to publish config;

This will help in publishing config/kopokopo.php file. This kopokopo config file is where you will add all configurations for Kopokopo APIs. This includes the environment your application is running in(sandbox or production), callback URLs and required credentials.

For production you need to replace with production credentials and also set 'sandbox' => false.

For security reasons you may want to define your API credentials in env file. For example;

Usage

First things first...Authorization

N/B: You can skip the authorization step unless you need to carry out a number of operations in a single execution. Otherwise, the rest of the steps automatically acquire the access_token before calling the API>

Kopo Kopo uses Oauth2 to allow access to the Kopo Kopo API so before anything else, Kopokopo API expects the application access token to be used to make calls to the Kopo Kopo API on behalf of the application. To acquire the token, you need to call the token service like below:

Webhook Subscription

This API enables you to register the callback URLs via which you will receive payment notifications for payments and transaction that happen in your Kopo kopo app. To register Urls ensure all urls under webhooks are filled with valid urls in config/kopokopo.php. Checkout https://developers.kopokopo.com/guides/webhooks to understand what each webhook does.
When testing on sandbox you can use ngrok to expose your callbacks to the internet. Then call registerWebhooks() on Kopokopo facade. i.e

Webhook subscription via terminal commands:

Publish any webhook by running the command below in your terminal:

Example:

You may use the --all option to subscribe to all webhook specified in kopokopo webhooks config i.e

Alternatively:

Remember to first import Kopokopo facade with:\ use Kopokopo;

Upon successful creation of the webhook subscription, the api will return true, else you will get the exact error as json HTTP response;

Initiate Mpesa Payment (STK Push)

You can receive payments from M-PESA users via STK Push. You can initiate payment like this;

Upon a successful request a HTTP Status 201 will be returned and the location HTTP Header will contain the URL of the newly created Incoming Payment.

HTTP/1.1 201 Created Location: https://sandbox.kopokopo.com/api/v1/incoming_payments/247b1bd8-f5a0-4b71-a898-f62f67b8ae1c

Query Incoming Payment Status

Coming Soon

Create Payment Recipients

You can add external recipient that will be the destination of your payments in the future, sort of creating contacts. The following are the different types of pay recipients you can create with examples.

(a). Mobile Wallet

Create Pay Recipient for a Mobile Wallet recipient;

A HTTP response code of 201 is returned upon successful creation of the PAY recipient. The URL of the recipient resource is also returned in the HTTP Location Header

HTTP/1.1 201 Created Location: https://sandbox.kopokopo.com/api/v1/pay_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747

(b). Bank Account

Coming Soon

(c). External Till

Coming Soon

(c). Paybill

Coming Soon

Make Outgoing Payments

Coming Soon

Query Outgoing Payment Status

Coming Soon

Transfer to your settling account(s)

Transfer funds to your pre-approved settlement accounts (bank accounts or mobile wallets).

Coming Soon

Polling

Poll Buygoods Transactions between the specified dates for a particular till or for the whole company.

Coming Soon

Transaction SMS Notifications API Requests

Send sms notifications to your customer after you have received a payment from them.

Coming Soon

Change log

Please see the changelog for more information on what has changed recently.

Testing

Contributing

Thank you for considering contributing to laravel-kopokopo. Pull requests and issues welcome. Be sure to check open issues and PRs before continuing. Take a look at contributing.md to see a to do list.

Security Vulnerabilities

If you discover a security vulnerability within laravel-kopokopo, please send an e-mail to Michael Gatuma via [email protected]. All security vulnerabilities will be promptly addressed.

License

The laravel-kopokopo package is open-source software licensed under the MIT license

Tags

laravel, mpesa, kopokopo, k2-connect,k2-connect-php, laravel-mpesa, php, stk-push


All versions of kopokopo-laravel-support with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^9.0|^10.0 |^11.0
guzzlehttp/guzzle Version ^7.1
php Version ^8.0|^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sparkworldke/kopokopo-laravel-support contains the following files

Loading the files please wait ....