Download the PHP package hen8y/laravel-vpay without Composer

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

laravel-vpay

downloads

Installation

PHP 7.2, LARAVEL, and Composer are required.

To get the latest version of Laravel Vpay, simply require it

Or add the following line to the require block of your composer.json file.

You'll then need to run composer install or composer update to download it and have the autoloader updated.

Once Laravel Vpay is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

You can publish the configuration file and assets by running:

Important

The url below is for your vpay webhook, don't include it as part of your routes. Callbacks are not as efficient as webhooks, so we've crafted this package to use webhooks mainly but you can opt for the callback option

Visit Vpay dashboard and add https://yoursite.com/payment/webhook/pay as your webhook url in the settings

Configuration

If you want to use the webhook make sure to publish the job file:

A file would be created

Details of the Config file

The configuration-file named vpay.php with some defaults that was placed in your config directory:

Usage

Exclude the webhook url from CSRF verification

Open your VerifyCsrfToken Middleware file located in app/Http/Middleware and add the url like this:

Open your .env file and add your public key, secret key, merchant email and payment url like so:

Set up your redirect & callback route :

Set up your payment controller to send the payment details

If you opt to use the webhook, if not you can skip this step

Set up your Job to handle the Payment Webhook, The Job was already Published after you ran the php artisan vpay:publish command:

In app/Jobs you would see a file VpayJob, edit it to handle the webhook data after every successful transaction. Visit Vpay Docs to view the payload data

Sample Html/Bootstrap Form

After clicking the submit button the customer gets redirected a checkout page.

After the customer does some actions there and now gets redirected back to either the success or failure route with callback data.

For webhook

Vpay would send some data to the webhook (remember to exclude the webhook url from CSRF verification). This webhook will contain some information as its payload. Additionally, a JWT token will accompany this payload, with {secret: your_secret_key} as its content.

We must validate if the redirect to our site is a valid request (we don't want imposters to wrongfully place non-paid order).

The webhook url payment/webhook/vpay is secured using a middleware (you don't have to set up any middleware as it has been set already in this package). This decodes the JWT token and compare its secret payload with the secret-key added in the env file, on success it dispatches a job to queue, check the Job in your App/Job and handle the details

Make sure to run 👇 for the job on queue

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

Don't forget to follow me on twitter!

Thanks! Ogbonna Henry (hen8y).

License

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


All versions of laravel-vpay with dependencies

PHP Build Version
Package Version
Requires php Version ~8.0
adhocore/jwt Version 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 hen8y/laravel-vpay contains the following files

Loading the files please wait ....