Token Payment

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

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

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

        [self.judoKitSession invokeTokenPayment: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 Consumer Reference used and the card token matches the ones 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.