in src/Feature/Cart/code/Repositories/CheckoutRepository.cs [56:104]
public CheckoutDataBaseJsonResult GetCheckoutData(User user)
{
var result = new CheckoutDataBaseJsonResult();
var response = this._cartManager.GetCurrentCart(CurrentStorefront, CurrentVisitorContext, true);
if (response.ServiceProviderResult.Success && response.Result != null)
{
var cart = (CommerceCart)response.ServiceProviderResult.Cart;
if (cart.Lines != null && cart.Lines.Any())
{
result.Cart = new CSCartBaseJsonResult(response.ServiceProviderResult);
result.Cart.Initialize(response.ServiceProviderResult.Cart, _productResolver);
result.ShippingMethods = new List<ShippingMethod>();
result.CartLoyaltyCardNumber = cart.LoyaltyCardID;
result.CurrencyCode = StorefrontManager.GetCustomerCurrency();
this.AddShippingOptionsToResult(result, cart);
if (result.Success)
{
this.AddShippingMethodsToResult(result);
if (result.Success)
{
this.GetAvailableCountries(result);
if (result.Success)
{
this.GetPaymentOptions(result);
if (result.Success)
{
this.GetPaymentMethods(result);
if (result.Success)
{
this.GetUserInfo(result, user);
}
}
}
}
}
}
}
result.SetErrors(response.ServiceProviderResult);
return result;
}