private OrderRequest CreateOrderRequest(AppZeroAPI.Entities.CustomerOrder order) { var request = new OrderRequest { ApplicationContext = m_ApplicationContext, CheckoutPaymentIntent = "CAPTURE" }; var purchaseUnitRequest = new PurchaseUnitRequest { InvoiceId = order.rec_id.ToString(), AmountWithBreakdown = new AmountWithBreakdown { Value = order.order_total.ToString("f2", CultureInfo.InvariantCulture), CurrencyCode = "EUR", AmountBreakdown = new AmountBreakdown { ItemTotal = new Money { Value = order.order_total.ToString("f2", CultureInfo.InvariantCulture), CurrencyCode = "EUR" } } } }; request.PurchaseUnits = new List <PurchaseUnitRequest>() { purchaseUnitRequest }; return(request); }
private static OrderRequest BuildRequestBody(PurchaseUnitRequest PUR) { OrderRequest orderRequest = new OrderRequest() { CheckoutPaymentIntent = "CAPTURE", ApplicationContext = new ApplicationContext { BrandName = "Movie Store", LandingPage = "BILLING", CancelUrl = "https://localhost:44308/Home/Error", ReturnUrl = "https://localhost:44308/Orders/Approved", UserAction = "CONTINUE", ShippingPreference = "SET_PROVIDED_ADDRESS" }, PurchaseUnits = new List <PurchaseUnitRequest> { PUR } }; return(orderRequest); }