Token pre authorization

James Lappin edited this page Aug 13, 2018 · 3 revisions

Create an intent for the pre-authorization Activity with the required extras (the details in the following snippet are dummy data – use the data for your account instead):

To do token pre-authorization you will need to store and retrieve two fields from the original receipt. These fields are the card token and the consumer token.

var cardToken = originalReceipt.CardDetails.CardToken;
var consumerToken = originalReceipt.Consumer.ConsumerToken;

Once you have retrieved these fields you can complete a token pre-authorization as follows

var tokenModel = new TokenPaymentModel
    //the value of the payment
    Amount = 1.01m,
    Currency = "GBP",

    // the card details
    CardToken = cardToken,
    CV2 = "452",

    // identify the recipient
    JudoId = YOUR_JUDO_ID,

    // provide an identifier for your customer
    ConsumerToken = consumerToken,

var response = await client.PreAuths.Create(tokenModel);
if (response.HasError)
    // Your error handling should go here.
    // You can see more detailed about the error by looking at response.Error

var receipt = response.Response as PaymentReceiptModel;
if (receipt != null)
    // Deal with a successful payment.
    Console.WriteLine("Payment successful. Transaction Reference {0}", receipt.ReceiptId);
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.