Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

Payment

Get Payment Methods

Gets a collection of PaymentMethod objects.

Usage

    var paymentMethods = UCommerce.Api.TransactionLibrary.GetPaymentMethods();
    
    var danishPaymentMethods = UCommerce.Api.TransactionLibrary.GetPaymentMethods(denmark);
    

Parameters

Parameter Type Details
country Country Specifying which country defined in Ucommerce, to get the payment methods from

Create Payment

Creates a new payment of the specified amount, by requesting the specified IPaymentMethodService.

Usage

    UCommerce.Api.TransactionLibrary.CreatePayment(newPaymentMethodId, requestPayment: false);
    UCommerce.Api.TransactionLibrary.ExecuteBasketPipeline();
    HttpContext.Current.Response.Redirect("Preview.aspx");
    

Parameters

Parameter Type Details
paymentMethodId int The id of the payment method to use for the payment.
amount decimal The payment amount. This is the current basket order total by default.
requestPayment bool If the payment should be requested immediately. Set to true by default.
overwriteExisting bool If the existing payment on the current customers basket should be overwritten. Set to true by default.

Request Payments

Requests the payments, and potentially redirects customers to the payment gateway.

Usage

    UCommerce.Api.TransactionLibrary.RequestPayments();
    

Request Payment

Requests a single payment, and potentially redirects customers to the payment gateway.

Usage

    UCommerce.Api.TransactionLibrary.RequestPayment(1);
    

Parameters

Parameter Type Details
paymentId int The id of the payment to request

Checkout

Converts a Basket to a PurchaseOrder, and executes the checkout pipeline for the current basket.

This method is generally only used if you don't use a payment provider, since the payment providers usually handles this step automatically.

Usage

    UCommerce.Api.TransactionLibrary.Checkout();