0

Anyone who is familliar with the Mollie API? I am trying to set up a payment for a webshop, but I don't have much knowledge of the Mollie API. So I got 2 questions:

  1. The Order API of Mollie is like the Payment API, but the order API is a bit more "advanced" and more made for a webshop with products? Is that correct?

  2. I got the following code, I assume (according to the Mollie documentation of how a payment works) that I can set up a payment (order) with an amount and other additional information, the user will than be redirected to the Mollie platform where he can choose a payment method.

     List<OrderLineRequest> OrderLineList = new List<OrderLineRequest>();
     foreach(product in cart) {
         OrderLineRequest Orderline = new OrderLineRequest();
         Orderline.Name = B.GetProductName(ProductID);
         Orderline.Quantity = Amount;
         Orderline.UnitPrice = new Amount(Currency.EUR, ProductPrice.ToString());
         Orderline.TotalAmount = new Amount(Currency.EUR, (Amount * ProductPrice).ToString());
         Orderline.VatRate = "21.00";
         Orderline.VatAmount = new Amount(Currency.EUR, ((Amount * ProductPrice)*0,21).ToString());
    
        OrderLineList.Add(Orderline);
     }
    
    
     IOrderClient orderClient = new OrderClient("my API key");
     OrderRequest orderRequest = new OrderRequest()
     {
         Amount = new Amount(Currency.EUR, "Amount needs to be paid"),
         OrderNumber = OrderID.ToString(),
         Lines = OrderLineList,
         BillingAddress = new OrderAddressDetails()
         {
             GivenName = FirstName,
             FamilyName = LastName,
             Email = Email,
             City = City,
             Country = Country,
             PostalCode = PostalCode,
             StreetAndNumber = Street + " " + HouseNumber
         },
         RedirectUrl = "URL I want to redirect to when payment is done",
         Locale = Locale.en_US
     };
    

What else do I have to do for the user to be redirected to the Mollie platform to pay?

Thanks alot for taking time to read this, I hope you can help me out!

Thanks in advance!

0 Answers0