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

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();
    
uCommerce Aps - Studsgade 29B - 8000 Aarhus C - Denmark
Phone +45 61 799 997 - Email [email protected] uCommerce logo