Download the PHP package tapsilat/tapsilat-php without Composer
On this page you can find all versions of the php package tapsilat/tapsilat-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package tapsilat-php
Tapsilat Client SDK for PHP
Create orders and retrieve secure checkout URLs.
Requires PHP 7.4+
Installation
You can install the package via Composer:
or
Usage
Environment Setup
Create a .env file:
TapsilatAPI Initialization
Validators
The SDK includes built-in validators for common data types:
GSM Number Validation
Installments Validation
Order Create Process
Get Order Details
Get Order Details by Conversation ID
Get Order List
Get Order Submerchants
Get Checkout URL
Order Cancel Process
Order Refund Process
Order Refund All Process
Get Order Payment Details
Get Order Status
Get Order Transactions
Charge Order
Get Order Payments
getAllOrdersPayments() is deprecated: the API has no route for it. List one order's payments instead:
Get Order Term
Create Order Term
order_id is the order's ID (from order creation), not its reference ID. Term dates use YYYY-MM-DD.
Delete Order Term
Update Order Term
An update replaces the term, so send every field.
Refund Order Term
Terminate Order
Manual Callback for Order
Order Related Reference Update
Get Organization Settings
Organization Management
getOrganizationLimits(), getOrganizationLimitUser() and setOrganizationLimitUser() are deprecated: the API has no such routes.
Health Monitoring
Submerchant Management
Document Export (PDF & Excel)
Card Installments
Submerchant Settlement and Payout Events
Virtual POS
A VPOS update replaces the whole configuration (fields left out are stored as empty or false), so read it first and send every field back.
Saved Cards
Marketplace (API v2)
Marketplace calls use the /api/v2 URL derived from the base URL. Seller and payout revisions are opaque strings:
send them back exactly as received.
Tapsilat Elements Sessions
Tapsilat Elements is the native Android and iOS card sheet. Your backend creates a session with its secret API key and
passes only the session's client_secret to the app, which opens the sheet with it. Card data goes from the sheet to
Tapsilat encrypted and never reaches your backend.
A pay session needs order_reference_id. A tokenize session saves a card for user_id, with mode set to
MODE_SECURE (3D Secure), MODE_HALF_SECURE or MODE_NON_SECURE. A session's status is one of the
ElementsSession::STATUS_ constants (requires_payment_method, processing, requires_action, succeeded, failed,
expired, canceled), and getLastError() says why the last attempt failed. cancelElementsSession() returns a
session that is confirming or has completed unchanged.
Only createElementsSession() returns the client secret. var_dump() and print_r() show it as [redacted], while
toArray() and json_encode() keep it so that you can send it to the app. Errors carry a stable code, such as
elements_not_enabled (403), session_not_found (404) or unavailable (503), and retryable.
Error Handling
API errors throw Tapsilat\APIException with the HTTP status (statusCode), the body's code, the message (error,
from the body's message or error), per-field errors, the body's status, the raw body (rawBody) and
retryable, true when the error says the request can be retried. Elements routes nest the error as
{"error": {"code": "...", "message": "...", "retryable": true}}; code, error and retryable are read from that
object. A response that is not JSON, such as an HTML page from a wrong base URL, also throws.
System & Webhooks
Get System Definitions and Statuses
Get System Config
Webhook Handling
Verify Webhook Signature
Tapsilat signs every callback it sends to your callback URLs, and to an order's payment_success_url and payment_failure_url, with the webhook secret from the panel's callback settings. The Tapsilat-Signature header looks like t=1726480000,v1=5257a8…: v1 is the hex HMAC-SHA256 of the timestamp, a dot and the raw body.
verifyWebhook checks it in constant time and rejects a timestamp more than 5 minutes from the server clock, so a captured callback cannot be replayed. Pass the raw body, not re-encoded JSON.
A different tolerance in seconds can be passed as the fourth argument (0 disables the timestamp check). A bare hex HMAC of the body, with or without a sha256= prefix, is still accepted for signatures made the way earlier SDK versions documented.
Order Statuses
Tapsilat\OrderStatus has the numeric status codes that callbacks carry, the names getOrderStatus() returns, and the groups most integrations need:
Subscription Operations
Create Subscription
Get Subscription
List Subscriptions
Cancel Subscription
Redirect Subscription
Requirements
- PHP >= 7.4
License
The MIT License (MIT). Please see License File for more information.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Testing
The SDK includes comprehensive unit and integration tests.
Environment Setup
For integration tests, create a .env file in the project root:
Running Tests
Test Structure
Test Coverage
- Unit Tests: 87 tests covering all 28 API methods
- Integration Tests: 6 tests for critical API flows
- Total: 93 tests with 228 assertions
CI/CD
This package uses GitHub Actions for continuous integration and deployment:
-
CI: Runs on every push to main/develop and pull requests
- Tests against PHP 7.4, 8.0, 8.1, 8.2, and 8.3
- Validates composer.json
- Runs PHPUnit tests
- Checks code style with PHP_CodeSniffer
-
Release & Publish: Automatically triggered when a new tag is pushed
- Creates a GitHub release (if it doesn't exist)
- Validates and tests the package
- Publishes to Packagist (if configured)
- Verifies package availability on Packagist
-
Packagist Webhook: Automatically notifies Packagist on every push to main
- Triggers on pushes to main branch and merged PRs
- Keeps Packagist updated with latest changes
- Works alongside GitHub webhook for immediate updates
- Dependabot: Automatically updates dependencies
- Weekly updates for Composer packages
- Weekly updates for GitHub Actions
- Creates pull requests for review
To create a new release:
This will automatically:
- Create a GitHub release
- Publish the package to Packagist
- Make it available via
composer require tapsilat/tapsilat-php
Docker Development
This package includes Docker support for easy development setup.
Quick Start
Available Commands
./docker-dev.sh build- Build the Docker image./docker-dev.sh start- Start the development container./docker-dev.sh stop- Stop the development container./docker-dev.sh restart- Restart the development container./docker-dev.sh shell- Open a shell in the development container./docker-dev.sh test- Run tests in the container./docker-dev.sh install- Install dependencies./docker-dev.sh clean- Clean up containers and images./docker-dev.sh help- Show help message