Download the PHP package zfhassaan/easypaisa without Composer
On this page you can find all versions of the php package zfhassaan/easypaisa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zfhassaan/easypaisa
More information about zfhassaan/easypaisa
Files in zfhassaan/easypaisa
Package easypaisa
Short Description Unlock the power of EasyPaisa Payment Gateway in Laravel 9 and Laravel 10. Accept payments seamlessly and securely, empowering your business to thrive in the digital era. Experience hassle-free integration and provide a seamless checkout experience for your customers.
License MIT
Informations about the package easypaisa
Disclaimer
This is unofficial Easypaisa API Payment Gateway. This repository is only created to help developers in streamlining the integration process.
Installation
The Package provides two way of using.
- Direct Checkout
- Hosted Checkout.
To use the Direct checkout ( Rest API ) you can call the already defined function sendRequest()
and to use the Hosted Checkout (Redirection Method) you can call the sendHostedRequest()
method to redirect user to easypaisa page for payment.
To install the EasyPaisa package, follow these steps:
Install the package via Composer by running the following command:
Publish the package configuration file by running the following command:
Update the .env
file with the required configuration values:
Usage
Direct Checkout
To perform a direct checkout using the EasyPaisa payment gateway, use the following code:
The sendRequest()
method of the Easypaisa class processes the payment request. It takes an array of request data as input and returns the response from the EasyPaisa payment gateway.
Package File: Easypaisa.php
The sendRequest() method is defined in the Easypaisa package file. It processes the payment request by sending the data to the EasyPaisa API.
The getCredentials() method retrieves the credentials based on the configuration settings
Hosted Checkout
To perform a hosted checkout using the EasyPaisa payment gateway, use the following code:
The gethashRequest() method retrieves the HashKey after encryption. The getCheckoutUrl() method retrieves the checkouturl which will redirect the customer to the Easypaisa portal.