Download the PHP package yosefib/sadad-pgw without Composer
On this page you can find all versions of the php package yosefib/sadad-pgw. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yosefib/sadad-pgw
More information about yosefib/sadad-pgw
Files in yosefib/sadad-pgw
Package sadad-pgw
Short Description Laravel package for SADAD payment gateway integration
License
Informations about the package sadad-pgw
yosefIb/sadad-pgw
Laravel package for integrating with SADAD PGW (Payment Gateway)
This package simplifies the process of validating users, creating invoices, handling OTPs, and confirming payments using SADAD.
🚀 Features
- ✅ Validate customer identity and create invoice
- 🔐 Confirm payment using OTP
- 🔁 Resend OTP
- 📊 Check transaction status
- 🎯 Unified and formatted API responses
📦 Installation (Local Usage in Laravel)
-
Install the package in your Laravel project:
-
Edit your Laravel project’s
composer.json
and add: -
Run:
-
Add environment variables in your
.env
: - Add this config file in
config/sadad.php
:
🧪 Usage Example
✅ Response Format
Success
Failure
🏦 Complete Payment Flow (Full Transaction Steps)
To complete a transaction using SADAD PGW:
-
Validate the Customer and Create Invoice
- Call the
validateCustomer
method. - This sends an OTP to the customer's phone.
- Also creates a pending transaction in SADAD.
- Call the
-
Pay the Invoice with OTP
- After the customer receives the OTP via SMS, use it to confirm payment.
- You need the
transactionId
returned fromvalidateCustomer
.
-
Resend OTP (if needed)
- If the customer did not receive the OTP, you can request to resend it.
- Check Transaction Status (Optional)
- To check if the transaction was successfully paid:
📋 Example Flow
- Step 1:
validateCustomer
➔ OTP sent to user. - Step 2: User receives OTP ➔ enters it.
- Step 3:
payInvoice
using OTP ➔ transaction completed.
✅ Done!
📄 License
MIT © 2025 Yosef Ibrahem Ali
🧾 Response Example for Completed Payment
After calling payInvoice
, a successful response may look like:
On failure (e.g. invalid OTP):
🗂️ Service Categories
When creating an invoice via validateCustomer
, you must pass a category ID.
Use one of the following:
Category Name (Arabic) | ID |
---|---|
بدون تصنيف | 0 |
مواد صحية | 5 |
صيدليات | 6 |
مواد غذائية | 7 |
مقاهي ومطاعم | 8 |
ملابس وأحذية | 9 |
قرطاسية | 10 |
إلكترونيات | 11 |
صيانة وقطع غيار | 12 |
خدمات سياحية | 13 |
مواد بناء | 14 |
خدمات تعليمية | 15 |
خدمات دعائية | 16 |
مواد منزلية | 17 |
أثاث ومفروشات | 18 |
إطارات وونشات | 19 |
البيع الإلكتروني | 20 |
العطور ومواد منزلية | 21 |
المخابز والحلويات | 22 |
البصريات والعدسات | 23 |
ساعات ومجوهرات وإكسسوارات | 24 |
مستلزمات الأم والطفل | 25 |
ورش صيانة | 26 |
مواد تنظيف | 27 |
الألعاب | 28 |
لحوم ودواجن | 29 |
عيادات ومصحات | 30 |
معامل تحاليل | 32 |
الملابس التقليدية | 36 |
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.