Download the PHP package richnessagency/rich-payments without Composer

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

Rich Payments

richnessagency/rich-payments is a reusable Laravel payment package for building reliable online payment flows across Richness projects and community Laravel applications.

The package is designed around gateway drivers. Paymob is included as the first driver, and new gateways can be added without changing the checkout, webhook, credential storage, audit log, or admin management layers.

Goals

Installation

Install with Composer:

Run package migrations:

Seed the default Paymob gateway and payment methods:

Publish optional files:

Quick Start

  1. Visit the admin gateway page:

  2. Open the Paymob gateway.
  3. Enter encrypted credentials:
    • secret_key
    • public_key
    • hmac_secret
    • api_key
  4. Add or confirm integration identifiers for enabled methods:
    • cards
    • wallets
    • kiosk
    • bnpl
  5. Enable the gateway.
  6. Enable the payment methods you want customers to see.
  7. Start a checkout session from your application or use the package start route.

Configuration

Publish the config file and edit config/rich-payments.php.

Important Config Keys

Key Purpose
route_prefix Public payment route prefix. Default: payments.
admin_route_prefix Admin management route prefix.
public_payment_start_enabled Enables package-provided /methods and /start routes.
middleware.checkout Middleware for checkout, callback, success, failed, and pending pages.
middleware.admin Middleware for gateway settings and transaction actions.
middleware.admin_manage Extra middleware for gateway updates and connection tests.
middleware.admin_transactions Extra middleware for inquiry, refund, void, and capture actions.
middleware.webhook Middleware for gateway webhook endpoints.
default_currency Default ISO currency code.
default_gateway Gateway used by fallback response handling.
response_redirect_route Optional host route after verified payment callback.
response_redirect_parameter Route parameter name used for redirect.
response_verified_reference_session_key Optional session key used to prevent unverified return redirects.
views.* Branding values for built-in pages.
gateways.* Driver class and gateway-specific endpoints.

Environment Variables

The default config reads these values:

Payment secrets are intentionally managed from the encrypted database admin UI, not from frontend code.

Routes

Default public routes:

Method URI Route Name Purpose
GET /payments/methods rich-payments.methods Shows enabled payment methods.
POST /payments/start rich-payments.start Starts a hosted checkout payment.
GET /payments/pending rich-payments.pending Pending state page.
GET /payments/status/{reference} rich-payments.status JSON payment status/inquiry endpoint.
GET /payments/success rich-payments.success Default success page.
GET /payments/failed rich-payments.failed Default failure page.
POST /payments/{gateway}/webhook rich-payments.webhook Gateway webhook endpoint.
GET /payments/{gateway}/callback rich-payments.response Gateway browser callback endpoint.

Default admin routes:

Method URI Purpose
GET /admin/rich-payments/gateways Gateway list.
GET /admin/rich-payments/gateways/{gateway} Gateway settings.
PUT /admin/rich-payments/gateways/{gateway} Save credentials and methods.
POST /admin/rich-payments/gateways/{gateway}/test-connection Test gateway credentials.
GET /admin/rich-payments/attempts Payment attempts.
POST /admin/rich-payments/attempts/{attempt}/inquire Transaction inquiry.
POST /admin/rich-payments/attempts/{attempt}/refund Refund.
POST /admin/rich-payments/attempts/{attempt}/void Void.
POST /admin/rich-payments/attempts/{attempt}/capture Capture.
GET /admin/rich-payments/audit-logs Audit logs.

Route prefixes and middleware are configurable.

Starting A Payment From Code

Use the RichPayments service when your app owns the checkout/order flow.

Amounts use minor units. For EGP, 150000 means 1500.00 EGP.

Using The Built-in Start Route

The package can expose a generic start endpoint when:

Example form:

For production stores, prefer starting payments from your own checkout controller so you can calculate totals server-side and prevent amount tampering.

Success, Failure, Pending, And Callback Pages

Built-in result views:

Publish views:

Published files are placed under:

Customize these pages like normal Blade files:

Redirecting Back To Your App

Set a verified redirect route:

When a gateway callback is verified, the package redirects to:

If verification fails, the package sends the user to the pending page. Redirect pages are never treated as proof of payment. Verified webhook/callback data and transaction inquiry are the source of truth.

Branding Built-in Pages

Configure:

Or edit the published Blade views for full control.

Credential Management

Gateway credentials are stored in rich_payment_credentials.

Security behavior:

Paymob default credential keys:

Method integration identifiers are stored per payment method and encrypted:

Webhooks

Webhook endpoint:

The selected gateway driver receives the Laravel request and returns a WebhookResult.

The package then:

  1. Stores a sanitized webhook event.
  2. Verifies the gateway signature/HMAC.
  3. Rejects invalid payloads with 400.
  4. Processes valid events inside a database transaction.
  5. Locks duplicate events using a canonical payload hash.
  6. Updates the matching payment attempt.
  7. Dispatches payment events.

Webhook payload snapshots are sanitized before storage.

Payment Status

Payment attempts use PaymentStatus:

The status endpoint:

If the attempt is not final and has an external transaction id, the package may ask the gateway driver for an inquiry result and update the attempt.

Events

The package dispatches events your application can listen to:

Use these events to update orders, send notifications, or queue fulfillment. Keep listeners idempotent because webhooks can be retried.

Refund, Void, And Capture

Drivers that support money actions implement ManagesTransactions.

Admin screens already expose inquiry, refund, void, and capture actions when the gateway supports them. Every money action should create transaction records and audit logs.

Adding A New Gateway

Add a driver class implementing PaymentGatewayDriver.

Register the driver in config/rich-payments.php:

Seed or create a rich_payment_gateways row with code stripe, then add methods such as cards, apple_pay, or google_pay.

Driver Contract Rules

A gateway driver should:

Backward Compatibility

Existing applications may already depend on:

Do not rename these without a major version release and migration guide.

Safe additions:

Risky changes:

Security Checklist

Before enabling a gateway in production:

Testing

Run the package test suite:

Or:

Recommended integration tests in consuming apps:

Production Release Workflow

This package is distributed through GitHub and Composer/Packagist:

For stable public usage, tag semantic versions:

Consuming apps should prefer stable constraints such as:

Use dev-main only for active internal development.

License

MIT License. Created by Richness Agency.


All versions of rich-payments with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/encryption Version ^13.0
illuminate/http Version ^13.0
illuminate/routing Version ^13.0
illuminate/support Version ^13.0
illuminate/view Version ^13.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 richnessagency/rich-payments contains the following files

Loading the files please wait ...