Performing a Pre Authorization

James Goodwin edited this page Mar 24, 2017 · 4 revisions

Check that you have initialized the SDK before attempting to make a pre-authorization.

1. Configuring the Judo instance

var judo = new Judo()
{
    JudoId = "<JUDO_ID>",
    ApiToken = "<API_TOKEN>",
    ApiSecret = "<API_SECRET>",
    Environment = JudoEnvironment.Sandbox,
    Amount = 1.50m,
    Currency = "GBP",
    ConsumerReference = "YourUniqueReference"
};

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

2. Create a PaymentPage to show the card entry screen

var preAuthPage = new PreAuthPage(judo);
Navigation.PushAsync(preAuthPage);

3. Receive the payment result

preAuthPage.resultHandler += async (sender, result) =>
{
    if ("Success".Equals(result.Response.Result))
    {
        // handle successful payment

        // close pre authorization page
        await Navigation.PopAsync();
    }
};
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.