Download the PHP package sayed/payment-laravel without Composer

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

User Guide - How to Use This Package in Your Laravel Application

This guide provides step-by-step instructions for integrating the Sayed Payment Laravel package into your application.

Table of Contents

  1. Installation
  2. Configuration
  3. Basic Setup
  4. Creating Payments
  5. Handling Webhooks
  6. Advanced Features

Installation

Step 1: Install the Package

Install via Composer:

Step 2: Publish Configuration

Publish the configuration file:

This creates config/payment.php in your application.


Configuration

Step 3: Add Environment Variables

Add your payment provider credentials to .env:

Step 4: Verify Configuration

Check config/payment.php to ensure providers are configured:


Basic Setup

Step 5: Create Payment Controller

Create a controller to handle payments:

app/Http/Controllers/PaymentController.php:

One-Time Payment

Subscription Payment

Multiple Products

Invoice Payment (Stripe Only)

Refund Payment


Product Creation

Create products and subscription plans programmatically across all payment providers. All methods return DTOs for type-safe access.

Create One-Time Product

Create Recurring Subscription

PayPal Product Creation

Paddle Product Creation


Advanced Features

Dynamic Provider Selection

Using PaymentMethod Enum

Custom Metadata

Get Invoice Details (Stripe)


Event-Driven Architecture

The package provides an event-driven architecture that allows you to easily handle payment events by creating custom event classes.

How It Works

When a webhook is received:

  1. The package validates and transforms the webhook data
  2. It dispatches events based on the event type (invoice, checkout, subscription)
  3. Your custom event classes are automatically instantiated and their handle() method is called
  4. You can also listen to these events using Laravel's event listener system

Step 1: Create Your Event Classes

Create event classes in app/Events by extending the base event classes provided by the package:

Invoice Events

Checkout Events

Subscription Events

Step 2: Register Events in Config

Update config/payment.php to map webhook events to your custom classes:

Step 3: Access Event Data

Your event classes have access to the following properties:

InvoiceEvent Properties

CheckoutEvent Properties

SubscriptionEvent Properties

Step 4: Using Laravel's Event System (Optional)

You can also use Laravel's native event listeners:

Create a Listener:

Register in EventServiceProvider:

Listener Example:

Available Event Names

Stripe Event Mapping

Stripe Event Simplified Name Event Type
checkout.session.completed completed checkout
checkout.session.expired expired checkout
customer.subscription.created created subscription
customer.subscription.updated updated subscription
customer.subscription.deleted deleted subscription
customer.subscription.trial_will_end trial_ending subscription
invoice.created created invoice
invoice.finalized finalized invoice
invoice.paid payment_succeeded invoice
invoice.payment_failed payment_failed invoice
invoice.updated updated invoice

Real-World Example

Here's a complete example of handling invoice payments:


All versions of payment-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2|^8.3
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
stripe/stripe-php Version ^13.0|^14.0|^15.0
guzzlehttp/guzzle Version ^7.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 sayed/payment-laravel contains the following files

Loading the files please wait ...