Skip to content

DagonGH/sdk-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

517 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mercado Pago SDK for Java

Maven Central APM

This library provides developers with a simple set of bindings to help you integrate Mercado Pago API to a website and start receiving payments.

💡 Requirements

Java 1.7 or higher

📲 Installation

First time using Mercado Pago? Create your Mercado Pago account, if you don’t have one already.

  1. Append MercadoPago dependencies to pom.xml
  ...
  <dependencies>
      <dependency>
          <groupId> com.mercadopago </groupId>
          <artifactId> sdk-java </artifactId>
          <version> 1.11.0 </version>
      </dependency>
  </dependencies>
  ...
  1. Run mvn install and thats all, you have Mercado Pago SDK installed.

  2. Copy the access_token in the credentials section of the page and replace YOUR_ACCESS_TOKEN with it.

That's it! Mercado Pago SDK has been successfully installed.

🌟 Getting Started

Simple usage looks like:

  import com.mercadopago.*;
  import com.mercadopago.exceptions.MPConfException;
  import com.mercadopago.exceptions.MPException;
  import com.mercadopago.resources.Payment;
  import com.mercadopago.resources.datastructures.payment.Payer;

  public class Main {

      public static void main(String[] args)throws MPException, MPConfException {
          MercadoPago.SDK.setAccessToken("YOUR_ACCESS_TOKEN");

          Payment payment = new Payment()
                  .setTransactionAmount(100f)
                  .setToken("your_cardtoken")
                  .setDescription("description")
                  .setInstallments(1)
                  .setPaymentMethodId("visa")
                  .setPayer(new Payer()
                          .setEmail("dummy_email"));

          payment.save();
      }
  }

📚 Documentation

Visit our Dev Site for further information regarding:

Check our official code reference to explore all available functionalities.

❤️ Support

If you require technical support, please contact our support team at developers.mercadopago.com

🏻 License

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

About

Mercado Pago's Official Java SDK

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 99.9%
  • Shell 0.1%