Download the PHP package carllee/line-pay-online-v4 without Composer
On this page you can find all versions of the php package carllee/line-pay-online-v4. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download carllee/line-pay-online-v4
More information about carllee/line-pay-online-v4
Files in carllee/line-pay-online-v4
Package line-pay-online-v4
Short Description LINE Pay Online V4 API SDK for PHP. Type-safe, PSR-4 compliant, with Builder Pattern and Laravel support.
License MIT
Homepage https://github.com/CarlLee1983/line-pay-online-v4-php
Informations about the package line-pay-online-v4
LINE Pay Online V4 PHP SDK
PHP SDK for LINE Pay Online API V4. A type-safe, strictly typed library featuring a Fluent Builder for constructing complex payment requests. Native support for Laravel with auto-discovery and Facades.
🌐 Language / 語言 / 言語 / ภาษา: ภาษาไทย
Features
- ✅ PHP 8.1+ with strict types
- ✅ Laravel Integration - ServiceProvider, Facade, IoC support
- ✅ Builder Pattern for request construction
- ✅ Type-safe Enums for currencies and options
- ✅ Comprehensive Validation before API calls
- ✅ PHPStan Level Max static analysis
- ✅ Built on
carllee/line-pay-core-v4
Requirements
- PHP 8.1 or higher
- Composer
- ext-json
- ext-openssl
Installation
Payment Flow
Quick Start
Standard PHP Usage
Laravel Integration
The package supports Laravel Package Discovery. Just install it via composer, and the ServiceProvider and Facade will be registered automatically.
Configuration
Publish the config file:
Add to your .env:
Using Dependency Injection
Using Facade
API Methods
Request Payment
Confirm Payment
Capture Payment
Void Payment
Refund Payment
Get Payment Details
Check Payment Status
Error Handling
Common Pitfalls & Troubleshooting
🚫 Double Confirmation (Error 1198)
Each transactionId can only be confirmed once.
- If users refresh the success page, your server might try to confirm again.
- Solution: Check your local database order status before calling
$client->confirm(). If it's already "PAID", skip the API call.
💰 Amount Mismatch (Error 1106)
The amount passed to confirm() must match the amount requested exactly.
- Tip: Do not trust the amount in the URL query string (if any). Always retrieve the amount from your own database using the
orderId.
⏱️ Transaction Expiration
The paymentUrl and transactionId have an expiration time (usually 20 minutes). If the user takes too long, the confirm call will fail.
- Store the expiration time and show a countdown to the user.
- Handle the expiration error gracefully and allow the user to restart the payment.
Testing
Related Packages
carllee/line-pay-core-v4- Core SDK (dependency)carllee/line-pay-offline-v4- Offline Payment SDK
License
MIT License - see LICENSE for details.