Payment

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

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

  1. Create a JPAmount for the amount to be charged:

    JPAmount *amount = [[JPAmount alloc] initWithAmount:@"25.0" currency:@"GBP"];
  2. Call to show the payment screen to the user:

    [self.judoKitSession invokePayment:judoID amount:amount consumerReference:@"consRef" cardDetails:nil 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
        }
    }];

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

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.