Test purchase of recurring product

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anni tempo fa
I was trying to test the purchase of a recurring product using a credit card and the system keeps telling me the card number is invalid. I can test purchasing a non-recurring product just fine but anything that recurs throws the same error about the card being invalid. What's the trick to making this possible?

Payments are set to Payments.Manual in the back office. Is there another setting hidden somewhere?
12 anni tempo fa
Bueller, Bueller, Bueller,
.

.

Bueller
12 anni tempo fa
Turns out that when pasting the credit card number into the form a single white-space character was at the end. I personally think the application should be smart enough to trim off white-space in this instance so I added backing stores for the CardNumber and CardCode properties in \Plugins\Nop.Plugin.Payments.Manual\Models\PaymentInfoModel.cs and trimmed the white-space automatically so that it doesn't interfere with validation. I need to update the other plugin payment processors too.

namespace Nop.Plugin.Payments.Manual.Models
{
    public class PaymentInfoModel : BaseNopModel
    {
        public PaymentInfoModel()
        {
            CreditCardTypes = new List<SelectListItem>();
            ExpireMonths = new List<SelectListItem>();
            ExpireYears = new List<SelectListItem>();
        }

        [NopResourceDisplayName("Payment.SelectCreditCard")]
        [AllowHtml]
        public string CreditCardType { get; set; }
        [NopResourceDisplayName("Payment.SelectCreditCard")]
        public IList<SelectListItem> CreditCardTypes { get; set; }

        [NopResourceDisplayName("Payment.CardholderName")]
        [AllowHtml]
        public string CardholderName { get; set; }

        private string _cardCode;
        private string _cardNumber;
        [NopResourceDisplayName("Payment.CardNumber")]
        [AllowHtml]
        public string CardNumber
        {
            get
            {
                return _cardNumber;
            }
            set
            {
                if (string.IsNullOrEmpty(value) == false)
                    _cardNumber = value.Trim(); // auto trimming to prevent white-space issues with validation
                else
                    _cardNumber = value;
            }
        }

        [NopResourceDisplayName("Payment.ExpirationDate")]
        [AllowHtml]
        public string ExpireMonth { get; set; }
        [NopResourceDisplayName("Payment.ExpirationDate")]
        [AllowHtml]
        public string ExpireYear { get; set; }
        public IList<SelectListItem> ExpireMonths { get; set; }
        public IList<SelectListItem> ExpireYears { get; set; }

        [NopResourceDisplayName("Payment.CardCode")]
        [AllowHtml]
        public string CardCode
        {
            get
            {
                return _cardCode;
            }
            set
            {
                if (string.IsNullOrEmpty(value) == false)
                    _cardCode = value.Trim(); // auto trimming to prevent white-space issues with validation
                else
                    _cardCode = value;
            }
        }
    }
}
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.