Dear Dynamicweb,
Can you please add an extra for the userId being greater than 0 (or equivalent) in the method below, as this database call is executed on every step in the checkout even though the user is not logged in?
public IEnumerable<PaymentCardToken> GetByUserId(int userId)
{
var ret = new List<PaymentCardToken>();
var cb = CommandBuilder.Create("SELECT * FROM AccessUserCard WHERE AccessUserCardUserID = {0} ORDER BY AccessUserCardUsedDate DESC", (object)userId);
using (var reader = Database.CreateDataReader(cb))
{
while (reader.Read())
{
var paymentCard = ExtractPaymentCard(reader);
if (string.Equals(paymentCard.CheckSum, CalculateCheckSum(paymentCard), StringComparison.OrdinalIgnoreCase))
{
ret.Add(paymentCard);
}
}
}
return ret;
}
Best regards,
Anders