Download the PHP package nyawach/laravel-pesapal without Composer

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

Pesapal V3 Package for Laravel Applications

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

This package enables you to set up Pesapal V3 web payment in under 5 minutes

Preinstallation requirements

  1. Laravel 8*
  2. PHP 7.4 or higher
  3. CURL installed

Installation

composer require nyawach/laravel-pesapal

configuration

To publish the pesapal config file and migrations run:

Sample Config file

Refer to config/pesapal.php and create environment variable in your .env file. See example below.

PEASAPAL_ENV: Please specify whether the environment is sandbox or production PESAPAL_CONSUMER_KEY and PESAPAL_CONSUMER_SECRET Production keys can be obtained here. Sandbox or testing keys can be found here PESAPAL_GUARD: It is good practice to guard your callback and notification URLs. Think of a unique string and set it as your guard. This is how the URL will look like: https://www.myapplication/callback/ahd55hrg57edhWYDGSS

PESAPAL_IPN_ID: For production use this form to create IPN URLs and save the id. For testing or sandbox use this form. IPN URL can either be POST or GET choose the one you feel for comfortable with.

IPN stands for Instant Payment Notification. When a payment is made against a transaction, Pesapal will trigger an IPN call to the notification URL related to this transaction. This notification URL is usually located on your servers. These notifications allows you to be alerted in real time whenever there is a status change for any transaction.

An IPN is particular important as it allows you to be notified incase the following happens:

  1. Your client gets disconnected after payment due to internet issues
  2. Your client experiences server errors hence Pesapal and your application gets disconnected before callback URL is loaded.
  3. Your client exits your application / closes the browser during payment.
  4. The transaction is rejected.
Alternatively register IPN URLs

In your controller

Make sure you have saved the IPN id in your .env file.

A successful IPN registration response will look like this.

Submitting an order request

The way Pesapal works is that you submit an order request. A successful order will return a response containing order_tracking_id and an Iframe link. you can render the payment iframe within your website or redirect users to the iframe link to make payments. Thereafter you can submit a request to get the payment status.

It is also important that you save the order details in you database.

See below on how to submit an order request

On a successful order request, you will get a response that looks like this

The redirect_url contains the iframe link. Redirect clients to the link to complete the payment or render it on your website. See exsmple below how to render it

This is how the payment iframe should look when rendered

Get Transaction Status

Once Pesapal redirect your customer to your callback URL and triggers your IPN URL, you need to check the status of the payment using the OrderTrackingId.

Transaction status returns transaction info and status code. This will allow you to update the transaction details based on the status code. The status code are as follows:

See example below on how to request transaction status:

A successful get transaction status should return a response that looks similar to the one below.

Refund Payment

Use this endpoint to refund payments to customer. See example below

On a successful request the following response will be returned

The refund API uses the confirm code for identification. It's important that you store all payment confirmation codes as returned in the Get Transaction Status Endpoint

Security and Vulnerabilities

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

License

Laravel-pesapal is an open source software licensed under the MIT License


All versions of laravel-pesapal with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
illuminate/support Version ^5.0|^6.0|^7.0|^8.0|^9.0|^10.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 nyawach/laravel-pesapal contains the following files

Loading the files please wait ....