Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Something in Tahseel behaves wrong
about: Something in Paykit behaves wrong
title: ''
labels: bug
---
Expand All @@ -9,7 +9,7 @@ labels: bug

**What you expected**

**Which driver** (paymob / kashier / fawry / geidea / manual) and Tahseel version (`composer show elbanbydev/tahseel`)
**Which driver** (paymob / kashier / fawry / geidea / manual) and Paykit version (`composer show elbanbydev/paykit`)

**Laravel and PHP versions**

Expand Down
22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# Changelog

All notable changes to Tahseel are documented here. This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
All notable changes to Paykit (called Tahseel up to 0.4.0) are documented here. This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

Nothing yet.

## [0.5.0] - 2026-12-05

**Tahseel is now Paykit.** Same code, same drivers, same behaviour; only the name changed. This is a breaking release for anyone who installed `elbanbydev/tahseel`, because every public name moved. Entries below this one keep the old names as they were written at the time.

### Upgrading from Tahseel 0.4.x

1. `composer remove elbanbydev/tahseel && composer require elbanbydev/paykit`. The old package is not updated any more.
2. Replace the namespace: `Tahseel\` becomes `Paykit\` (`use Tahseel\...` statements, the `Tahseel` facade and alias, `TahseelManager`, `TahseelException`, `FakeTahseelManager`, `TahseelServiceProvider`).
3. Config: publish `config/paykit.php` and move your values over from `config/tahseel.php`, then delete the old file. The config key is `paykit.*`, not `tahseel.*`.
4. Env vars: every `TAHSEEL_*` variable is now `PAYKIT_*` (for example `PAYKIT_GATEWAY`, `PAYKIT_WEBHOOKS_PATH`, `PAYKIT_MANUAL_PANEL_LOCALE`). Gateway credential variables such as `PAYMOB_*` and `STRIPE_*` are unchanged. The old names are not read as a fallback.
5. **Webhook URLs move** from `/tahseel/webhooks/{gateway}` to `/paykit/webhooks/{gateway}`. Either update the URL in each gateway dashboard, or keep the old URL by setting `PAYKIT_WEBHOOKS_PATH=tahseel/webhooks/{gateway}`. Do this before deploying or webhooks will return 404. The manual-transfer routes move the same way (`tahseel/manual` to `paykit/manual`, override with `PAYKIT_MANUAL_PROOF_PATH`), and so do the route names (`tahseel.*` to `paykit.*`) and the view namespace (`tahseel::` to `paykit::`).
6. Artisan commands: `tahseel:check`, `tahseel:smoke`, `tahseel:manual:expire`, `tahseel:manual:prune-proofs` are now `paykit:*`. Update your scheduler entries.
7. Database: run `php artisan migrate`. The manual-transfer tables `tahseel_manual_payments` and `tahseel_manual_events` are renamed in place to `paykit_manual_payments` and `paykit_manual_events` with their rows kept. Back up first.
8. Cache: keys prefixed `tahseel:` (idempotency records, webhook replay markers) are not carried over. In-flight idempotency keys and replay protection restart empty; a webhook redelivered across the upgrade can be processed once more.
9. Published views or translations under `resources/views/vendor/tahseel` need to move to `resources/views/vendor/paykit` (same for `lang/vendor`).

### Changed

- Package renamed from `elbanbydev/tahseel` to `elbanbydev/paykit`, repository renamed to `elbanbydev/paykit`, README, EN and AR docs, CI badge and issue templates updated. The Arabic docs no longer carry the Arabic product name.

## [0.4.0] - 2026-12-04

Thirteen more gateways since 0.3.0, taking the package from fourteen drivers to twenty-seven (twenty-six gateways plus manual transfers), every one of them verified against its published documentation and fixture-tested. The package is still experimental: only Kashier and Paymob have ever run against a real provider account, and the README says so driver by driver.
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ composer check # Pint, Larastan and Pest

## Adding a gateway

1. Implement `Tahseel\Contracts\Gateway`.
2. Add a `create{Name}Driver()` method to `TahseelManager`.
3. Add the driver block to `config/tahseel.php`.
1. Implement `Paykit\Contracts\Gateway`.
2. Add a `create{Name}Driver()` method to `PaykitManager`.
3. Add the driver block to `config/paykit.php`.
4. Add fixtures and tests, including a signature test that pins the exact signed string.
5. Document the credentials and the limitations.

Expand Down
346 changes: 175 additions & 171 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Email **ahmed@elbanby.com** with the details. Please do not open a public issue for anything that could put a merchant's payments at risk. Expect an answer within a few days.

## What Tahseel assumes
## What Paykit assumes

- Gateway secrets (`secret_key`, `hmac_secret`) stay on the server and out of logs. Only `public_key` is safe in a browser.
- A callback is untrusted until its signature verifies. The webhook endpoint verifies before it dispatches anything, and it compares digests in constant time.
Expand All @@ -14,4 +14,4 @@ Email **ahmed@elbanby.com** with the details. Please do not open a public issue
## Known limits

- Replay protection is cache based. If the cache is flushed between two deliveries of the same callback, the transaction is processed twice. Make your listener idempotent as well.
- Tahseel does not rate-limit the webhook endpoint. Put it behind your usual middleware if that matters to you.
- Paykit does not rate-limit the webhook endpoint. Put it behind your usual middleware if that matters to you.
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elbanbydev/tahseel",
"description": "Tahseel (تحصيل) - a clean, framework-native Laravel package for payment gateways: Paymob, Kashier, Fawry, Geidea, MyFatoorah, Tap, HyperPay, Checkout.com, PayPal, Stripe, Paystack, Moyasar, Razorpay, Mercado Pago, Mollie, Adyen, Flutterwave, PayTabs, Klarna, Square, Xendit, Telr, Viva.com, PayU, Tabby, Tamara and manual transfers (Vodafone Cash, InstaPay) behind one gateway contract with signed webhook verification. Experimental.",
"name": "elbanbydev/paykit",
"description": "Paykit - a clean, framework-native Laravel package for payment gateways: Paymob, Kashier, Fawry, Geidea, MyFatoorah, Tap, HyperPay, Checkout.com, PayPal, Stripe, Paystack, Moyasar, Razorpay, Mercado Pago, Mollie, Adyen, Flutterwave, PayTabs, Klarna, Square, Xendit, Telr, Viva.com, PayU, Tabby, Tamara and manual transfers (Vodafone Cash, InstaPay) behind one gateway contract with signed webhook verification. Experimental.",
"keywords": [
"laravel",
"payments",
Expand All @@ -18,7 +18,7 @@
"egp",
"payment-gateway",
"fintech",
"tahseel",
"paykit",
"paystack",
"moyasar",
"stc pay",
Expand Down Expand Up @@ -92,21 +92,21 @@
},
"autoload": {
"psr-4": {
"Tahseel\\": "src/"
"Paykit\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tahseel\\Tests\\": "tests/"
"Paykit\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"providers": [
"Tahseel\\TahseelServiceProvider"
"Paykit\\PaykitServiceProvider"
],
"aliases": {
"Tahseel": "Tahseel\\Facades\\Tahseel"
"Paykit": "Paykit\\Facades\\Paykit"
}
}
},
Expand Down
66 changes: 33 additions & 33 deletions config/tahseel.php → config/paykit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
| Default gateway
|--------------------------------------------------------------------------
|
| The driver used when you call Tahseel::createPayment() or resolve a
| The driver used when you call Paykit::createPayment() or resolve a
| gateway without naming one.
|
*/

'default' => env('TAHSEEL_GATEWAY', 'paymob'),
'default' => env('PAYKIT_GATEWAY', 'paymob'),

/*
|--------------------------------------------------------------------------
Expand All @@ -28,36 +28,36 @@
*/

'idempotency' => [
'enabled' => env('TAHSEEL_IDEMPOTENCY', true),
'store' => env('TAHSEEL_IDEMPOTENCY_STORE'),
'ttl' => (int) env('TAHSEEL_IDEMPOTENCY_TTL', 86400),
'enabled' => env('PAYKIT_IDEMPOTENCY', true),
'store' => env('PAYKIT_IDEMPOTENCY_STORE'),
'ttl' => (int) env('PAYKIT_IDEMPOTENCY_TTL', 86400),
],

/*
|--------------------------------------------------------------------------
| Webhooks
|--------------------------------------------------------------------------
|
| Tahseel registers POST {path} (default: tahseel/webhooks/{gateway}).
| Paykit registers POST {path} (default: paykit/webhooks/{gateway}).
| Point Paymob's notification_url at it, e.g.
| https://your-app.com/tahseel/webhooks/paymob
| https://your-app.com/paykit/webhooks/paymob
|
| The route is registered on the application's route stack; if you keep
| webhook routes inside the `api` middleware group, add that group here.
|
*/

'webhooks' => [
'enabled' => env('TAHSEEL_WEBHOOKS', true),
'path' => env('TAHSEEL_WEBHOOKS_PATH', 'tahseel/webhooks/{gateway}'),
'enabled' => env('PAYKIT_WEBHOOKS', true),
'path' => env('PAYKIT_WEBHOOKS_PATH', 'paykit/webhooks/{gateway}'),
'middleware' => [],
'deduplicate' => env('TAHSEEL_WEBHOOKS_DEDUPLICATE', true),
'deduplicate' => env('PAYKIT_WEBHOOKS_DEDUPLICATE', true),

// Drop a callback that is older than one already handled for the same
// order, so a retried old status never overwrites a newer one.
'ordering' => env('TAHSEEL_WEBHOOKS_ORDERING', true),
'store' => env('TAHSEEL_WEBHOOKS_STORE'),
'dedupe_ttl' => (int) env('TAHSEEL_WEBHOOKS_DEDUPE_TTL', 172800),
'ordering' => env('PAYKIT_WEBHOOKS_ORDERING', true),
'store' => env('PAYKIT_WEBHOOKS_STORE'),
'dedupe_ttl' => (int) env('PAYKIT_WEBHOOKS_DEDUPE_TTL', 172800),
],

/*
Expand All @@ -82,7 +82,7 @@
'hmac_secret' => env('PAYMOB_HMAC_SECRET'),

// Optional. Paymob's refund and void endpoints also accept a
// short-lived auth token in the body; set the API key and Tahseel
// short-lived auth token in the body; set the API key and Paykit
// mints one per call. The secret key header is always sent.
'api_key' => env('PAYMOB_API_KEY'),

Expand Down Expand Up @@ -778,69 +778,69 @@
| null and the panel routes are not registered at all.
*/
'manual' => [
'enabled' => env('TAHSEEL_MANUAL', true),
'enabled' => env('PAYKIT_MANUAL', true),

'default_method' => env('TAHSEEL_MANUAL_METHOD', 'vodafone_cash'),
'default_method' => env('PAYKIT_MANUAL_METHOD', 'vodafone_cash'),

// Where the money lands. "account" is what the customer sees: a
// wallet number, an InstaPay handle, a bank account.
'methods' => [
'vodafone_cash' => [
'label' => 'Vodafone Cash',
'account' => env('TAHSEEL_VODAFONE_CASH_NUMBER'),
'account' => env('PAYKIT_VODAFONE_CASH_NUMBER'),
// Or several numbers: the one with the fewest open payments takes the next.
// 'accounts' => ['01000000001', '01000000002'],
// Optional per-payment limits, in minor units (piasters).
// 'min_minor' => 1000, 'max_minor' => 3000000,
],
'instapay' => [
'label' => 'InstaPay',
'account' => env('TAHSEEL_INSTAPAY_HANDLE'),
'account' => env('PAYKIT_INSTAPAY_HANDLE'),
],
],

'currency' => env('TAHSEEL_MANUAL_CURRENCY', 'EGP'),
'currency' => env('PAYKIT_MANUAL_CURRENCY', 'EGP'),

// How long a reference stays valid. An expired payment that never
// got a receipt cannot be approved, whatever the panel shows.
// A payment whose receipt already arrived can still be decided by
// a human after the window; see `expire_awaiting_review` below.
'expires_after_minutes' => (int) env('TAHSEEL_MANUAL_EXPIRES', 1440),
'expires_after_minutes' => (int) env('PAYKIT_MANUAL_EXPIRES', 1440),

// A payment with a receipt waiting on a human is not expired by
// `expireOverdue()` unless you say so. Off by default: the human
// can still approve it after the window, when they have read the
// receipt.
'expire_awaiting_review' => (bool) env('TAHSEEL_MANUAL_EXPIRE_REVIEW', false),
'expire_awaiting_review' => (bool) env('PAYKIT_MANUAL_EXPIRE_REVIEW', false),

// Everything below is off until you turn it on.
'status' => ['enabled' => env('TAHSEEL_MANUAL_STATUS', false)],
'audit' => ['enabled' => env('TAHSEEL_MANUAL_AUDIT', false)],
'status' => ['enabled' => env('PAYKIT_MANUAL_STATUS', false)],
'audit' => ['enabled' => env('PAYKIT_MANUAL_AUDIT', false)],

// The customer's proof upload: private disk, served only through
// the panel, never from a public URL.
'proof' => [
'disk' => env('TAHSEEL_MANUAL_PROOF_DISK', 'local'),
'max_kb' => (int) env('TAHSEEL_MANUAL_PROOF_MAX_KB', 5120),
'disk' => env('PAYKIT_MANUAL_PROOF_DISK', 'local'),
'max_kb' => (int) env('PAYKIT_MANUAL_PROOF_MAX_KB', 5120),
'mimes' => ['jpg', 'jpeg', 'png', 'webp', 'pdf'],
],

// POST {path}/{reference}/proof - the customer's side.
'proof_path' => env('TAHSEEL_MANUAL_PROOF_PATH', 'tahseel/manual'),
'proof_path' => env('PAYKIT_MANUAL_PROOF_PATH', 'paykit/manual'),
'proof_middleware' => ['web', 'throttle:30,1'],

// GET {path} and the two decisions - the merchant's side.
'panel' => [
'enabled' => env('TAHSEEL_MANUAL_PANEL', true),
'path' => env('TAHSEEL_MANUAL_PANEL_PATH', 'tahseel/manual/panel'),
'enabled' => env('PAYKIT_MANUAL_PANEL', true),
'path' => env('PAYKIT_MANUAL_PANEL_PATH', 'paykit/manual/panel'),
'middleware' => ['web'],
'ability' => env('TAHSEEL_MANUAL_PANEL_ABILITY'),
'ability' => env('PAYKIT_MANUAL_PANEL_ABILITY'),
// Extras, each off until you turn it on.
'search' => env('TAHSEEL_MANUAL_PANEL_SEARCH', false),
'export' => env('TAHSEEL_MANUAL_PANEL_EXPORT', false),
'search' => env('PAYKIT_MANUAL_PANEL_SEARCH', false),
'export' => env('PAYKIT_MANUAL_PANEL_EXPORT', false),
// Panel language: null follows the app's locale; set
// TAHSEEL_MANUAL_PANEL_LOCALE=ar for an Arabic (RTL) panel.
'locale' => env('TAHSEEL_MANUAL_PANEL_LOCALE'),
// PAYKIT_MANUAL_PANEL_LOCALE=ar for an Arabic (RTL) panel.
'locale' => env('PAYKIT_MANUAL_PANEL_LOCALE'),
],
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
{
public function up(): void
{
Schema::create('tahseel_manual_payments', function (Blueprint $table): void {
// Installed under the old Tahseel name: keep the rows, take the new name.
if (Schema::hasTable('tahseel_manual_payments') && ! Schema::hasTable('paykit_manual_payments')) {
Schema::rename('tahseel_manual_payments', 'paykit_manual_payments');

return;
}

Schema::create('paykit_manual_payments', function (Blueprint $table): void {
$table->id();

// Our own code, handed to the customer. Unique and unguessable, so
Expand Down Expand Up @@ -47,6 +54,6 @@ public function up(): void

public function down(): void
{
Schema::dropIfExists('tahseel_manual_payments');
Schema::dropIfExists('paykit_manual_payments');
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
{
public function up(): void
{
Schema::table('tahseel_manual_payments', function (Blueprint $table): void {
// A table renamed from the old Tahseel install already has this index.
foreach (Schema::getIndexes('paykit_manual_payments') as $index) {
if ($index['unique'] && $index['columns'] === ['transfer_reference']) {
return;
}
}

Schema::table('paykit_manual_payments', function (Blueprint $table): void {
// One transfer reference settles one payment, so a customer cannot
// reuse a single receipt number on two orders.
$table->unique('transfer_reference');
Expand All @@ -19,7 +26,7 @@ public function up(): void

public function down(): void
{
Schema::table('tahseel_manual_payments', function (Blueprint $table): void {
Schema::table('paykit_manual_payments', function (Blueprint $table): void {
$table->dropUnique(['transfer_reference']);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@
{
public function up(): void
{
// Installed under the old Tahseel name: keep the trail, take the new name.
if (Schema::hasTable('tahseel_manual_events') && ! Schema::hasTable('paykit_manual_events')) {
Schema::rename('tahseel_manual_events', 'paykit_manual_events');

return;
}

// An append-only trail of what happened to each manual payment and who
// did it. The package only ever inserts into it.
Schema::create('tahseel_manual_events', function (Blueprint $table): void {
Schema::create('paykit_manual_events', function (Blueprint $table): void {
$table->id();
$table->string('payment_reference', 40)->index();
$table->string('event', 32)->index();
Expand All @@ -24,6 +31,6 @@ public function up(): void

public function down(): void
{
Schema::dropIfExists('tahseel_manual_events');
Schema::dropIfExists('paykit_manual_events');
}
};
Loading
Loading