melipayamak/php
PHP client for the MeliPayamak SMS platform. Send SMS and manage messaging features via API with a simple, lightweight wrapper you can drop into any PHP app, including Laravel, for quick integration and delivery.
melipayamak/php) is a PHP wrapper for Melipayamak’s web services (likely a Turkish payment gateway, given the name). It abstracts REST/SOAP interactions, making it suitable for e-commerce, fintech, or payment processing use cases in Laravel.Async support (REST/SOAP) aligns with Laravel’s event-driven and queue-based workflows (e.g., dispatch() for delayed payments).createToken()).charge(), refund()).AppServiceProvider.PaymentGateway facade for cleaner syntax.PaymentProcessed, PaymentFailed events.MelipayamakChargeJob).Payment table).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Deprecated Package | High | Fork/update or replace with maintained SDK. |
| SOAP/REST Complexity | Medium | Test edge cases (timeouts, malformed responses). |
| Async Reliability | Medium | Implement retries (Laravel’s retry() helper). |
| Lack of Laravel Docs | Low | Build internal patterns (e.g., PaymentService). |
| No Webhook Support | Medium | Extend package or use Laravel’s Broadcasting. |
Http::asForm() or json().)HttpException.)throttle middleware if needed.)route:webhook or custom controller.)guzzlehttp/guzzle (Laravel’s default HTTP client).ext-soap (enable in php.ini).HttpTests or PestPHP for API mocking.Phase 1: Proof of Concept (PoC)
composer require melipayamak/php.PaymentService.Phase 2: Core Integration
$this->app->singleton(Melipayamak::class, function ($app) {
return new Melipayamak(config('services.melipayamak'));
});
facade(Melipayamak::class, 'Payment');
Payment Eloquent model with accessors for transaction status.Phase 3: Advanced Features
Broadcasting.MelipayamakChargeJob::dispatch($amount)->onQueue('high');
| Component | Compatibility Notes |
|---|---|
| Laravel 10/11 | Test with latest Laravel (package may need minor tweaks). |
| PHP 8.1+ | Ensure ext-soap and ext-curl are enabled. |
| Guzzle 7.x | Laravel 10+ uses Guzzle 7; package may need updates for PSR-18 compliance. |
| Database | No ORM dependency; use Laravel’s migrations for payment tables. |
| Caching | Cache API tokens if supported (Laravel’s cache()->remember()). |
Setup
.env with Melipayamak credentials.config/services.php.Core Payments
PaymentService for charges/refunds.HttpTests.Async Workflows
php artisan queue:work).Webhooks (if needed)
PaymentWebhookController or use Laravel’s Broadcasting.Monitoring
payments table.failed_jobs table).composer.json.HttpException).soap.wsdl_cache in php.ini.php artisan queue:failed-table).tap() for debugging responses.PaymentGatewayInterface).payments table by created_at for large volumes.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package Deprecation | Broken payments | Fork or migrate to a maintained SDK. |
| API Outage | Payment failures | Implement retry logic + fallback emails. |
| Queue Backlog | Delayed transactions | Scale workers; use database queue driver. |
| SOAP Timeouts | Hanging requests | Increase timeout; use REST fallback. |
| Webhook Failures | Undetected refunds/cancels | Log webhooks to DB; use Laravel Notifications. |
PaymentService, job queues, and error mapping.How can I help you explore Laravel packages today?