Created
April 22, 2016 13:53
-
-
Save matiasgualino/b60ae9a6fac0a49fc7eaca2c60426498 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 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