Skip to content

Instantly share code, notes, and snippets.

@matiasgualino
Created April 26, 2016 00:42
Show Gist options
  • Save matiasgualino/18e8d71a45a6d5f157843bbeacb10b8c to your computer and use it in GitHub Desktop.
Save matiasgualino/18e8d71a45a6d5f157843bbeacb10b8c to your computer and use it in GitHub Desktop.
public class IssuersActivity extends Activity {
private String mMerchantPublicKey;
private String mPaymentMethodId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_issuers);
mMerchantPublicKey = this.getIntent().getStringExtra("merchantPublicKey");
mPaymentMethodId = this.getIntent().getStringExtra("paymentMethodId");
MercadoPago mercadoPago = new MercadoPago.Builder()
.setContext(this)
.setPublicKey(mMerchantPublicKey)
.build();
getIssuersAsync(mercadoPago);
}
private void getIssuersAsync(MercadoPago mercadoPago) {
mercadoPago.getIssuers(mPaymentMethodId, new Callback <List<Issuers>>() {
@Override
public void success(List<Issuers> issuers, Response response) {
// Ya tenés la lista de bancos!
// Ahora armá tu UI para cada uno de ellos!
}
@Override
public void failure(RetrofitError error) {
// UPS! Algo salió mal.
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment