Download the PHP package lahiru/laravel-solidgate without Composer

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

Laravel SolidGate

Latest Version PHP Version Laravel Version

Laravel package for the SolidGate payment gateway. Use the facade or dependency injection, get typed responses, and call 74+ API endpoints with correct HMAC-SHA512 signing and sensible defaults.

Good for: server-side card/APM charges, subscriptions, hosted checkout, embedded payment forms, webhooks, and reporting.


Table of Contents

Getting started

Checkout (customer-facing)

Server-side API

Reference


Features

Feature Description
74+ endpoints Card, APM, subscriptions, taxes, checkout, webhooks, reporting
Checkout docs Payment Form with copy-paste Laravel examples
Correct signing HMAC-SHA512 over exact JSON body — matches official PHP SDK
Smart defaults Auto-fills platform, payment_type, and card expiry formatting
Type-safe responses SolidGateResponse with dot-notation and error helpers
Webhook support Signature verification middleware + Laravel events
Helper classes Platform, PaymentType, RefundReason, currency utilities
Laravel native HTTP client, service container, facade, config publishing

Requirements


Installation

Publish the config (recommended):

Copy environment variables from .env.example:


Configuration

Get your keys from SolidGate Hub → Developers → Channel details:

Key type Prefix Used for
API keys api_pk_* / api_sk_* Outgoing API requests
Webhook keys wh_pk_* / wh_sk_* Incoming webhook verification

Environment variables

Tip: Each API group uses a different base URL. Card payments go to pay.solidgate.com, subscriptions to subscriptions.solidgate.com, APM to gate.solidgate.com, and reports to reports.solidgate.com. The package routes these automatically — you only call the facade methods.

Config file (config/solidgate.php)

After publishing, keys are read from config('solidgate.public_key') and config('solidgate.secret_key') (backed by SOLIDGATE_* env vars).


Choose your integration

Pick the flow that matches your product. All options below use this package on the server; only Payment Form also needs frontend JS.

Integration Customer experience Package methods Best when
Payment Page Redirect to Solidgate-hosted page createPaymentPage(), deactivatePaymentPage() Fastest setup, minimal frontend
Payment Form Card fields on your site generateSignature() + app helper for merchantData Full UI control, no redirect
Card API (charge) You collect PAN (PCI scope) charge(), auth(), recurring() Full backend control
APM PayPal, Pix, etc. initializeAlternativePayment() Alternative payment methods
Subscriptions Recurring billing retrieveSubscription(), cancelSubscription(), … SaaS / memberships

Using the package in Laravel

Facade (typical)

Dependency injection (testable)

Signing helper (Payment Form)

Uses the same HMAC-SHA512 algorithm as outbound API requests and webhook verification.


Quick Start

Three-minute path to a successful server-side charge. For hosted or embedded checkout, jump to Checkout integrations.

1. Make your first charge

platform and payment_type are auto-filled from config when omitted. Card expiry fields are normalized automatically (3"03", year cast to integer).

2. Full controller example

3. Recurring / token payment


Checkout integrations

Customer-facing checkout using Solidgate UI. For server-side card capture without Solidgate JS, see Card Payments.

Payment Page Payment Form
Docs Payment Page Payment Form
UX Redirect to hosted URL Embedded on your page
Frontend None required solid-form.js + PaymentFormSdk.init()
Backend createPaymentPage() generateSignature() + encrypt paymentIntent
PCI Card data on Solidgate Card data tokenized by Solidgate iframe

Payment Page (hosted)

When to use: you want checkout live quickly with almost no frontend work.

Flow

  1. Laravel calls SolidGate::createPaymentPage(['order' => [...], 'page_customization' => [...]]).
  2. API returns a url (expires in ~24 hours).
  3. Redirect the customer with redirect()->away($url).
  4. After payment, Solidgate sends the user to your success_url or fail_url.

API

Method Endpoint Purpose
createPaymentPage($attributes) POST /init Create hosted page, get URL
deactivatePaymentPage($pageId) POST /deactivate Invalidate page before expiry

Minimal example

Controller + route

Subscriptions / catalog: use product_price_id in order (from SolidGate::getProductPrices()). See Create your payment page.

Checklist


Payment Form (embedded)

When to use: checkout must match your site design and stay on the same URL.

Flow

  1. Build a paymentIntent array (amount, currency, order_id, customer, URLs, etc.).
  2. Server returns merchantData: merchant, signature, paymentIntent (encrypted).
  3. Blade loads https://cdn.solidgate.com/js/solid-form.js and calls PaymentFormSdk.init({ merchantData }).

merchantData shape (passed to JS)

Key Source
merchant config('solidgate.public_key')
signature SolidGate::generateSignature($json)
paymentIntent AES-256-CBC encrypted JSON (see helper below)

App helper — copy to app/Services/SolidgatePaymentForm.php (no extra Composer package):

Encryption matches Solidgate’s without-SDK PHP guide.

Controller

Field reference: paymentIntent object.

Blade

Checklist

Optional: Official solidgate/php-sdk exposes $api->formMerchantData($paymentIntent) if you prefer not to maintain the encrypt helper.


Card Payments

Server-side card processing (you send PAN/CVV from your backend). For Solidgate-hosted or embedded UI instead, see Checkout integrations.

All card endpoints use the pay API (pay.solidgate.com/api/v1/).

