Skip to content

Instantly share code, notes, and snippets.

@matiasgualino
Last active August 29, 2015 14:20
Show Gist options
  • Save matiasgualino/115ca81ce4a125126a16 to your computer and use it in GitHub Desktop.
Save matiasgualino/115ca81ce4a125126a16 to your computer and use it in GitHub Desktop.
MercadoPago SDK iOS for Objective-C
#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;
cardholder.name = @"APRO";
CardToken *cardToken = [[CardToken alloc] initWithCardNumber:@"4170068810108020" expirationMonth:10 expirationYear:15 securityCode:@"123" cardholderName:@"APRO" docType:@"DNI" docNumber:@"12345678"];
[mp createNewCardToken:cardToken success: ^(Token *t) {
NSLog(@"TOKEN %@", t._id);
} failure: ^(NSError *e) {
NSLog(@"ERROR");
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment