Pix integration example using the OpenPix platform and Laravel framework. Check our documentation at OpenPix Developers.
This is a simple donation application that demonstrates the process of creating charges, updating donation statuses in real-time via webhooks when a charge is paid, integration with our PHP SDK, and more.
- Generate a App ID in your OpenPix Account.
- Have Docker or Composer and MySQL installed.
Our application has a Laravel Sail configuration available, providing an interface to interact seamlessly with Docker in Laravel applications.
Follow the steps below to use Docker via Sail:
- Have Docker Compose installed.
- Clone the repository:
git clone https://github.com/Open-Pix/laravel-backend-integration
- Go to repository directory:
cd laravel-backend-integration
- Install Composer dependencies with Sail:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php82-composer:latest \
composer install --ignore-platform-reqs
- Copy
.env.example
to.env
:cp .env.example .env
- Configure your AppID in
.env
file. - Start the services (server, database and so on.):
./vendor/bin/sail up -d
- Generate a key:
./vendor/bin/sail art key:generate
- Run the migrations:
./vendor/bin/sail art migrate
- Make sure changes to the
.env
file take effect by clearing the cache::php artisan config:clear
Having Composer and PHP >=8.2.0
installed directly on your machine, follow the steps:
- Clone the repository:
git clone https://github.com/Open-Pix/laravel-backend-integration
- Go to repository directory:
cd laravel-backend-integration
- Install Composer dependencies:
composer install
- Copy
.env.example
to.env
:cp .env.example .env
- Generate a key:
php artisan key:generate
- Run the migrations:
php artisan migrate
- Start the server:
php artisan serve
- Configure your AppID in
.env
file.
By default, web app runs at http://0.0.0.0