-
Notifications
You must be signed in to change notification settings - Fork 4
Usage Direct Debit
Craig Noble edited this page Aug 17, 2020
·
1 revision
Process exactly the same as per Usage - Card
For Direct Debits, the code and process is exactly the same, except you create the PaymentIntentRequest
like this:
var paymentIntentCreated = Cashier.CreateNewPaymentIntent(PaymentIntentRequest.CreateDirectDebit(
transactionReference: transactionReference,
description: "Donation Direct Debit",
amount: model.Amount,
customerEmail: model.Email,
confirmationPageUrl: CurrentPage.Url,
failurePageUrl: Umbraco.Content(1148).Url,
callbackUrl: "/umbraco/surface/DonationFormSurface/HandleCallback",
additionalData: jsonDonation,
customerUniqueReference: model.Email,
directDebitStartDate: FirstDayOfNextMonth(DateTime.UtcNow), //start date
customerAddress: new CustomerAddress
{
AddressLines = model.AddressLines,
City = model.Town,
Country = "United Kingdom",
Postcode = model.Postcode
}
));