Download the PHP package aliff/chip-in without Composer
On this page you can find all versions of the php package aliff/chip-in. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aliff/chip-in
More information about aliff/chip-in
Files in aliff/chip-in
Package chip-in
Short Description Laravel package for CHIP Collect payment gateway integration.
License MIT
Informations about the package chip-in
Chip-In Laravel
A simple Laravel 12 package to integrate the CHIP Collect API for seamless payment creation, status checking, and webhook handling.
🚀 Features
- 🔧 Easy integration with CHIP Collect API
- 💳 Create new payment sessions
- 📦 Verify and query payment status
- 🌐 Webhook-ready for payment notifications
- ⚙️ Simple
.envconfiguration - 🧩 Clean and extensible API client
📦 Installation
Install via Composer:
⚙️ Configuration
Step 1: Publish Configuration Files
This creates config/chipin.php in your application.
Step 2: Set Environment Variables
Add the following to your .env file:
Step 3: Create a Payment Handler Controller
Create a controller to handle payment callbacks at app/Http/Controllers/PaymentController.php:
📖 Usage Guide
Step 1: Create a Payment Session
In your controller or service, inject the Purchase endpoint class:
Step 2: User Completes Payment
- User is redirected to CHIP's checkout page
- User enters payment details and completes payment
- CHIP processes the transaction
Step 3: Handle Payment Callback
When payment is completed:
- ✅ CHIP sends a webhook callback to
/chipin/callback - ✅ The
ChipInControllerreceives and verifies the request - ✅ Your
PaymentController::handleChipInCallback()is automatically called - ✅ Payment record is created/updated in your database
- ✅ Your entity (Order, Subscription, etc.) status is updated
Step 4: Display Success/Failed Pages
The package includes default views at:
- Success:
/chipin/success→resources/views/success.blade.php - Failed:
/chipin/failed→resources/views/failed.blade.php
You can override these by publishing the views:
🔒 Security
Webhook Verification
To verify webhook authenticity, ensure your webhook secret is configured in the CHIP dashboard and stored securely. The ChipInController will validate the X-CHIP-Signature header automatically.
📚 API Reference
Purchase Class
create(array $payload): array
Create a payment without redirecting.
createAndRedirect(array $payload): RedirectResponse
Create a payment and immediately redirect to CHIP checkout.
handleCallback(array $data): array
Normalize callback data from CHIP webhook.
Client Class
post(string $endpoint, array $data): array
Send POST request to CHIP API.
get(string $endpoint): array
Send GET request to CHIP API.
📋 Callback Data Structure
When CHIP sends a webhook callback, the PaymentController::handleChipInCallback() receives data in the following format:
💾 Payment Database Table
Recommended schema for your payments table:
🛠️ Troubleshooting
| Issue | Solution |
|---|---|
CHIP API Error (401) |
Verify CHIPIN_API_KEY and CHIPIN_BRAND_ID in .env |
Callback not received |
Ensure your webhook URL is registered in CHIP dashboard |
No checkout_url returned |
Check API response payload and CHIP API status |
Payment reference not found |
Ensure reference field matches your entity ID |
Callback verification failed |
Verify webhook secret configuration |
📄 License
This package is open-sourced software licensed under the MIT license.