Download the PHP package softscholar/laravel-payments without Composer

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

Laravel Payments by SoftScholar

Laravel Payments is a robust service package for integrating payment gateways into your Laravel application, developed by SoftScholar. This package currently supports Nagad (API v4.0.1) and bKash (Tokenized Checkout API v1.2.0-beta) payment gateways.


Table of Contents


Installation

Install the package via Composer in your Laravel project directory:


Configuration

Publish the package configuration file to set up your payment gateway credentials:

This will publish the configuration file to config/spayment.php.

Config File Structure

The config/spayment.php configuration file contains setup sections for both Nagad and bKash:

Environment Variables

Add the following environment variables to your .env file and replace the values with credentials provided by your payment partners:


Nagad Payment Gateway

Nagad Workflow & API Usage

To initiate a payment using the Nagad gateway, you can call the checkout method on the Payment Facade. You can run regular checkout, authorization (for tokenized setups), or a tokenized payment.

Nagad Callback Example

Handle the redirect callback to verify the payment on your controller:


bKash Payment Gateway

bKash API Guide

The bKash integration uses the Tokenized Checkout API v1.2.0-beta. The package provides a fluent interface to authenticate, initialize, execute, query, search, and refund payments.

The Softscholar\Payment\Services\Gateways\Bkash\Bkash class implements PaymentInterface and offers the following methods:

Method Name Parameters Return Type Description
withToken($token) string\|array $token static Feeds an active id_token string or response array containing the token to the instance.
grantToken() None array Calls bKash to obtain a fresh token payload.
refreshToken($refreshToken) string $refreshToken array Refreshes the id_token using a refresh_token.
checkout($data, $type) array $data, string $type string Entry point to create a payment (regular / tokenized) or agreement (authorize). Returns redirect URL.
createPayment($data) array $data string Directly triggers bKash checkout payment creation and returns the checkout redirect URL.
executePayment($paymentId, $agreementId) string $paymentId, string $agreementId = null array Executes/completes the payment after successful redirection.
queryPayment($paymentId) string $paymentId array Queries payment details and status from bKash.
searchTransaction($trxID) string $trxID array Searches for a transaction by bKash Transaction ID (trxID).
createAgreement($data) array $data string Creates an agreement for tokenized checkout. Returns agreement redirect URL.
executeAgreement($agreementId) string $agreementId array Executes/completes agreement enrollment.
cancelAgreement($agreementId) string $agreementId array Cancels an active agreement.
refund($data) array $data array Initiates refund of a captured payment.
refundStatus($paymentId, $trxID) string $paymentId, string $trxID array Checks status of a refunded transaction.

bKash Token Management

bKash checkout requires authentication using a bearer id_token. You must obtain this token first, and it's highly recommended to store/cache it and refresh it before expiration.

Here is an example wrapper helper:


bKash Regular Checkout

Regular checkout creates a single payment transaction.

1. Initiate Checkout

2. Execute Payment in Callback

After the customer inputs their PIN and verifies the OTP, bKash redirects to the callbackURL with query parameters. You must call executePayment to complete the transaction:


bKash Agreements (Tokenized Checkout)

Tokenized Checkout allows customer account enrollment (creating an agreement) so that subsequent payments can be completed without entering OTP/PIN.

1. Create Agreement

2. Execute Agreement in Callback

3. Charge Using Tokenized Agreement

Once you have stored the active agreementId, you can run a checkout payment directly without requiring PIN/OTP:

4. Cancel Agreement

To delete/deregister a saved customer wallet:


bKash Search & Query Payments

Query Payment Status

Queries checkout status using the unique paymentId:

Search Transaction details

Searches transaction information directly via bKash Transaction ID (trxID):


bKash Refunds

Refund an executed payment transaction:

Check the status of an existing refund:


Supported Payment Gateways

The Laravel Payments package currently supports:


License

The Laravel Payments package is open-source software licensed under the MIT license.


Contributing

Open source contributions are welcome! If you would like to contribute, please fork the repository and submit a pull request.

For assistance, feel free to contact us at SoftScholar or send an email to [email protected].


All versions of laravel-payments with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-openssl Version *
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 softscholar/laravel-payments contains the following files

Loading the files please wait ...