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
import UIKit | |
import CoreData | |
import MercadoPagoSDK | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
var nav: UINavigationController? |
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
#import "MercadoPagoSDK/MercadoPagoSDK-Swift.h" | |
MercadoPago *mp = [[MercadoPago alloc] initWithPublicKey:@"444a9ef5-8a6b-429f-abdf-587639155d88"]; | |
Identification *identification = [[Identification alloc] init]; | |
identification.type = @"DNI"; | |
identification.number = @"12345678"; | |
Cardholder *cardholder = [[Cardholder alloc] init]; | |
cardholder.identification = identification; |
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
// RESOLVER ESTE TEMA | |
android { | |
lintOptions { | |
abortOnError false | |
} | |
} | |
// SOLO PARA TEST | |
repositories { | |
maven { |
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 void submit() { | |
// Envia la información a tu servidor como desees | |
Map<String, Object> preferenceParams = new HashMap<String, Object>(); | |
// Identifica qué estas cobrando | |
preferenceParams.put("item_id", "123456"); | |
// Envia la info a tu servidor para crear la preferencia | |
MerchantServer.createPreference(activity, TU_URL_BASE, |
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
import android.view.View; | |
import com.mercadopago.core.MercadoPago; | |
// Método ejecutado al hacer clic en el botón | |
public void submit(View view) { | |
// Obtener ID de la preferencia (Paso 3) | |
// Iniciar el checkout de MercadoPago |
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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> |
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
// Button onClick method | |
public void submit(View view) { | |
// Start MercadoPago PaymentVault activity | |
new MercadoPago.StartActivityBuilder() | |
.setActivity(activity) | |
.setPublicKey(PUBLIC_KEY) | |
.setAmount(BigDecimal.valueOf(MONTO)) | |
.setPurchaseTitle(NOMBRE_PRODUCTO) | |
.startPaymentVaultActivity(); |
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
// Button onClick method | |
public void submit(View view) { | |
// 1. Crea la lista de tipos a excluir | |
List<String> excludedPaymenTypesIds = new ArrayList<String>(){{ | |
add(PaymentType.BANK_TRANSFER); | |
}}; | |
// 2. Inicia la UI de MercadoPago seteando la lista de exclusiones | |
new MercadoPago.StartActivityBuilder() |
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
// Button onClick method | |
public void submit(View view) { | |
/* | |
1. Crea la lista de medios a excluir | |
Como pudiste ver en un paso anterior, transferencia bancaria | |
tenía 3 medios de pagos disponibles. Vamos a ver que pasa si | |
excluímos dos de ellos.. | |
*/ | |
List<String> excludedPaymentMethodIds = new ArrayList<String>(){{ |
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
// Button onClick method | |
public void startPaymentMethodsActivity(View view) { | |
// Decinos qué tipos de pagos soportas. | |
protected List<string> mSupportedPaymentTypes = new ArrayList<string>(){{ | |
add("credit_card"); | |
add("debit_card"); | |
add("prepaid_card"); | |
add("ticket"); | |
add("atm"); |
OlderNewer