Skip to content

mercadopago/card-payment-sample-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Card payment processing with Checkout API

Português / Español

💻 Technologies

  • PHP 8.2
  • Slim Framework v4
  • Composer (dependency manager)

💡 Requirements

  • PHP 8.2 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 public key and access token. They will grant you access to Mercado Pago's public APIs.

⚙️ Installation

  1. Clone the project.
git clone https://github.com/mercadopago/card-payment-sample-php.git
  1. Go to the server folder.
cd card-payment-sample-php/server
  1. Install the required dependencies using Composer.
composer install

🌟 How to run it

  1. Go to the server folder.
cd card-payment-sample-php/server
  1. Run the following command to start the application:
MERCADO_PAGO_SAMPLE_PUBLIC_KEY=YOUR_PUBLIC_KEY MERCADO_PAGO_SAMPLE_ACCESS_TOKEN=YOUR_ACCESS_TOKEN php -S localhost:8080 server.php
  1. Remember to replace the values of YOUR_PUBLIC_KEY and YOUR_ACCESS_TOKEN with the corresponding credentials from your account.

  2. Navigate to http://localhost:8080 in your browser.

🧪 Testing

On our testing instructions you'll find credit cards that can be used along with this sample and a guide on how to create test users.

🤝 Contributing

You can contribute to this project by reporting problems and bugs. Before opening an issue, make sure to read our code of conduct.

🔖 License

MIT License. Copyright (c) 2021 - Mercado Pago
For more information, see the LICENSE file.