Giter VIP home page Giter VIP logo

dx-java's Introduction

Build Status codecov

MercadoPago SDK for Java

This library provides developers with a simple set of bindings to the Mercado Pago API.

Installation

Using Maven

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

Quick Start

  1. Import Mercado Pago basic clases. import com.mercadopago.*;
  2. Setup your credentials.
  • For Web-checkout:
      MercadoPago.SDK.setClientSecret("CLIENT_SECRET");
      MercadoPago.SDK.setClientId("CLIENT_ID");
  • For API or Custom-checkout:
      MercadoPago.SDK.setAccessToken("ACCESS_TOKEN");
  1. Using Resource objects.

sdk resource structure

Sample

  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.setClientSecret(System.getenv("CLIENT_SECRET"));
          MercadoPago.SDK.setClientId(System.getenv("CLIENT_ID_OK"));

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

          payment.save();



      }
  }

Support

  1. Create an issue https://github.com/mercadopago/dx-java/issues
  2. Follow your issue status in Issues Support Dashboard https://github.com/mercadopago/dx-java/projects/2

dx-java's People

Contributors

eduardopaoletta avatar hdlopez avatar joelibaceta avatar flaviofat avatar falehenrique avatar janee avatar matiasgualino avatar mminestrelli avatar hectorespert avatar blackleg avatar

Watchers

Hudson Orsine Assumpção avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.