Download the PHP package shetabit/payment without Composer

On this page you can find all versions of the php package shetabit/payment. 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?
shetabit/payment
Rate from 1 - 5
Rated 3.00 based on 1 reviews

Informations about the package payment

Laravel Payment Gateway

Latest Version on Packagist Total Downloads on Packagist Tests Code Style Static Analysis Code Coverage

This is a Laravel Package for Payment Gateway Integration. This package requires PHP 8.4+ and supports Laravel 12+.

Donate me if you like this package :sunglasses: :bowtie:

For PHP integration you can use shetabit/multipay package.

This packages works with multiple drivers, and you can create custom drivers if you can't find them in the current drivers list (below list).

List of contents

List of available drivers

Help me to add the gateways below by creating pull requests

you can create your own custom drivers if it does not exist in the list, read the Create custom drivers section.

Install

Via Composer

Publish Vendor Files

Configure

The service provider and the Payment alias are registered by Laravel's package discovery, so there is nothing to add to config/app.php (or to bootstrap/providers.php).

In the config file you can set the default driver to use for all your payments. But you can also change the driver at runtime.

Choose what gateway you would like to use in your application. Then make that as default driver so that you don't have to specify that everywhere. But, you can also use multiple gateways in a project.

Then fill the credentials for that gateway in the drivers array.

How to use

your Invoice holds your payment details, so initially we'll talk about Invoice class.

Working with invoices

before doing any thing you need to use Invoice class to create an invoice.

In your code, use it like the below:

available methods:

Purchase invoice

In order to pay the invoice, we need the payment transactionId. We purchase the invoice to retrieve transaction id:

Pay invoice

After purchasing the invoice, we can redirect the user to the bank payment page:

Verify payment

When user has completed the payment, the bank redirects them to your website, then you need to verify your payment in order to ensure the invoice has been paid.

Useful methods

Create custom drivers:

First you have to add the name of your driver, in the drivers array and also you can specify any config parameters you want.

Now you have to create a Driver Map Class that will be used to pay invoices. In your driver, You just have to extend Shetabit\Payment\Abstracts\Driver.

Eg. You created a class: App\Packages\PaymentDriver\MyDriver.

Once you create that class you have to specify it in the payment.php config file map section.

Note:- You have to make sure that the key of the map array is identical to the key of the drivers array.

Events

You can listen for 2 events

Both events expose the driver and the invoice they were dispatched for as readonly properties, and the verification event exposes the receipt as well:

Testing

Every pull request and every push to master is checked by GitHub Actions: the test suite runs on PHP 8.4 and 8.5, against Laravel 12 and 13 and against both the lowest and the highest supported dependencies, the coding style is checked with PHP_CodeSniffer, the sources are analysed with PHPStan and the code coverage of the test suite is measured and has to stay above 95%.

You can run the same checks locally. With PHP and Composer installed on your machine:

If you would rather not install PHP on your machine, the shipped Dockerfile and Makefile run everything inside a container:

Another PHP version can be used with make test PHP_VERSION=8.5, and a single Laravel version with make test-laravel LARAVEL=12.

Change log

Please see CHANGELOG for more information on what has been changed recently.

Contributing

Please see CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Star History

Star History Chart


All versions of payment with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/broadcasting Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/view Version ^12.0|^13.0
shetabit/multipay Version ^3.0.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 shetabit/payment contains the following files

Loading the files please wait ...