Download the PHP package cafali-com/laravel-openpay without Composer
On this page you can find all versions of the php package cafali-com/laravel-openpay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cafali-com/laravel-openpay
More information about cafali-com/laravel-openpay
Files in cafali-com/laravel-openpay
Package laravel-openpay
Short Description A Laravel package for OpenPay (BBVA) payment gateway integration
License MIT
Homepage https://github.com/cafali-com/laravel-openpay
Informations about the package laravel-openpay
Laravel OpenPay
A Laravel package for integrating with the OpenPay (BBVA) payment gateway. Supports card payments, SPEI bank transfers, Paynet cash payments, subscriptions, payouts, and webhooks.
Installation
Publish the config:
Add your credentials to .env:
Usage
Facade
Card Charges
Paynet (Cash at Convenience Stores)
SPEI (Bank Transfers)
Customers
Cards
Subscriptions
Payouts
Refunds
Billable Trait
Add the Billable trait to your User (or any model) for convenient payment methods:
Add the openpay_id column to your model's table:
Then use it:
Webhooks
The package registers a webhook endpoint at POST /openpay/webhooks automatically.
Events
Listen for these events in your EventServiceProvider or with Event::listen():
| Event | Fired when |
|---|---|
WebhookReceived |
Any valid webhook (always dispatched) |
VerificationReceived |
OpenPay sends a verification event during webhook activation, see Webhook Activation below |
ChargeCompleted |
A charge is completed |
ChargeFailed |
A charge fails |
ChargeRefunded |
A charge is refunded |
PayoutCompleted |
A payout is completed |
PayoutFailed |
A payout fails |
SpeiReceived |
A SPEI transfer is received |
SubscriptionChargeFailed |
A subscription charge fails |
Webhook Signature Verification
Set OPENPAY_WEBHOOK_SECRET in your .env to enable signature verification. The middleware will validate the X-Openpay-Webhook-Signature header automatically.
Webhook Activation
OpenPay's webhook activation is a two-step protocol that catches many integrations off guard:
- When a webhook is created, OpenPay POSTs to the webhook URL with
{"type": "verification", "verification_code": "XXXXXXXX"}. The endpoint must respond with HTTP 200 (this package does that automatically). - The merchant must then paste the
verification_codeinto the OpenPay dashboard's Verify form to activate the webhook. Until this is done, OpenPay marks the webhook as "Sin verificar" and will not deliver any other events.
This package surfaces the verification code through three layers so merchants can find it without grepping log files:
A. The VerificationReceived event, dispatched as soon as the package receives the verification ping:
B. The openpay_webhook_verifications table. A default listener persists every verification code with webhook_id, payload, and a used_at timestamp you can flip once the merchant has pasted the code:
Disable the default listener (e.g., if you only want the event for your own side effects):
C. The openpay:webhook:verifications Artisan command for CLI access:
Pass --all to include codes already marked as used, --limit=N to change the row cap (default 10).
Registering with OpenPay
Register your webhook URL in the OpenPay dashboard or via the API:
Client-Side Tokenization (Openpay.js)
For PCI compliance, card data should never touch your server. Use Openpay.js:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-openpay with dependencies
illuminate/contracts Version ^11.0||^12.0
openpay/sdk Version ^3.1
spatie/laravel-package-tools Version ^1.16