Skip to content

Instantly share code, notes, and snippets.

@matiasgualino
Created April 22, 2016 13:53
Show Gist options
  • Save matiasgualino/b60ae9a6fac0a49fc7eaca2c60426498 to your computer and use it in GitHub Desktop.
Save matiasgualino/b60ae9a6fac0a49fc7eaca2c60426498 to your computer and use it in GitHub Desktop.
public class BankDealsActivity extends AppCompatActivity {
//Params
protected String mMerchantPublicKey;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bank_deals);
mMerchantPublicKey = this.getIntent().getStringExtra("merchantPublicKey");
MercadoPago mercadoPago = new MercadoPago.Builder()
.setContext(this)
.setPublicKey(mMerchantPublicKey)
.build();
getBankDealsAsync(mercadoPago);
}
protected void getBankDealsAsync(MercadoPago mercadoPago) {
mercadoPago.getBankDeals(new Callback<List<BankDeal>>() {
@Override
public void success(List<BankDeal> bankDeals, Response response) {
// Listo, aquí ya tienes las promociones
// para contarle a tu usuario
}
@Override
public void failure(RetrofitError error) {
// Ups, ha ocurrido un error.
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment