Payment Gateway Integration Package
Open-source Laravel package for Tap Payments API integration. Provides a fluent interface for charge creation, two-step authorizations (hold & capture), invoicing, and recurring subscriptions. Supports 12+ regional payment methods across the MENA region. Features a Billable trait for direct model integration ($user->charge()), 6 domain events for payment lifecycle tracking, and HMAC-SHA256 webhook security. Built with developer experience in mind, offering type-safe parameters, idempotency protection, and a chainable builder pattern.
Major features and technical achievements.
Chainable interface for charge construction
Support for 12+ MENA-specific payment options
Secure event handling with signature validation
Trait-based payment integration for Eloquent models
Hold and capture payment flows
Recurring billing and invoice management
Architectural patterns and design decisions.
Fluent Interface
Chainable method calls for constructing payment requests. Each method returns $this, enabling readable sequential configuration before final create() execution.
Laravel Facade + Service Container
Tap facade provides simplified static access to underlying services. Service container manages dependency injection and singleton instances.
Immutable Data Carriers
Readonly classes like Destination encapsulate domain concepts with built-in validation. Implement Laravel Arrayable for seamless serialization.
Abstract Service Base
AbstractService defines the skeleton for API operations. Concrete services override endpoint, resource class, and list key methods.
Billable Model Integration
Billable trait integrates payment capabilities directly into Eloquent models. Enables $user->charge() without facades. Implements BillableContract for IDE autocompletion and type safety.