Pix is a very famous brazialian payment gateway. that allows customers to make instant bank transfers using QR codes.
This documentation is explain you about integration of pix payment gateway in goldsvet or all goldsvet based scripts.
To integrate PIX payment gateway with Laravel, you can follow these steps:
- Install the Laravel Cashier package using composer:
composer require laravel/cashier - Configure the PIX payment gateway credentials in the .env file:
PIX_SECRET_KEY=your_secret_key
PIX_PUBLIC_KEY=your_public_key
PIX_CALLBACK_URL=https://your-domain.com/pix/callback - Create a new controller to handle the PIX payment requests:
php artisan make:controller
PixPaymentController - Add the necessary routes to your web.php file:
Route::get(‘/pix/payment’, [PixPaymentController::class, ‘create’])->name(‘pix.payment.create’); Route::post(‘/pix/payment’, [PixPaymentController::class, ‘store’])->name(‘pix.payment.store’); Route::get(‘/pix/callback’, [PixPaymentController::class, ‘callback’])->name(‘pix.callback’); - In the PixPaymentController, create a new payment and generate a QR code:
use Laravel\Cashier\Cashier; public function create() { $user = auth()->user(); $amount = 100.00; // example amount $description = ‘Example payment’; // example description $payment = $user->payments()->create([ ‘amount’ => $amount, ‘description’ => $description, ‘currency’ => ‘BRL’, ‘payment_method’ => ‘pix’, ‘status’ => ‘pending’, ]); $qrCode = Cashier::generatePixQrCode([ ‘amount’ => $amount, ‘description’ => $description, ‘transaction_id’ => $payment->id, ]); return view(‘pix.payment.create’, compact(‘qrCode’)); } - In the store method, update the payment status after receiving the payment confirmation:
public function store(Request $request) { $transactionId = $request->input(‘transaction_id’); $payment = Payment::findOrFail($transactionId); $payment->status = ‘paid’; $payment->save(); return response()->json([‘message’ => ‘Payment confirmed’]); } - In the callback method, update the payment status after receiving the payment confirmation from PIX:
public function callback(Request $request) { $transactionId = $request->input(‘transaction_id’); $payment = Payment::findOrFail($transactionId); $payment->status = ‘paid’; $payment->save(); return response()->json([‘message’ => ‘Payment confirmed’]); } - Finally, create the views to display the QR code and handle the payment confirmation.
This is a basic example of how to integrate PIX payment gateway with Laravel. You can customize it according to your needs and add more features such as payment history, refunds, and cancellations.
To create a new page in Laravel admin named payouts, follow these steps:
- Open your Laravel project in your code editor.
- Navigate to the “app” folder and create a new folder named “Http”.
- Inside the “Http” folder, create a new folder named “Controllers”.
- Inside the “Controllers” folder, create a new file named “PayoutController.php”.
- Open the “PayoutController.php” file and add the following code:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; class PayoutController extends Controller { public function index() { return view(‘admin.payouts.index’); } } - Save the file and close it.
- Navigate to the “resources” folder and create a new folder named “views”.
- Inside the “views” folder, create a new folder named “admin”.
- Inside the “admin” folder, create a new folder named “payouts”.
- Inside the “payouts” folder, create a new file named “index.blade.php”.
- Open the “index.blade.php” file and add the following code:
@extends(‘admin.layouts.app’) @section(‘content’) Payouts
@endsection - Save the file and close it.
- Open the “routes/web.php” file and add the following code:
Route::get(‘/admin/payouts’, ‘PayoutController@index’)->name(‘admin.payouts.index’); - Save the file and close it.
- Open your web browser and navigate to your Laravel project.
- Append “/admin/payouts” to the URL and press enter.
- You should now see the “Payouts” page in your Laravel admin.

To create a new page in Laravel admin named deposits, follow these steps:
- Open your Laravel project in your code editor.
- Navigate to the “app” folder and create a new folder named “Http”.
- Inside the “Http” folder, create a new folder named “Controllers”.
- Inside the “Controllers” folder, create a new file named “DepositController.php”.
- Open the “DepositController.php” file and add the following code:
php <?php namespace App\Http\Controllers; use Illuminate\Http\Request; class DepositController extends Controller { public function index() { return view(‘admin.deposits.index’); } } - Save the file and close it.
- Navigate to the “resources” folder and create a new folder named “views”.
- Inside the “views” folder, create a new folder named “admin”.
- Inside the “admin” folder, create a new folder named “deposits”.
- Inside the “deposits” folder, create a new file named “index.blade.php”.
- Open the “index.blade.php” file and add the following code:
html @extends(‘admin.layouts.app’) @section(‘content’) Deposits
@endsection - Save the file and close it.
- Open the “routes/web.php” file and add the following code:
php Route::get(‘/admin/deposits’, ‘DepositController@index’)->name(‘admin.deposits.index’); - Save the file and close it.
- Open your web browser and navigate to your Laravel project.
- Append “/admin/deposits” to the URL and press enter.
- You should now see the “Deposits” page in your Laravel admin.








