Download the PHP package pasisltd/php-sdk without Composer
On this page you can find all versions of the php package pasisltd/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pasisltd/php-sdk
More information about pasisltd/php-sdk
Files in pasisltd/php-sdk
Package php-sdk
Short Description A lightweight PHP SDK for integrating with the Pasis payment platform
License MIT
Informations about the package php-sdk
Pasis PHP SDK
A lightweight PHP SDK for integrating with the Pasis payment platform. This SDK provides a simple, intuitive interface for merchants to interact with Pasis APIs without writing HTTP requests manually.
Installation
Quick Start
Configuration
Client Options
The SDK provides several options to customize the client behavior:
Custom Base URL
Custom HTTP Client
Retry Configuration
The SDK automatically retries failed requests (network errors and 5xx server errors) up to 3 times by default with exponential backoff. You can customize the retry count:
Note: Retries only occur for:
- Network errors (connection failures, timeouts)
- Server errors (5xx status codes)
Client errors (4xx status codes) are not retried as they indicate invalid requests.
Custom Token Cache
For applications that need to share tokens across multiple instances or persist tokens, you can provide a custom cache implementation:
API Reference
Authentication
Authentication is handled automatically by the SDK. When you create a client, it will authenticate using your app key and secret key. Tokens are automatically refreshed when they expire.
Wallet Operations
Get Wallet Details
Deposit Funds
Withdraw Funds
Transaction Operations
List Transactions
Get Transaction Details
Merchant Profile
Get Merchant Profile
Error Handling
The SDK provides specific exception types to help you handle different error scenarios:
Best Practices
1. Reuse Client Instances
Create a single client instance and reuse it across your application. The client handles token management efficiently.
2. Use Custom HTTP Client for Production
Configure your HTTP client with appropriate timeouts and connection pooling.
3. Implement Custom Token Cache for Distributed Systems
If you're running multiple instances of your application, implement a shared token cache (e.g., Redis) to avoid unnecessary authentication requests.
4. Handle Errors Appropriately
Use exception type checking to handle different error scenarios appropriately.
5. Use Dependency Injection
For better testability and maintainability, use dependency injection to provide the client to your services.
Data Models
Transaction Status
TransactionStatus::PENDING- Transaction is pendingTransactionStatus::COMPLETED- Transaction completed successfullyTransactionStatus::FAILED- Transaction failedTransactionStatus::CANCELLED- Transaction was cancelledTransactionStatus::UNKNOWN- Unknown status
Transaction Type
TransactionType::DEPOSIT- Deposit transactionTransactionType::WITHDRAWAL- Withdrawal transactionTransactionType::TRANSFER- Transfer transactionTransactionType::FEE- Fee transaction
Requirements
- PHP 8.0 or higher
- Composer
- Guzzle HTTP Client 7.0 or higher
License
This SDK is provided as-is. Please refer to your Pasis service agreement for usage terms.
Support
For API documentation and support, please visit the Pasis documentation or contact support.