I noticed that the payment type (e.g. used in http://{{ServiceHost}}/{{ShopsApi}}/GetCartPaymentMethods(cartId='Cart01', paymentType='Creditcard'))
is no where configured in Sitecore. It turns out that it's hard-coded in the BaseTranslateItemsToPaymentBlock
:
protected virtual string GetPaymentTemplateName(string paymentOptionType)
{
return paymentOptionType == "1" ? "CreditCard" : (paymentOptionType == "2" ? "LoyaltyCard" : (paymentOptionType == "3" ? "GiftCard" : (paymentOptionType == "4" ? "Federated" : string.Empty)));
}
I would expect a Sitecore configuration setting. This is difficult to use at the XC9 API, and Commerce Connect doesn't work well with it. At the moment I cannot retrieve all payment options and next retrieve the payment methods using the PaymentOptionType because that expects (at XC9 side) the above mentioned hard-coded values.
How to solve this?