Pre Authorization

James Lappin edited this page Aug 13, 2018 · 4 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):

var cardPaymentModel = new CardPaymentModel
{
    //the value of the payment
    Amount = 1.01m,
    Currency = "GBP",

    // the card details
    CardNumber = "4976000000003436",
    ExpiryDate = "1220",
    CV2 = "452",

    // identify the recipient
    JudoId = YOUR_JUDO_ID,

    // provide an identifier for your customer
    YourConsumerReference = "MyCustomer004",
};

var response = await client.PreAuths.Create(cardPaymentModel);
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.