Download the PHP package mhaggag/laravel-payments without Composer

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

A comprehensive and flexible Laravel package for handling payments, subscriptions, and webhooks across multiple gateways including Stripe, PayPal, and Paymob.

Requirements

Table of Contents

1. Installation

Install the package via Composer:


2. Publishing Package Files

Publish all package assets:

Or publish selectively:

Run migrations:


3. Configuration (config/payments.php)

All package behavior is controlled from one config file:


4. Environment Variables

Add these variables to your .env file to configure the package:


5. Supported Gateways

Each gateway has:


6. Using Gateway Enums

Select the gateway for a payment process using the GatewayName enum:

Example:


7. Using the Payment Facade

The Payment facade provides a fluent interface to construct and execute payment requests.

Available Methods

Or you can set your payload as separate methods:

You can review the Gateways Payloads & Parameters section for more details and any custom parameters you may need to pass to the gateway individually.

Execution Methods

Examples

Basic Payment:


8. Using the Payable Trait

Attach payments to any Eloquent model:

Usage:

Available Methods

Scopes


9. Using the Subscribable Trait

Using it with Payable Trait when you want to support subscriptions mode.

Usage:

Available Methods

Scopes


10. Gateway Payload & Parameters

Each gateway defines specific parameters.

Stripe

Test Card Details Card Number: 4242424242424242 Expiration Date: 12/34 CVV: 123

PayPal

Paymob

Card Test Credentials Card Number: 2223000000000007 Expiration Date: 01/39 CVV: 100 Card Holder Name: Test Account

Wallet Test Credentials Wallet Number: 01010101010 MPin Code: 123456 OTP: 123456


11. Web & Webhook Routes

Enable or disable routes from config, and by default the webhook routes use the payments.verify_signature middleware to verify the signature or use the verifySignature method on the facade. You can control all these by route and webhook keys in config/payments.php:

Default web URLs (you can see the screenshots below):

Default webhook URLs:


Also, you can create webhook events by this commands:

12. Events & Listeners

You can customize your events instead of using in config/payments.php by adding them to the events key:

Available Events on using handleRedirect method on facade

Available Events on using handleWebhook method on facade

Listening to Events


13. Models & Database

Published migrations create tables for:

Override models in config:


14. Views & Translations

Views

Publish views:

Customize checkout, success, and error pages.

Translations

Publish language files:

Add your own language:


15. Debug Mode & Logging

Enable debug mode:

This logs:


16. Custom Gateways

You can add your own gateway by extending the MHaggag\Payments\Gateways\BaseGateway class.

  1. Create your gateway class:

  2. Register in config/payments.php:

17. Screenshots from default routes

Success

English Arabic

Cancel

English Arabic

Error

English Arabic

18. Testing

bash ./vendor/bin/phpunit



Mock gateways are included for local testing.

---

## 19. License

MIT License.

---

## Final Notes

This package is designed to be:
- Framework-native
- Fully configurable
- Easy to extend
- Safe for production use

If you need custom gateways, advanced subscriptions, or multi-tenant support, extend the base gateway class or contact me for assistance.

Happy coding 🚀

## 20. Contact

If you have any questions, suggestions, or need support, feel free to contact me:

- **Email**: [[email protected]](mailto:[email protected])
- **Phone**: +201121300234
- **LinkedIn**: [Mahmoud Haggag](https://linkedin.com/in/mahmoudhaggag641)

All versions of laravel-payments with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
guzzlehttp/guzzle Version >=7.0
illuminate/database Version >=11.0
illuminate/http Version >=11.0
illuminate/routing Version >=11.0
illuminate/support Version >=11.0
laravel/framework Version >=11.0
paypal/paypal-checkout-sdk Version ^1.0
stripe/stripe-php Version ^19.2
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 mhaggag/laravel-payments contains the following files

Loading the files please wait ...