Created
April 26, 2016 00:42
-
-
Save matiasgualino/18e8d71a45a6d5f157843bbeacb10b8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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