hexters/coinpayment
Laravel CoinPayments integration by Hexters. Provides simple setup and helpers to create transactions, generate checkout URLs, handle IPN callbacks, track payment status, and process confirmations for crypto payments via the CoinPayments API.
config/app.php or ServiceProvider).payment_id, status, amount). If your app uses event sourcing or CQRS, this may require custom adapters.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Vendor Lock-in | High | Abstract CoinPayment behind an interface for future swaps. |
| Webhook Reliability | High | Implement a dead-letter queue and retry mechanism. |
| Crypto Volatility | Medium | Add rate-limiting and fallback currencies. |
| Lack of Async Support | Medium | Wrap in a Job (Laravel Queues) for async processing. |
| No Type Safety | Low | Use PHPStan or Psalm to enforce contracts. |
| License Ambiguity | Low | Clarify usage rights (NOASSERTION = unclear; assume MIT-like). |
spatie/currency.)// Example: Abstract CoinPayment behind an interface
interface PaymentGateway {
public function processPayment(array $data);
}
class CoinPaymentGateway implements PaymentGateway {
use \Hexters\CoinPayment\Traits\CoinPayment;
// ...
}
| Laravel Feature | Compatibility | Workaround |
|---|---|---|
| Service Container | ✅ Native | Register via config/app.php. |
| Queues (Async) | ❌ No | Use Illuminate\Bus\Queueable. |
| Notifications | ❌ No | Manually trigger Notification facade. |
| Cashier/Billing | ❌ No | Custom subscription logic. |
| Sanctum/Passport | ⚠️ Partial | Authenticate webhooks separately. |
| Horizon (Monitoring) | ❌ No | Use Laravel Echo or Sentry. |
hexters/coinpayment to composer.json.php artisan vendor:publish)./coinpayment/webhook to a controller.CoinPayment::verifyWebhook()).config/coinpayment.php).ProcessPaymentJob).payment_status).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| CoinPayment API downtime | Payments fail | Implement a fallback gateway. |
| Webhook delivery failures | Unconfirmed payments | Use exponential backoff retries. |
| Duplicate webhooks | Overcharging/refunds | Store payment_id + signature in DB. |
| Crypto price volatility | Revenue loss | Add price alerts or hedging. |
| Malicious webhook spoofing | Fraud | Validate IPs + HMAC signatures. |
How can I help you explore Laravel packages today?