Pix payment processing with Checkout API
Português / Español
:warning: Attention: Pix is a payment method only available in Brazil
:computer: Technologies
- PHP 7.3.29
- Slim Framework v4
- Composer (dependency manager)
💡 Requirements
- PHP 7.2.5 or higher (you can download PHP here).
- Composer (dependency manager).
- Read our instructions on how to create an application at the Mercado Pago Developer Panel in order to acquire your access token. It will grant you access to Mercado Pago's public APIs.
- For detailed information about receiving payments with Pix, please read our guide at Mercado Pago Developers.
:gear: Installation
-
Clone the project.
git clone https://github.com/mercadopago/pix-payment-sample-php.git
-
Go to the server
folder.
cd pix-payment-sample-php/server
-
Install the required dependencies using Composer.
composer install
🌟 How to run it
-
Go to the server
folder.
cd pix-payment-sample-php/server
-
Run the following command to start the application:
MERCADO_PAGO_SAMPLE_ACCESS_TOKEN=YOUR_ACCESS_TOKEN php -S localhost:8080 server.php
-
Remember to replace the value of YOUR_ACCESS_TOKEN
with the corresponding credential from your account.
-
Navigate to http://localhost:8080 in your browser.
:test_tube: Testing
- On our testing instructions you'll find a guide on how to create test users.
- You have to create a Pix key in the seller's account in Mercado Pago (remember you can create and use a test user as a seller).
- IMPORTANT: there are some limitations when testing this payment method with test users. When creating a payment, it will be pending and the corresponding Pix code and QR code will be returned, but it will not be possible to use these codes to end the flow and approve the test payment.
:handshake: Contributing
You can contribute to this project by reporting problems and bugs. Before opening an issue, make sure to read our code of conduct.
:bookmark: License
MIT License. Copyright (c) 2021 - Mercado Pago
For more information, see the LICENSE file.