Download the PHP package bryceandy/laravel-selcom without Composer

On this page you can find all versions of the php package bryceandy/laravel-selcom. 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 laravel-selcom

Selcom package for Laravel apps

Actions Status Total Downloads Latest Stable Version License

This package enables Laravel developers to integrate their websites/APIs with all Selcom API services

Installation

Pre-installation requirements

Then proceed to install:

Configuration

To access Selcom's APIs, you will need to provide the package with access to your Selcom vendorID, API Key and Secret Key.

After obtaining the three credentials from Selcom support, add their values in the .env variables:

Note that when starting you will be provided with test credentials.

When you change to live credentials don't forget to change SELCOM_IS_LIVE to true.

We are going to update more configuration settings as we move along, but feel free to publish the config to fully customize it.

Run the migration command to create a table that stores Selcom payments:

Checkout API

Checkout is the simplest Selcom API we can start processing payments with.

Checkout payments using USSD

This API automatically pulls your user's USSD payment menu directly after being called.

Note: As of now, this is only applicable to AirtelMoney and TigoPesa customers.

Other networks may use USSD checkout manually with tokens as shown with other checkout options below.

Checkout to the payments page (without cards)

The payment page contains payment options such as QR code, Masterpass, USSD wallet pull, mobile money payment with tokens.

To redirect to this page, we will use the previous example, but return without the no_redirection option or assign it to false:

Checkout to the payments page (with cards)

To use the cards on the payment page, return the following request:

Optionally, you may specify using the .env file the following:

If you feel lazy, this package already ships with these pages for you. And if you want to customize them, run:

Customizing the payment page theme

The configuration contains a colors field which specifies the theme of your payment page.

To customize the colors, add the color values in the .env file:

For JSON requests (API applications), this type of checkout to the payments page will return data with payment_gateway_url instead of redirecting to that page:

Checkout payments with cards (without navigating to the payment page)

To use a card without navigating to the payment page, you need to have already created a card for the paying user by navigating to the payment page.

This is very useful for recurring or on-demand card payments. The data is the same as the previous card checkout, except we are adding no_redirection, user_id & buyer_uuid:

This method will fetch 3 saved cards of the user and try all of them until a payment is successful or all fail.

Obtaining the buyer's UUID

If this user has visited the payment page before to make a payment, then their uuid is already in the database.

Listing a user's stored cards

To fetch the user's stored cards could be useful to know if a user has cards, or if there is a need to delete.

You will require a user's ID and buyer_uuid:

Deleting a user's stored card

To delete a user's stored card you need a buyer_uuid and card ID obtained from fetchCards request above.

Checkout webhook/callback

The package comes with an implementation of the payment webhook.

When Selcom sends the payment status to your site, the data in the selcom_payments table will be updated and an event Bryceandy\Selcom\Events\CheckoutWebhookReceived will be dispatched.

You can create a listener for the event:

Then in your listener App\Listeners\ProcessWebhook, you can do anything with the order ID:

Check order status

To query order statuses to Selcom, simply run:

Once you have obtained the order data, you can use it as you wish. The example below updates the payment in the database:

List orders

To list all orders made to Selcom, simply indicate from_date and to_date:

Cancel order

To cancel a Selcom order, simply run:


All versions of laravel-selcom with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
ext-curl Version *
guzzlehttp/guzzle Version ^7.3
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 bryceandy/laravel-selcom contains the following files

Loading the files please wait ....