Required fields for charge()

Field Type Example Notes
amount integer 10000 Minor units (cents for USD)
currency string "USD" ISO 4217
order_id string UUID Must be unique per attempt
order_description string "Premium plan"
customer_email string "[email protected]"
ip_address string "203.0.113.0" Public IP only — see Troubleshooting
platform string "WEB" WEB, MOB, or APP
card_number string "4111…" Full PAN, 12–19 digits
card_holder string "John Doe" Name on card
card_exp_month string "12" Zero-padded automatically
card_exp_year integer 2030 4-digit year
card_cvv string "123" Required for first payment

For token payments, omit card fields and pass payment_type + recurring_token instead.

Available methods


Alternative Payments (APM)

APM endpoints use the gate API (gate.solidgate.com/api/), not the pay API.

Note: Card recurring uses recurring_token. APM recurring uses token. These are different field names per SolidGate API spec.


Subscriptions

All subscription endpoints use subscriptions.solidgate.com/api/v1/.


Products, Taxes & Reporting


Webhooks

Receive async events (card_gate.order.updated, chargebacks, etc.) on a Laravel route with signature verification.

Setup

The package registers POST /solidgate/webhook with signature verification middleware.

Exclude from CSRF (Laravel 11+):

Incoming headers

Header Description
solidgate-event-type Event name, e.g. card_gate.order.updated
solidgate-event-id Unique event ID
Signature HMAC signature of raw request body
Merchant Webhook public key

Handle events

Manual signature verification


Responses & Error Handling

SolidGate has two types of errors. Handle both:

Type HTTP status How to detect
Validation / business error 200 with error object ! $response->isSuccessful()
Transport / server error 4xx / 5xx SolidGateApiException thrown

Response helpers


Helper Classes

Platform — customer device

PaymentType — CIT / MIT classification

SolidGateConstants — currency formatting

RefundReason / CancelSubscriptionReason

Official reason codes — see Refund Reasons and Cancel Codes.


Troubleshooting

Payment Page or Form fails to load

Issue Fix
Form blank / init error New order_id, public ip_address, required paymentIntent fields
Invalid IP on checkout Use customer public IP in production; see below
Payment Form script warning Load solid-form.js only once
Page URL expired Links last ~24h; call createPaymentPage() again

Platform is empty or invalid (error 2.01)

Add platform to your request or rely on the config default:

Config default: SOLIDGATE_DEFAULT_PLATFORM=WEB

Invalid IP — private IP rejected

SolidGate rejects private IPs (127.0.0.1, 192.168.x.x, etc.). When testing locally:

In production, always pass the customer's public IP from the frontend or a trusted proxy header.

HTTP 200 but payment failed

SolidGate returns HTTP 200 with an error object for validation failures. Always check isSuccessful() — do not rely on HTTP status alone.

Wrong API base URL

Symptom Fix
Subscription call hits pay API Use SolidGate::retrieveSubscription() — routes automatically
APM call fails with wrong host Use initializeAlternativePayment() — uses gate API
Custom endpoint needed Use SolidGate::send(), gate(), or subscriptions()

Enable request logging

Logs URL, method, status, and response to Laravel's log channel at debug level.


API Reference Map

Category Base URL Key methods
Card payments pay.solidgate.com/api/v1/ charge, auth, recurring, refund, void, settle, status
Alternative payments gate.solidgate.com/api/ initializeAlternativePayment, recurringAlternativePayment
Subscriptions subscriptions.solidgate.com/api/v1/ retrieveSubscription, cancelSubscription, createProduct
Taxes subscriptions.solidgate.com/api/v1/ createTransactionalTax, downloadTransactionalTax
Reporting reports.solidgate.com/ getCardOrdersReport, getRoutingEventsReport
Checkout (hosted page) pay.solidgate.com/api/v1/ createPaymentPage, deactivatePaymentPage
Checkout (payment link) pay.solidgate.com/api/v1/ createPaymentLink, deactivatePaymentLink
Payment Form signing — (local) generateSignature() + app encrypt helper — see Payment Form
Webhooks pay.solidgate.com/api/v1/ createWebhookEndpoint, listWebhookEndpoints

Full API spec: api-docs.solidgate.com


Development

CI runs on every push and pull request via GitHub Actions:

Job Checks
tests PHPUnit on PHP 8.2 (Laravel 12) and PHP 8.3 (Laravel 13)
static-analysis PHPStan level 5
code-style Laravel Pint
security Composer audit (advisory)

Changelog

See CHANGELOG.md for full history.

1.0.2 — APM gate endpoints, PaymentType/Platform helpers, error formatting, routing reports.

1.0.1 — HMAC signing fix, endpoint path corrections, webhook validation, unit tests.


License & References

MIT — see LICENSE.

Resource Link
API Reference api-docs.solidgate.com
Access & Signing docs.solidgate.com/payments/integrate/access-to-api
Payment Guide docs.solidgate.com
Payment Page docs.solidgate.com/payments/integrate/payment-page
Payment Form docs.solidgate.com/payments/integrate/payment-form
Refund Reasons docs.solidgate.com/payments/payments-insights/refund-reasons
Cancel Codes docs.solidgate.com/billing/subscription-overview/subscription-insights/subscription-cancel-codes

All versions of laravel-solidgate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^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 lahiru/laravel-solidgate contains the following files

Loading the files please wait ...