Download the PHP package devinweb/laravel-hyperpay without Composer

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

Laravel HyperPay

tests StyleCI Shield Latest Version on Packagist Total Downloads

Laravel HyperPay provides an easy way to handle all the transactions with different states.

Installation

You can install the package via composer:

Database migration

Laravel-hyperpay provides a migration to handle its own transaction, don't forget to publish the migration after installation

Then migrate

This migration has a model named Transaction, if your app use multi-tenancy, you can create a new transaction model based on the hyperpay transaction model.

then don't forget the update the transaction_model path in the config file app/hyperpay.php

Setup and configuration

You can also publish the config file using

After that you can see the file in app/hyperpay.php

Before start using Laravel-hyperpay, add the ManageUserTransaction trait to your User model, this trait provides mutliple tasks to allow you to perform the transaction process from the given user.

This package use User model that will be App\User or App\Models\User, if else you can define your user model using the .env

HyperPay Keys

Next, you should configure your hyperpay environment in your application's .env

Creating a transaction

To create a transaction in hyperpay using this package, we need to to prepare the checkout then generate the form.

Prepare the checkout

you can also attach the billing data to the checkout by creating the billing class using this command, all billing files you can find them in app/Billing folder.

then use

You can also generate your own merchantTransactionId and tell the package to use it, by using addMerchantTransactionId($id)

Next the response returned by the prepareCheckout actions

To create the payment form you just need to add the following lines of HTML/JavaScript to your page.

Payment status

After the transaction process hyperpay redirect the user to the merchant page using the shopperResultUrl that you can configure it in the config file app/hyperpay.php, by updating the redirect_url value.

You can also add redirect_url dynamically via addRedirectUrl($url) that can override the default config redirect_url if you want to add a dynamic url like if you use multi-tenant or add some parameters to your redirection url.

After redirection you can use an action the handle the finalize step

Events handlers

Laravel-hyperpay providers two events during the transaction process, after finalize this package fire for successfull transaction

Event Description
Devinweb\LaravelHyperpay\Events\SuccessTransaction success transaction
Devinweb\LaravelHyperpay\Events\FailTransaction fail transaction

Each event of them contains the trackable_data and hyperpay_data that used to prepare the checkout

Listener exemple

First we start by creating a new listener using

After that go to app/Providers/EventServiceProvider and register the event with your listener

In each success transaction laravel-hyperpay package fire an event with the necessary data take a look at our TransactionSuccessListener class.

The same you can do with Devinweb\LaravelHyperpay\Events\FailTransaction event.

Testing

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING 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.

Laravel hyperpay Boilerplate

You can use this repository to check the integration of the package laravel-hyperpay-boilerplate.


All versions of laravel-hyperpay with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
guzzlehttp/guzzle Version ^7.0
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 devinweb/laravel-hyperpay contains the following files

Loading the files please wait ....