Register Card

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

Check that you have followed the initial setup guide before attempting to register a card.

    JPAmount *amount = [[JPAmount alloc] initWithAmount:@"25.0" currency:@"GBP"];
    [self.judoKitSession invokeRegisterCard:judoID amount:amount consumerReference:@"consRef" cardDetails:nil completion:^(JPResponse * response, NSError * error) {
        [self dismissViewControllerAnimated:YES completion:nil];
        if (error && response.items.count == 0) {
            if (error.domain == JudoErrorDomain && error.code == JudoErrorUserDidCancel) {
                [self dismissViewControllerAnimated:YES completion:nil];
            } else {
            	// handle error
        JPTransactionData *tData = response.items[0];
        if (tData.cardDetails) {
        	// save card details and payment token for further use
            self.cardDetails = tData.cardDetails;
            self.payToken = tData.paymentToken;

Note: Please make sure that you are using a unique Consumer Reference for each different consumer.

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.