birim/laravel-payone
Laravel wrapper for the PAYONE payment gateway. Provides a Payone facade to send API requests (e.g., preauthorization, createaccess), publishable config for credentials and test/live mode, and helpers to override settings at runtime.
payone::transaction.created), enabling reactive workflows (e.g., inventory updates, email notifications).PayoneService) or overriding methods.Http::fake()) and unit-testable services..env variables (PAYONE_SANDBOX_KEY, PAYONE_LIVE_KEY).Route::post('/payone/webhook'). The package provides a webhook handler, but custom logic (e.g., retry failed notifications) may require extension.errors arrays). The package’s PayoneException is basic; custom error mapping may be needed for user-facing messages.chargeback API calls?PayoneService is synchronous; async queues may be required.PayoneService class?PayoneService into controllers/services via app(PayoneService::class) or constructor DI.TransactionCreated) in EventServiceProvider:
protected $listen = [
'payone::transaction.created' => [PaymentHandler::class, 'handleTransaction'],
];
payone.middleware for API key validation or request logging./payone/webhook endpoint with:
Route::post('/payone/webhook', [PayoneWebhookController::class, 'handle']);
payone_transactions table or create a pivot table for order-payment relationships.transaction_id (PAYONE’s reference) is indexed for lookups..env with sandbox keys./payments/payone).PayoneService; deprecate legacy code.spatie/fractal) for PAYONE API calls.payone:process-webhook job).Webhook class will need updates.composer require birim/laravel-payone.php artisan vendor:publish --provider="Birim\Payone\PayoneServiceProvider"..env:
PAYONE_SANDBOX_KEY=your_sandbox_key
PAYONE_LIVE_KEY=your_live_key
PAYONE_WEBHOOK_SECRET=your_webhook_secret
PayoneService facade or alias for cleaner usage:
// app/Providers/AppServiceProvider.php
public function boot() {
if (!class_exists('Payone')) {
class_alias(Birim\Payone\Facades\Payone::class, 'Payone');
}
}
PaymentGateway) to abstract PAYONE-specific logic.public function handle(Request $request) {
$payload = $request->getContent();
$signature = $request->header('X-Payone-Signature');
if (!Payone::validateWebhook($payload, $signature)) {
abort(403);
}
// Process webhook...
}
birim/payone and its dependencies (e.g., `payone/payone-sdk-phpHow can I help you explore Laravel packages today?