PHPackages                             remzikocak/laravel-vallet - 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. remzikocak/laravel-vallet

ActiveLibrary[Payment Processing](/categories/payments)

remzikocak/laravel-vallet
=========================

Unofficial Vallet Payment Gateway Integration for Laravel.

3.0.0(1mo ago)011MITPHPPHP ^8.2CI failing

Since Oct 27Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/remzikocak/laravel-vallet)[ Packagist](https://packagist.org/packages/remzikocak/laravel-vallet)[ RSS](/packages/remzikocak-laravel-vallet/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (16)Versions (6)Used By (0)

[![Laravel Options](/laravel-vallet.png)](/laravel-vallet.png)

Vallet Integration for Laravel 10/11/12/13
==========================================

[](#vallet-integration-for-laravel-10111213)

This Package helps you to integrate [Vallet Payment Gateway](https://vallet.com.tr) in your Laravel Application.

***This is an unofficial, third party package.***

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require remzikocak/laravel-vallet
```

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

[](#configuration)

Publish the config file with:

```
php artisan vendor:publish --provider="RKocak\Vallet\ValletServiceProvider" --tag="config"
```

Add the following variables to your .env file and fill them with your credentials:

```
VALLET_USERNAME=
VALLET_PASSWORD=
VALLET_SHOPCODE=
VALLET_HASH=
VALLET_CALLBACK_OK_URL=
VALLET_CALLBACK_FAIL_URL=
```

`VALLET_CALLBACK_OK_URL` and `VALLET_CALLBACK_FAIL_URL` are the urls that Vallet will redirect the user after payment is completed or failed. Make sure that you have created a route for these URLs in your routes file.

Usage
-----

[](#usage)

### How to Create a Payment

[](#how-to-create-a-payment)

```
use RKocak\Vallet\Facades\Vallet;
use RKocak\Vallet\Buyer;
use RKocak\Vallet\Enums\{Currency, Locale, ProductType};
use RKocak\Vallet\Exceptions\{RequestFailedException, InvalidArgumentException, BuyerNotSetException, LocaleNotSetException, CurrencyNotSetException};

class YourController {

    public function yourMethod()
    {
        // Create a new buyer object
        $buyer = new Buyer();
        $buyer->setName('Remzi')
              ->setSurname('Kocak')
              ->setEmail('hey@remzikocak.com')
              ->setCity('Istanbul')
              ->setCountry('Turkey')
              ->setDistrict('Atasehir')
              ->setPhoneNumber('5555555555')
              ->setAddress('Atasehir, Istanbul')
              ->setIp('127.0.0.1');

        // Create a new payment object
        $payment = Vallet::createPayment();

        // Set Payment Details
        $payment->setBuyer($buyer)
                ->setLocale(Locale::Turkish)
                ->setCurrency(Currency::Try)
                ->setConversationId('123456789')
                ->setOrderId('123456789')
                ->setProductName('Test Product')
                ->setTotalPrice(100)
                ->setOrderPrice(100)
                ->setProductType(ProductType::Digital);

        // Add Products
        $payment->addProduct(
            Product::make()
                ->setName('Test Product')
                ->setPrice(13.50)
                ->setType(ProductType::Digital)
        );

        try {
            // Send Payment Request
            $paymentLink = $payment->getLink();

            // You can redirect user to '$paymentLink' or you can use it as a href in your button
            // Depending on your needs
        } catch (RequestFailedException|InvalidArgumentException|BuyerNotSetException|LocaleNotSetException|CurrencyNotSetException $e) {
            // Handle Exception
        }
    }

}
```

### Retrieve Payment Details

[](#retrieve-payment-details)

```
use RKocak\Vallet\Facades\Vallet;
use RKocak\Vallet\Exceptions\{InvalidHashException, InvalidResponseException};

class YourController
{

    public function yourMethod(){
        try {
            // Retrieve Payment Details
            $response = Vallet::getResponse();
            $response->validate();

            if($response->isPaid()) {
                // Payment is paid
                $amount = $response->getAmount();
                $orderId = $response->getOrderId();
                $valletOrderId = $response->getValletOrderId();

                // Update your order status, send email etc.
            } else {
                // Payment is not paid, is pending or is awaiting verification
            }
        } catch (InvalidHashException|InvalidResponseException $e) {
            // Handle Exception
        }
    }

}
```

**Important:** You should store the `$response->getValletOrderId()` in your database. You will need it for refunding the payment.

### Refund Payment

[](#refund-payment)

```
use RKocak\Vallet\Facades\Vallet;

class YourController {

    public function yourMethod()
    {
        $refund = Vallet::createRefund();

        try {
            // Set Refund Details
            $refund->setOrderId('123456789')
                   ->setValletOrderId('123456789')
                   ->setAmount(100);

            // Send Refund Request
            $response = $refund->process();

            if($response->success()) {
                $refundId = $response->getRefundId();
            } else {
                // Refund is not successful
            }
        } catch (InvalidArgumentException $e) {
            // Handle Exception
        }
    }

}
```

**Important:** You should store the `$response->getRefundId()` in your database. You will need it to get Support from Vallet Customer Service.

Publishing Translation Files
----------------------------

[](#publishing-translation-files)

Vallet Integration for Laravel comes with English, Turkish and German translations. If you want to customize them, you can publish them with:

```
php artisan vendor:publish --provider="RKocak\Vallet\ValletServiceProvider" --tag="lang"
```

Testing
-------

[](#testing)

```
composer test
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance90

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~220 days

Total

5

Last Release

47d ago

Major Versions

1.1.0 → 2.0.02024-03-10

2.1.0 → 3.0.02026-03-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/555b13c256b499e181ff869ac54ebfd054557f4806159bfb5712cdbb97cacb7e?d=identicon)[rkocak](/maintainers/rkocak)

---

Top Contributors

[![remzikocak](https://avatars.githubusercontent.com/u/1866678?v=4)](https://github.com/remzikocak "remzikocak (63 commits)")

---

Tags

laravellaravel-valletvalletpaymentvalletlaravel-vallet

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/remzikocak-laravel-vallet/health.svg)

```
[![Health](https://phpackages.com/badges/remzikocak-laravel-vallet/health.svg)](https://phpackages.com/packages/remzikocak-laravel-vallet)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)

PHPackages © 2026

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