PHPackages                             dp-soft-co/payments - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. dp-soft-co/payments

ActiveLibrary[Payment Processing](/categories/payments)

dp-soft-co/payments
===================

Payment helper for Paypal, Paymob, Kashier, Hyperpay, Fawry and more - Forked from nafezly/payments with Kashier Payment Sessions API fix

v4.0.2(1mo ago)051↓75%MITPHPPHP &gt;=7.2

Since Jul 21Pushed 1mo agoCompare

[ Source](https://github.com/dp-soft-co/payments)[ Packagist](https://packagist.org/packages/dp-soft-co/payments)[ RSS](/packages/dp-soft-co-payments/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (4)Versions (22)Used By (0)

Dpsoft Payment Gateways
=======================

[](#dpsoft-payment-gateways)

[![Latest Version](https://camo.githubusercontent.com/a28e20c970aa67a85afecf83ada6ad5beb28c417b8e04df045fbd0e3a9d12e06/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f64702d736f66742d636f2f7061796d656e7473)](https://github.com/dp-soft-co/payments/tags)[![MIT License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://choosealicense.com/licenses/mit/)[![Packagist](https://camo.githubusercontent.com/414d1ac3c8b9f2cffea9ce764fb7018ec6ac33143753b2e7ba0513a0ee4e4cc7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436f6d706f7365722d64702d2d736f66742d2d636f2f7061796d656e74732d626c7565)](https://packagist.org/packages/dp-soft-co/payments)

A Laravel package for integrating multiple payment gateways with a unified API. Supports 19+ gateways including PayPal, Paymob, Kashier, Fawry, Fawaterk, HyperPay, Thawani, Tap, Opay, Paytabs, Binance, PerfectMoney, NowPayments, Payeer, Telr, Clickpay, MyFatoorah, Stripe, and E-Wallets.

[![payment-gateways.jpg](https://github.com/dp-soft-co/payments/raw/master/payment-gateways.jpg?raw=true&v=6)](https://github.com/dp-soft-co/payments/blob/master/payment-gateways.jpg?raw=true&v=6)

Supported Gateways
------------------

[](#supported-gateways)

GatewayKeyModesNotes[PayPal](https://paypal.com/)`paypal`Sandbox / LiveREST API v2 with redirect &amp; button checkout[PayPal Buttons](https://paypal.com/)`paypal_button`Sandbox / LiveJS SDK button integration[PayMob](https://paymob.com/)`paymob`Test / LiveCard payments with redirect &amp; pixel checkout[PayMob Wallets](https://paymob.com/)`paymob_wallet`Test / LiveVodafone Cash, Orange Money, Meza Wallet, Etisalat Cash, We Cash[Kashier](https://kashier.io/)`kashier`Test / LivePayment Sessions API with iframe[Fawry](https://fawry.com/)`fawry`Test / LivePopup / inside page / side page[Fawaterk](https://fawaterk.com/)`fawaterk`Test / LiveAPI v3 — OAuth + hosted checkout &amp; iframe[HyperPay](https://www.hyperpay.com/)`hyperpay`Test / LiveCredit, MADA, Apple Pay[Thawani](https://thawani.om/)`thawani`Test / LiveOman-based gateway[Tap](https://www.tap.company/)`tap`Test / LiveMulti-currency[Opay](https://www.opaycheckout.com/)`opay`Test / LiveEgypt &amp; Nigeria[Paytabs](https://site.paytabs.com/)`paytabs`Test / LiveMulti-region[Binance Pay](https://www.binance.com/en)`binance`LiveCrypto payments[PerfectMoney](https://perfectmoney.com/)`perfectmoney`LiveSCI form-based[NowPayments](https://nowpayments.io/)`nowpayments`LiveCrypto invoices[Payeer](https://payeer.com/)`payeer`LiveMulti-currency e-wallet[Telr](https://telr.com/)`telr`Test / LiveUAE-based gateway[Clickpay](https://clickpay.com.sa/)`clickpay`Test / LiveSaudi-based[MyFatoorah](https://myfatoorah.com/)`myfatoorah`Test / LiveMulti-country (EG, SA, AE, QA, KW)[Stripe](https://stripe.com/)`stripe`Test / LiveCheckout SessionsInstallation
------------

[](#installation)

```
composer require dp-soft-co/payments
```

Publish Vendor Files
--------------------

[](#publish-vendor-files)

```
php artisan vendor:publish --tag="dpsoft-payments-config"
php artisan vendor:publish --tag="dpsoft-payments-lang"
```

Configuration
-------------

[](#configuration)

All gateway settings are driven by environment variables. After publishing, edit `config/dpsoft-payments.php` and add the keys you need to your `.env`.

### PayMob

[](#paymob)

```
PAYMOB_BASE_URL=https://accept.paymob.com
PAYMOB_PUBLIC_KEY=your_public_key
PAYMOB_SECRET_KEY=your_secret_key
PAYMOB_HMAC=your_hmac_secret
PAYMOB_INTEGRATION_ID=your_integration_id
PAYMOB_CURRENCY=EGP
PAYMOB_NOTIFICATION_URL=https://yoursite.com/payment/verify/paymob
PAYMOB_CHECKOUT_MODE=redirect          # redirect or pixel
PAYMOB_PIXEL_PAYMENT_METHODS=card      # card, google-pay, apple-pay
PAYMOB_WALLET_INTEGRATION_ID=wallet_integration_id
```

### Fawaterk (API v3)

[](#fawaterk-api-v3)

Fawaterk v3 uses **OAuth client credentials** for API calls and **Vendor API Key** for hash signing (iframe &amp; webhooks).

```
# OAuth — dashboard → Integrations → OAuth client credentials
FAWATERK_CLIENT_ID=9d4e2c1a-b3f5-4e8a-9c1d-2a3b4c5d6e7f
FAWATERK_CLIENT_SECRET=your_client_secret

# Vendor API Key — dashboard → Integrations → Get API Key (for hash signing only)
FAWATERK_API_KEY=d83a5d07aaeb8442dcbe259e6dae80a3f2e21a3a581e1a5acd

# Provider Key — dashboard → Integrations → Fawaterk (required for iframe)
FAWATERK_PROVIDER_KEY=FAWATERAK_29503

# Environment
FAWATERK_MODE=test                     # test or live (auto-resolves base URL)
# FAWATERK_BASE_URL=https://staging.fawaterk.com  # optional, auto from mode

# Checkout
FAWATERK_CHECKOUT_MODE=redirect        # redirect or iframe
FAWATERK_CURRENCY=EGP
FAWATERK_IFRAME_LISTING=horizontal      # horizontal or vertical
```

**Endpoints used:**

- `POST /api/v3/createTransaction` — create payment (OAuth Bearer token)
- `POST /api/v3/getTransactionData` — verify payment (OAuth Bearer token)
- `POST /oauth/token` — obtain access token (client credentials grant)

**Webhook hash verification:**

- Paid webhook: `transactionHashKey` = `HMAC-SHA256("TransactionId={id}&TransactionKey={key}&PaymentMethod={method}", vendor_api_key)`
- Failed webhook: `hashKey` = same formula as above
- Cancel webhook: `hashKey` = `HMAC-SHA256("referenceId={refId}&PaymentMethod={method}", vendor_api_key)`
- Legacy v2 webhooks still supported via `hashKey` with `InvoiceId`/`InvoiceKey`

**Iframe hash:**

- `hashKey` = `HMAC-SHA256("Domain={your_domain}&ProviderKey={provider_key}", vendor_api_key)`
- Uses `fawaterkCheckoutV2()` and `fawaterkPlugin.js`

### Kashier

[](#kashier)

```
KASHIER_ACCOUNT_KEY=your_account_key
KASHIER_IFRAME_KEY=your_iframe_key
KASHIER_TOKEN=your_api_token
KASHIER_URL=https://checkout.kashier.io
KASHIER_MODE=test                       # test or live
KASHIER_CURRENCY=EGP
KASHIER_WEBHOOK_URL=https://yoursite.com/payment/verify/kashier
```

### HyperPay

[](#hyperpay)

```
HYPERPAY_BASE_URL=https://eu-test.oppwa.com
HYPERPAY_TOKEN=your_access_token
HYPERPAY_CREDIT_ID=your_credit_entity_id
HYPERPAY_MADA_ID=your_mada_entity_id
HYPERPAY_APPLE_ID=your_apple_entity_id
HYPERPAY_CURRENCY=SAR
```

### Fawry

[](#fawry)

```
FAWRY_URL=https://atfawry.fawrystaging.com/   # https://www.atfawry.com/ for production
FAWRY_SECRET=your_secret
FAWRY_MERCHANT=your_merchant_code
FAWRY_DISPLAY_MODE=POPUP                       # POPUP, INSIDE_PAGE, SIDE_PAGE, SEPARATED
FAWRY_PAY_MODE=CARD                            # CashOnDelivery, PayAtFawry, MWALLET, CARD, VALU
```

### PayPal

[](#paypal)

```
PAYPAL_CLIENT_ID=your_client_id
PAYPAL_SECRET=your_secret
PAYPAL_CURRENCY=USD
PAYPAL_MODE=sandbox                            # sandbox or live
```

### Stripe

[](#stripe)

```
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_PUBLISHABLE_KEY=pk_test_xxx
STRIPE_CURRENCY=USD
```

### Thawani

[](#thawani)

```
THAWANI_API_KEY=your_api_key
THAWANI_PUBLISHABLE_KEY=your_publishable_key
THAWANI_URL=https://uatcheckout.thawani.om/
```

### Tap

[](#tap)

```
TAP_SECRET_KEY=your_secret_key
TAP_PUBLIC_KEY=your_public_key
TAP_CURRENCY=USD
TAP_LANG_KEY=ar
```

### Opay

[](#opay)

```
OPAY_SECRET_KEY=your_secret_key
OPAY_PUBLIC_KEY=your_public_key
OPAY_MERCHANT_ID=your_merchant_id
OPAY_COUNTRY_CODE=EG
OPAY_CURRENCY=EGP
OPAY_BASE_URL=https://sandboxapi.opaycheckout.com   # https://api.opaycheckout.com for production
```

### Paytabs

[](#paytabs)

```
PAYTABS_PROFILE_ID=your_profile_id
PAYTABS_SERVER_KEY=your_server_key
PAYTABS_BASE_URL=https://secure-egypt.paytabs.com
PAYTABS_CHECKOUT_LANG=AR
PAYTABS_CURRENCY=EGP
```

### Binance Pay

[](#binance-pay)

```
BINANCE_API=your_api_key
BINANCE_SECRET=your_api_secret
```

### NowPayments

[](#nowpayments)

```
NOWPAYMENTS_API_KEY=your_api_key
```

### Payeer

[](#payeer)

```
PAYEER_MERCHANT_ID=your_merchant_id
PAYEER_API_KEY=your_api_key
PAYEER_ADDITIONAL_API_KEY=your_additional_api_key
```

### PerfectMoney

[](#perfectmoney)

```
PERFECT_MONEY_ID=UXXXXXXX
PERFECT_MONEY_PASSPHRASE=your_passphrase
```

### Telr

[](#telr)

```
TELR_MERCHANT_ID=your_merchant_id
TELR_API_KEY=your_api_key
TELR_MODE=test                                 # test or live
```

### Clickpay

[](#clickpay)

```
CLICKPAY_SERVER_KEY=your_server_key
CLICKPAY_PROFILE_ID=your_profile_id
```

### MyFatoorah

[](#myfatoorah)

```
MYFATOORAH_API_KEY=your_api_key
MYFATOORAH_MODE=test                           # test or live
MYFATOORAH_COUNTRY=                            # eg, sa, ae, qa or empty for global
MYFATOORAH_CURRENCY=KWD
```

How To Use
----------

[](#how-to-use)

### Standard Controller Example

[](#standard-controller-example)

The following Laravel controller pattern works with every gateway supported by the package. Store the gateway class name used to create the invoice so the callback can use the same gateway. Replace `Invoice`, the payment view, and success/failure routes with your application equivalents.

```
use App\Models\Invoice;
use Dpsoft\Payments\Facades\DpsoftPaymentsFacade as DpsoftPayments;
use Illuminate\Http\Request;

public function pay(Request $request)
{
    $data = $request->validate([
        'gateway' => ['required', 'string'],
        'amount' => ['required', 'numeric', 'min:0.01'],
    ]);

    $user = $request->user();
    $gateway = $data['gateway'];
    $source = match (strtolower($gateway)) {
        'kashier' => 'card,bank_installments,wallet,fawry',
        'hyperpay' => 'CREDIT',
        default => null,
    };

    $response = DpsoftPayments::gateway($gateway)
        ->setPaymentData([
            'amount' => $data['amount'],
            'user_id' => $user->id,
            'user_first_name' => $user->firstname,
            'user_last_name' => $user->lastname,
            'user_email' => $user->email,
            'user_phone' => $user->phone,
            'source' => $source,
        ])
        ->pay();

    if (empty($response['payment_id'])) {
        abort(422, strip_tags($response['html'] ?? 'Payment creation failed.'));
    }

    Invoice::create([
        'user_id' => $user->id,
        'amount' => $data['amount'],
        'status' => 'pending',
        'pid' => $response['payment_id'],
        'gateway' => $gateway,
    ]);

    if (!empty($response['redirect_url'])) {
        return redirect()->away($response['redirect_url']);
    }

    if (!empty($response['html'])) {
        return view('payments.pay', ['link' => $response['html']]);
    }

    abort(422, 'Invalid gateway response.');
}

public function verify(string $gateway, Request $request)
{
    $result = DpsoftPayments::gateway($gateway)->verify($request);

    $invoice = Invoice::where('pid', $result['payment_id'] ?? null)
        ->where('gateway', $gateway)
        ->firstOrFail();

    if ($result['success']) {
        $invoice->update(['status' => 'paid']);

        return redirect()->route('payments.success');
    }

    return redirect()->route('payments.failed');
}
```

Render gateway HTML only when it comes directly from the package response:

```
{!! $link !!}
```

Register the verification route:

```
Route::match(['get', 'post'], '/payments/verify/{gateway}', [PaymentController::class, 'verify'])
    ->name('verify-payment');
```

### CSRF Protection

[](#csrf-protection)

Payment gateways send POST callbacks from an iframe or external page and will not include the Laravel CSRF token. You must exclude the verification route from CSRF validation:

- **Laravel 11** (`bootstrap/app.php`):

    ```
    $middleware->validateCsrfTokens(except: [
        '*payment/verify*',
    ]);
    ```
- **Laravel 10** (`app/Http/Middleware/VerifyCsrfToken.php`):

    ```
    protected $except = [
        '*payment/verify*',
    ];
    ```

Adjust the wildcard to match your actual route path and any language prefix (e.g. `*payments/verify*`).

### Gateway-specific `source` values

[](#gateway-specific-source-values)

Gateway`source` values`kashier`Comma-separated allowed methods: `card,wallet`, `card,bank_installments,wallet,fawry`, etc. Defaults to `card,wallet`.`hyperpay``CREDIT`, `MADA`, or `APPLE`. Required to select the matching HyperPay entity ID and payment brand.Most other gateways do not use `source`; passing `null` is valid.

Test Cards
----------

[](#test-cards)

### Fawaterk (Staging)

[](#fawaterk-staging)

BrandCard NumberExpiryCVVResultMastercard`5123450000000008`12/26100SuccessVisa`4005 5500 0000 0001`12/26100SuccessMastercard`5543474002249996`05/26123DeclineVisa`4222 0000 0672 4235`12/26123Decline### Other Gateways

[](#other-gateways)

- [PayMob](https://docs.paymob.com/docs/card-payments) — Test phone: `01010101010`, PIN &amp; OTP: `123456`
- [Kashier](https://developers.kashier.io/payment/testing)
- [Fawry](https://developer.fawrystaging.com/docs/testing/testing)
- [Thawani](https://docs.thawani.om/docs/thawani-ecommerce-api/ZG9jOjEyMTU2Mjc3-thawani-test-card)
- [Tap](https://www.tap.company/eg/en/developers)
- [Opay](https://doc.opaycheckout.com/end-to-end-testing)
- [PayTabs](https://support.paytabs.com/en/support/solutions/articles/60000712315-what-are-the-test-cards-available-to-perform-payments-)

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) file for details.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance92

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

21

Last Release

37d ago

Major Versions

v1.4.9 → v2.0.02026-07-21

v2.3.4 → v3.0.02026-07-24

v3.0.1 → v4.0.02026-07-24

PHP version history (2 changes)v1.0.0PHP &gt;=7.0

v2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/92b1b0bd4d9d72f897d79d2cd3884bd1077ade465ecd60f969bc8e83ba078eea?d=identicon)[dpsoft-labs](/maintainers/dpsoft-labs)

---

Top Contributors

[![dp-soft-co](https://avatars.githubusercontent.com/u/101559612?v=4)](https://github.com/dp-soft-co "dp-soft-co (46 commits)")

---

Tags

paypalfawrypaymobonline paymentskashierhyperpaylaravel-payments

### Embed Badge

![Health badge](/badges/dp-soft-co-payments/health.svg)

```
[![Health](https://phpackages.com/badges/dp-soft-co-payments/health.svg)](https://phpackages.com/packages/dp-soft-co-payments)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

28.0k177.2k9](/packages/bagisto-bagisto)[nafezly/payments

Payment helper for Paypal, Paymob, Kashier, Hyperpay and Fawry

49022.3k](/packages/nafezly-payments)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

138249.0k8](/packages/statamic-rad-pack-runway)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21336.4k4](/packages/ecotone-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
