Get Payment Methods
Abstract
Developer tasks for using service method GetPaymentMethods
.
GetPaymentMethods
is used to retrieve the available payments methods from Commerce Server to be used with the order system and placing orders.
At your Visual Studio Solution setup:
Reference the Sitecore.Commerce.Connect.CommerceServer and Sitecore.Commerce.dll.
Select the class in your solution where you want to use this service method.
To use the service method, paste the following code:
var provider = new CommerceOrderServiceProvider(); var request = new GetPaymentMethodsRequest("en-us"); var result = provider.GetPaymentMethods(request); var shippingMethods = result.PaymentMethods;