/mollie-api-csharp

Mollie API client for C#

Primary LanguageC#BSD 2-Clause "Simplified" LicenseBSD-2-Clause

mollie-api-csharp

Mollie API client for C#

How to use the API client

Initializing the Mollie API client, and setting your API key.

var mollieClient = new MollieClient("your_api_key_here");

Loading iDeal issuers

var issuers = await mollieClient.GetIssuers();
foreach (var issuer in issuers.data)
{
   Console.WriteLine(issuer.name);
}

Creating a new payment.

var payment = new Payment 
{ 
   amount = 99.99M, 
   description = "Test payment", 
   redirectUrl = "http://www.myshop.net/payments/completed/?orderId=1245",
   webhookUrl = "http://www.myshop.net/webhooks/mollie/",
};
var paymentStatus = await mollieClient.StartPayment(payment);
var molliePaymentId = paymentStatus.id;
Response.Redirect(paymentStatus.links.paymentUrl);

Getting payment status

var paymentStatus = await mollieClient.GetStatus(molliePaymentId);
if (paymentStatus.status == Status.paid)
{
   Console.WriteLine("Your order is paid");
}