YocoClient

The YocoClient is the main entry point for the Yoco SDK. You will use it to authenticate, start transactions and to perform refunds.

Results from your transactions will be returned to you through your YocoClientDelegate implementation.

Methods

Method

Signature

init

-(id) initWithSecret:(NSString*)secret andApiToken:(NSString*);

init

-(id) initWithSecret:(NSString*)secret;

payCents

-(void) payCents(NSInteger):amountInCents withCurrency(NSString*):currency andStaff:(YocoStaff*)staff;

payCents

-(void) payCents(NSInteger):amountInCents withCurrency(NSString*):currency andSettings:(YocoPaymentSettings*)settings andStaff:(YocoStaff*)staff;

login

-(void) login:(UIViewController*)viewController success:(void (^)())success cancel:(void (^)())cancel

logout

-(void) logout;

setAPIToken

-(void) setAPIToken:(NSString*) apiToken;

setDelegate

-(void) setDelegate:(YocoClientDelegate*) delegate;

setSupportedInterfaceOrientations

-(void) setSupportedInterfaceOrientations:(UIInterfaceOrientationMask)supportedInterfaceOrientations;

refund

-(void) refund:(NSString*)pwIdentifier withStaff:(YocoStaff*)staff;

Example Code

//Configure the YocoClient with your API token and URL schema
[YocoClient initWithSecret:@"some-secret-token"];
//Setup your delegate and register it with the YocoClient
ExampleClientHandler* yocoClientHandler = [[ExampleClientHandler alloc] init];
[YocoClient setDelegate:yocoClientHandler];
//Create staff details for audit purposes
YocoStaff* staff = [[YocoStaff alloc] initWithStaffNumber:@"some-internal-staff-number"
andName:@"Joe Bloggs"];
//Make a payment
[YocoClient payCents:2500 withCurrency:@"ZAR" andStaff:staff];