This file contains hidden or 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 PaymentMethodsActivity extends Activity { | |
private String mMerchantPublicKey; | |
private String mPaymentTypeSupported; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_payment_methods); | |
This file contains hidden or 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 void startInstructionsActivity(Payment payment, PaymentMethod paymentMethod) { | |
new MercadoPago.StartActivityBuilder() | |
.setPublicKey(TU_PUBLIC_KEY) | |
.setActivity(this) | |
.setPayment(payment) | |
.setPaymentMethod(paymentMethod) | |
.startInstructionsActivity(); | |
} |
This file contains hidden or 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 void createPayment(final Activity activity, String token, | |
Integer installments, Long cardIssuerId, final PaymentMethod paymentMethod) { | |
if (paymentMethod != null) { | |
// Crear el item que se está cobrando | |
Item item = new Item(DUMMY_ITEM_ID, DUMMY_ITEM_QUANTITY, | |
DUMMY_ITEM_UNIT_PRICE); | |
// Obtener el ID del medio de pago |
This file contains hidden or 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 InstructionsActivity extends AppCompatActivity { | |
//Params | |
protected Payment mPayment; | |
protected String mMerchantPublicKey; | |
protected PaymentMethod mPaymentMethod; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
This file contains hidden or 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 void submit(View view) { | |
new MercadoPago.StartActivityBuilder() | |
.setActivity(this) | |
.setPublicKey(TU_PUBLIC_KEY) | |
.startBankDealsActivity(); | |
} |
This file contains hidden or 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); | |
This file contains hidden or 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 void startInstallmentsActivity(View view) { | |
// Llamar al activity propuesta por MP | |
new MercadoPago.StartActivityBuilder() | |
.setActivity(this) | |
.setPublicKey(TU_PUBLIC_KEY) | |
.setPaymentMethod(mCurrentPaymentMethod) | |
.setIssuer(mCurrentIssuer) | |
.setAmount(MONTO) | |
.startCardInstallmentsActivity(); |
This file contains hidden or 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 InstallmentsActivity extends Activity { | |
private String mMerchantPublicKey; | |
private String mPaymentMethodId; | |
private String mBin; | |
private BigDecimal mAmount; | |
private String mIssuerId; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
This file contains hidden or 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); | |
This file contains hidden or 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 void startIssuersActivity(View view) { | |
// Llamar al activity propuesta por MP | |
new MercadoPago.StartActivityBuilder() | |
.setActivity(this) | |
.setPublicKey(TU_PUBLIC_KEY) | |
.setPaymentMethod(mCurrentPaymentMethod) | |
.setAmount(MONTO) | |
.startCardIssuersActivity(); | |