PHPackages                             miki-babi/yagoutpay - 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. miki-babi/yagoutpay

ActiveLibrary[Payment Processing](/categories/payments)

miki-babi/yagoutpay
===================

Laravel package for YagoutPay Payment Gateway

v1.0.1(9mo ago)010MITPHPPHP &gt;=8.0

Since Aug 15Pushed 9mo agoCompare

[ Source](https://github.com/miki-babi/YagoutPay)[ Packagist](https://packagist.org/packages/miki-babi/yagoutpay)[ RSS](/packages/miki-babi-yagoutpay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

YagoutPay Laravel Package
=========================

[](#yagoutpay-laravel-package)

[![Latest Version](https://camo.githubusercontent.com/6ba3c24f570220c4cbeca221bf4d0dd4432a43880554baa8601cdf03dc27553a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696b692d626162692f7961676f75747061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/miki-babi/yagoutpay)[![License](https://camo.githubusercontent.com/5ac24dd2ccfb6b55e9eb7f520520f7bcec56f1645d675ca6aa7f40b590c3bd9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d696b692d626162692f7961676f75747061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/miki-babi/yagoutpay)

A comprehensive Laravel package for seamless integration with the **YagoutPay Payment Gateway**. This package provides a clean, secure, and easy-to-use interface for processing payments through YagoutPay's API.

✨ Features
----------

[](#-features)

- 🔒 **Secure AES-256-CBC Encryption** - Built-in encryption for payment data
- 🎯 **Laravel Integration** - Native Laravel service provider and facade
- 🛡️ **Environment-based Configuration** - Secure credential management
- 📝 **Comprehensive Logging** - Built-in logging for debugging and monitoring
- 🔄 **Callback Handling** - Ready-to-use success/failure callback routes
- 🧪 **Testing Support** - Sandbox environment support

📋 Requirements
--------------

[](#-requirements)

- **PHP** &gt;= 8.0
- **Laravel** &gt;= 10.0
- **OpenSSL** extension enabled

📦 Installation
--------------

[](#-installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require miki-babi/yagoutpay
```

### 2. Publish Configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --tag=yagoutpay-config
```

### 3. Environment Configuration

[](#3-environment-configuration)

Add the following variables to your `.env` file:

```
# YagoutPay Configuration
YAGOUT_MERCHANT_ID=your_merchant_id
YAGOUT_MERCHANT_KEY=your_merchant_key
YAGOUT_PAYMENT_URL=https://sandbox.yagoutpay.com/initiate

# Optional: Custom callback URLs
YAGOUT_SUCCESS_URL=https://yoursite.com/payment/success
YAGOUT_FAILURE_URL=https://yoursite.com/payment/failure
```

🚀 Usage
-------

[](#-usage)

### Basic Payment Initiation

[](#basic-payment-initiation)

```
use MikiBabi\YagoutPay\Facades\Yagout;

Route::get('/checkout', function () {
// Initialize payment
$paymentForm = Yagout::initiate(
    order_no: 'ORDER_' . time(),
    amount: 150.00,
    cust_details: [
        'name'  => 'John Doe',
        'email' => 'john@example.com',
        'phone' => '0912345678'
    ],
    currency: 'ETB', // Optional, defaults to 'ETB'
    txn_type: 'SALE', // Optional, defaults to 'SALE'
    // success_url: route('payment.success'), // Optional
    // failure_url: route('payment.failure')  // Optional
);

// The method returns a Blade view that auto-submits to YagoutPay
return $paymentForm;
});
```

### Controller Example

[](#controller-example)

```
