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() { | |
| // Armá un mapa con los datos de la compra y el mail de tu cliente. | |
| Map preferenceMap = new HashMap<>(); | |
| preferenceMap.put("item_id", "1"); | |
| preferenceMap.put("amount", new BigDecimal(10)); | |
| preferenceMap.put("payer_email", "mail_de_tu_cliente@gmail.com"); | |
| // Envia la información a tu servidor | |
| MerchantServer.createPreference(this, "http://merchantserver.com/", |
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
| import android.content.Intent; | |
| import android.widget.Toast; | |
| import android.widget.TextView; | |
| import com.mercadopago.core.MercadoPago; | |
| import com.mercadopago.model.ApiException; | |
| import com.mercadopago.model.Payment; | |
| // Espera los resultados del checkout | |
| @Override |
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 startCardFlowActivity(View view) { | |
| // Llamar al activity propuesta por MP | |
| new MercadoPago.StartActivityBuilder() | |
| .setActivity(this) | |
| .setPublicKey(TU_PUBLIC_KEY) | |
| .setAmount(MONTO) | |
| .startCardFlowActivity(); | |
| } |
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 startCardFormActivity(View view) { | |
| // Llamar al activity propuesta por MP | |
| new MercadoPago.StartActivityBuilder() | |
| .setActivity(this) | |
| .setPublicKey(TU_PUBLIC_KEY) | |
| .setAmount(MONTO) | |
| .startCardFormActivity(); | |
| } |
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(); | |
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 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 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 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 submit(View view) { | |
| new MercadoPago.StartActivityBuilder() | |
| .setActivity(this) | |
| .setPublicKey(TU_PUBLIC_KEY) | |
| .startBankDealsActivity(); | |
| } |
NewerOlder