Checkout - Payment Method

Display available payment methods for the customer to select. It can be filtered based on the country.

 


Relevant APIs

 

 

UCommerce.Api
TransactionLibrary.GetBillingInformation()
 
TransactionLibrary.GetPaymentMethods(country = null)
 
UCommerce.EntitiesV2
     PurchaseOrder
          Payments
     Payment
     PaymentMethod
 
UCommerce
     Money(amount, currency)  

Hands-on

Find the “PaymentController”The method Index() renders the view “/views/Payment.cshtml” with the PaymentViewModel. Map available payment methods filtered by country into the model.


 

Update Selected Payment Method

Relevant APIs

TransactionLibrary.CreatePayment(
    paymentMethodId, 
    amount = -1, 
    requestPayment = true, 
    overwriteExisting = true)
 
TransactionLibrary.ExecuteBasketPipeline()

Hands-on

In the POST method in your PaymentController you need to update current payment by creating a new one that overrides the existing one. Use the TransactionLibrary to do so.

{{lineitem.ProductName}}

{{lineitem.VariantName}} - {{lineitem.Quantity}} x {{lineitem.FormattedPrice}} {{lineitem.FormattedPrice}}

Your cart is empty ;(
Total {{basket.FormattedProductsTotal}}
Checkout