Download the PHP package carllee/line-pay-core-v4 without Composer
On this page you can find all versions of the php package carllee/line-pay-core-v4. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download carllee/line-pay-core-v4
More information about carllee/line-pay-core-v4
Files in carllee/line-pay-core-v4
Package line-pay-core-v4
Short Description Core library for LINE Pay API V4 SDK - Provides shared utilities, base client, types, and error handling for building LINE Pay integrations
License MIT
Homepage https://github.com/CarlLee1983/line-pay-core-v4-php
Informations about the package line-pay-core-v4
LINE Pay Core V4 PHP
Core library for LINE Pay API V4 SDK. Provides shared utilities, base client, configuration, and error handling that power the Online and Offline SDKs.
🌐 Language / 語言 / 言語 / ภาษา: ภาษาไทย
Architecture
Overview
This package is the shared foundation for building LINE Pay V4 integrations in PHP. It handles the "heavy lifting" so that the Online and Offline SDKs can focus on their specific API logic.
Key Responsibilities
| Component | What It Does | Why It Matters |
|---|---|---|
| HMAC-SHA256 Signature | Generates and verifies API signatures | The most complex part of LINE Pay V4 API — one wrong byte and requests fail |
| HTTP Client Wrapper | Encapsulates Guzzle with retry logic | Handles timeouts, connection errors, and response parsing consistently |
| Unified Error Parsing | Parses LINE Pay error codes into typed exceptions | 1xxx = Auth, 2xxx = Payment, 9xxx = Internal — no more guessing |
| Configuration Management | Type-safe config with environment support | Prevents "oops, wrong credentials in production" mistakes |
Requirements
- PHP 8.1 or higher
- ext-json
- ext-openssl
- Guzzle HTTP Client 7.0+
Installation
⚠️ Note: This is a core library meant to be used as a dependency.
Most developers should use the ready-made SDKs instead:
- For online payments (web/app checkout):
carllee/line-pay-online-v4- For offline payments (POS/Kiosk):
carllee/line-pay-offline-v4Use this package directly only if you need to build a custom LINE Pay client with specialized behavior.
Usage
Creating a Custom Client
Utilities
Security: Timing-Safe Signature Verification
The verifySignature method uses constant-time comparison to prevent timing attacks:
Why this matters: A timing attack can determine how many characters of a signature match by measuring response time. Constant-time comparison always takes the same amount of time regardless of how many characters match.
Error Handling
LINE Pay API error codes follow a pattern:
| Code Range | Category | Description |
|---|---|---|
1xxx |
Authentication | Channel ID/Secret issues, invalid signatures |
2xxx |
Payment | Transaction errors, insufficient balance, expired |
9xxx |
Internal | LINE Pay server errors, maintenance |
Configuration
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
channelId |
string | Yes | - | Channel ID from LINE Pay Merchant Center |
channelSecret |
string | Yes | - | Channel Secret from LINE Pay Merchant Center |
env |
string | No | 'sandbox' |
Environment: 'production' or 'sandbox' |
timeout |
int | No | 20 |
Request timeout in seconds |
Related Packages
carllee/line-pay-online-v4- LINE Pay Online API V4 client (web/app checkout)carllee/line-pay-offline-v4- LINE Pay Offline API V4 client (POS/Kiosk)
Development
License
MIT License - see the LICENSE file for details.
Author
Carl Lee - GitHub