rublex / laravel-finpay-gateway
A Laravel payment gateway package for Finpay
dev-main
2026-03-28 13:10 UTC
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2026-03-28 13:10:31 UTC
README
A Laravel payment gateway package for Finpay integration.
Features
- Payment initiation
- Payment verification
- Payment status inquiry
- Callback route for gateway notifications
- Configurable via environment variables
- Laravel facade support
Installation
composer require rublex/laravel-finpay-gateway
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="Finpay\FinpayServiceProvider" --tag="finpay-config"
Add credentials to your .env file:
FINPAY_BASE_URL=https://devo.finnet.co.id FINPAY_MERCHANT_ID= FINPAY_MERCHANT_KEY=
Quick Start
use Finpay\Data\CustomerData; use Finpay\Data\OrderData; use Finpay\Facades\Finpay; $response = Finpay::initiatePayment( new CustomerData( email: 'hajar.finnet@gmail.com', firstName: 'Hajar', lastName: 'Ismail', mobilePhone: '+6281286288844' ), new OrderData( id: 'INV-1774369486', amount: '10', currency: 'EUR', description: 'Testing' ), userCallbackUrl: 'https://example.com/payment/final-callback' ); // Unified wrapper response shape: // [ // 'status' => 'pending', // 'responseCode' => '2000000', // 'responseMessage' => 'Initiated', // 'orderId' => 'INV-1774369486', // 'transactionId' => 'TRX-123', // 'redirect_url' => 'https://pay.example/redirect/...', // 'gatewayReference' => 'REF-123', // 'raw' => [/* full provider payload */], // ]
Provider-specific fields are preserved under raw.
Contract-Based Usage
use Finpay\Services\FinpayGatewayService; use Rublex\CoreGateway\Data\DynamicDataBag; use Rublex\CoreGateway\Data\PaymentRequestData; $gateway = app(FinpayGatewayService::class); $result = $gateway->initiate(new PaymentRequestData( gatewayCode: $gateway->code(), orderId: 'INV-1774369486', amount: '10', currency: 'EUR', callbackUrl: 'https://example.com/payment/final-callback', meta: new DynamicDataBag([ 'customer' => [ 'email' => 'hajar.finnet@gmail.com', 'firstName' => 'Hajar', 'lastName' => 'Ismail', 'mobilePhone' => '+6281286288844', ], 'order' => [ 'description' => 'Testing', ], ]) ));
Backward Compatibility
initiatePayment(CustomerData, OrderData, string)remains available and now wrapsinitiate(PaymentRequestData).verifyPayment()andgetPaymentStatus()remain explicit package methods and still throw not-implemented exceptions.
Documentation
For installation and usage instructions, see USAGE.md.
License
This package is open-sourced software licensed under the MIT license.