Skip to content

Instantly share code, notes, and snippets.

@matiasgualino
Last active April 29, 2016 05:25
Show Gist options
  • Save matiasgualino/4a169219fc874a3bc90b0b0f666a8d17 to your computer and use it in GitHub Desktop.
Save matiasgualino/4a169219fc874a3bc90b0b0f666a8d17 to your computer and use it in GitHub Desktop.
public void submit() {
// Envia la información a tu servidor como desees
Map<String, Object> preferenceParams = new HashMap<String, Object>();
// Identifica qué estas cobrando
preferenceParams.put("item_id", "123456");
// Envia la info a tu servidor para crear la preferencia
MerchantServer.createPreference(activity, TU_URL_BASE,
TU_CREACION_PREFERENCIAS_URI, preferenceParams, new Callback() {
@Override
public void success(CheckoutPreference checkoutPreference,
Response response) {
// La preferencia se creó correctamente.
// Aquí puedes iniciar el Checkout de MercadoPago.
}
@Override
public void failure(RetrofitError error) {
// Ups, ocurrió un error
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment