Token preAuth

James Goodwin edited this page Mar 12, 2017 · 7 revisions

Check that you have followed the initial setup guide before attempting to make a token pre-authorization.

    if (self.cardDetails) {
        JPAmount *amount = [[JPAmount alloc] initWithAmount:@"25.0" currency:@"GBP"];

        [self.judoKitSession invokeTokenPreAuth:judoID amount:amount consumerReference:@"consRef" cardDetails:self.cardDetails paymentToken:self.payToken completion:^(JPResponse * response, NSError * error) {
        	if (error || response.items.count == 0) {
            	if (error.domain == JudoErrorDomain && error.code == JudoErrorUserDidCancel) {
                	[self dismissViewControllerAnimated:YES completion:nil];
            	} else {
	            	// handle error
            	}
        	} else {
    	    	// handle success
	        }
        }];
        
    } else {
    	// handle card details and payment token not present
    }

Note: Please make sure that the consumerReference and paymentToken match the values used when the card token was originally generated.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.