Mollie API client for C#
Initializing the Mollie API client, and setting your API key.
MollieClient mollieClient = new MollieClient("your_api_key_here");
Loading iDeal issuers
Issuers issuers = mollieClient.GetIssuers();
foreach (Issuer issuer in issuers.data)
{
Console.WriteLine(issuer.name);
}
Creating a new payment.
Payment 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/",
};
PaymentStatus paymentStatus = mollieClient.StartPayment(payment);
string molliePaymentId = paymentStatus.id;
Response.Redirect(paymentStatus.links.paymentUrl);
Getting payment status
PaymentStatus paymentStatus = mollieClient.GetStatus(molliePaymentId);
if (paymentStatus.status == Status.paid)
{
Response.Write("Your order is paid");
}
Refunds
RefundStatus refundStatus = mollieClient.Refund(molliePaymentId);
PaymentMethods
PaymentMethods methods = mollieClient.GetPaymentMethods();
foreach (PaymentMethod method in methods.data)
{
Console.WriteLine(method.image.normal);
}