melipayamak.php).Melipayamak::charge()).createPayment(), refund()). Reduces boilerplate for HTTP requests/signature validation.MelipayamakException), but lacks granular error types (e.g., PaymentFailed, InvalidCredentials).| Risk Area | Severity | Mitigation |
|---|---|---|
| Laravel Version Mismatch | High | Override autoloading or fork to support Laravel 8+ (e.g., use illuminate/support). |
| Deprecated Dependencies | Medium | Check for outdated packages (e.g., guzzlehttp/guzzle <6.0). |
| No Webhook Support | Medium | Implement custom middleware or use a separate service (e.g., Tymon/JWT). |
| Limited Documentation | Low | Rely on GitHub issues or reverse-engineer from examples. |
| No Type Safety | Low | Add PHP 8+ type hints or use a wrapper trait for stricter contracts. |
composer.json constraints (e.g., illuminate/support:^8.0).Facades\Melipayamak → app('melipayamak')).composer require melipayamak/melipayamak-laravel
php artisan vendor:publish --provider="Melipayamak\MelipayamakServiceProvider"
.env:
MELIPAYAMAK_MERCHANT_ID=your_id
MELIPAYAMAK_SECRET_KEY=your_key
// Example: Create a payment
$payment = Melipayamak::createPayment([
'amount' => 1000, // TRY (in cents)
'currency' => 'TRY',
'installment' => 3,
'card' => $request->card,
]);
if ($payment->success) {
// Redirect to success page
} else {
// Log error: $payment->errorMessage
}
/melipayamak/webhook) to validate and process async events.PaymentFailed job).$this->partialMock(GuzzleHttp\Client::class, ['request']);
Melipayamak::setLogger() if supported)..env and melipayamak.php for changes in Melipayamak’s API.Request facade), refactor calls.payment_attempted_at).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| API Downtime | Payments fail silently. | Implement retry logic with exponential backoff (Laravel Queues). |
| Invalid Credentials | All payments blocked. | Monitor MelipayamakException and alert on auth failures. |
| **Webhook Missed |
How can I help you explore Laravel packages today?