Select version
v7.7 v7.6 v7.5 v7.3 v7.1 v7.0 v6.8 v6.7 v6.6 v6 v5 v4 v3 v2

Checkout Step by Step

Add to basket

    
    
    //Grab current product from the APIs
    var currentProduct = UCommerce.Runtime.SiteContext.Current.CatalogContext.CurrentProduct;
    
    TransactionLibrary.AddToBasket(1,currentProduct.Sku,"selected variant sku",addToExistingLine: true, executeBasketPipeline: true);
    
    
    

Update address info for billing and shipping address

    
    
    TransactionLibrary.EditBillingInformation(
    	"Some",
    	"Guy",
    	"email@gmail.com",
    	"88888888",
    	"88888888",
    	"uCommerce",
    	"studsgade 29",
    	"B",
    	"8000",
    	"aarhus c",
    	"denmark",
    	"Attention someone",
    	Country.All().First().CountryId);
    
    TransactionLibrary.EditShippingInformation(
    	"Some",
    	"Guy",
    	"email@gmail.com",
    	"88888888",
    	"88888888",
    	"uCommerce",
    	"studsgade 29",
    	"B",
    	"8000",
    	"aarhus c",
    	"denmark",
    	"Attention someone",
    	Country.All().First().CountryId);
    
    TransactionLibrary.ExecuteBasketPipeline();
    
    

Create shipment

    
    
    TransactionLibrary.CreateShipment(TransactionLibrary.GetShippingMethods().First().ShippingMethodId, overwriteExisting: true);
    TransactionLibrary.ExecuteBasketPipeline();
    
    

Payment

    
    
    TransactionLibrary.ExecuteBasketPipeline();
    TransactionLibrary.CreatePayment(TransactionLibrary.GetPaymentMethods().First().PaymentMethodId, overwriteExisting: true, requestPayment: false);
    
    

Request payment

    
    
    //built-in payment gateways will redirect the user here
    TransactionLibrary.RequestPayments();
    
    //If default payment gateway is used no redirect occours, so we handle this as a fallback
    HttpContext.Current.Request.Redirect("/complete");
    
    
uCommerce Aps - Studsgade 29B - 8000 Aarhus C - Denmark
Phone +45 61 799 997 - Email info@ucommerce.dk uCommerce logo