Download the PHP package kodedjackson/bachs-laravel without Composer
On this page you can find all versions of the php package kodedjackson/bachs-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kodedjackson/bachs-laravel
More information about kodedjackson/bachs-laravel
Files in kodedjackson/bachs-laravel
Package bachs-laravel
Short Description Laravel client for the Bachs payment API
License MIT
Informations about the package bachs-laravel
Bachs Laravel
A fluent, native Laravel integration for the Bachs.io payment API.
This package provides a clean Facade for interacting with the Bachs API (like creating Checkout Sessions and Products) and automatically handles secure webhook signature verification out of the box.
Installation
You can install the package via composer:
Publish the configuration file:
This will create a config/bachs.php file in your application where you can configure your default settings.
Configuration
Add your Bachs API keys to your .env file. You can find these in your Bachs developer dashboard.
(Note: When moving to production, change your Base URL to https://api.bachs.io/v1 and use your live keys).
Usage
1. Creating a Checkout Session
You can create a hosted checkout session by passing a pricing array for raw amounts, or a product_cart array for catalog items.
2. Creating a Product
You can create a product in your Bachs catalog. If you omit the currency, the package will automatically use your configured default (BACHS_CURRENCY).
Handling Webhooks (Fulfilling Orders)
Bachs recommends never relying on the browser redirect to fulfill an order. Instead, you should listen for webhooks.
This package automatically exposes a secure webhook endpoint at POST /bachs/webhook. It verifies the cryptographic signature of the incoming request and dispatches native Laravel events.
Step 1: Configure your Dashboard
In your Bachs developer portal, set your webhook URL to:
https://yourdomain.com/bachs/webhook
Subscribe to the collection.succeeded event, and paste the generated signing secret into your .env file as BACHS_WEBHOOK_SECRET.
Step 2: Listen for the Event
When a payment is successful, the package fires the Kodedjackson\Bachs\Events\CollectionSucceeded event.
You can listen for this event in your application (e.g., inside EventServiceProvider or a dedicated listener) to fulfill the order:
Security Vulnerabilities
If you discover any security-related issues, please email directly instead of using the issue tracker.
License
The MIT License (MIT).
All versions of bachs-laravel with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.8