Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to fetch Saved Credit Cards #875

Open
sandeep1102 opened this issue Sep 14, 2022 · 0 comments
Open

Unable to fetch Saved Credit Cards #875

sandeep1102 opened this issue Sep 14, 2022 · 0 comments

Comments

@sandeep1102
Copy link

Describe the bug
CustomerContext.Current.CurrentContact.ContactCreditCards should return saved credit cards but it doesn't return any list or say length is always 0, even after saving one credit card entry through code.

To Reproduce
Run this code and at first run there can be empty list of credit cards but after saving one it should show saved credit cards list.

var epiServerContext = CustomerContext.Current.CurrentContact;
            var epiServerCreditCards1 = CustomerContext.Current?.GetContactCreditCards(epiServerContext);
            var epiServerCreditCards2 = epiServerContext?.ContactCreditCards;
            var creditCard = new CreditCard
            {
                LastFourDigits = Convert.ToString("1111"),
                ExpirationMonth = Convert.ToInt32(12),
                ExpirationYear = Convert.ToInt32(2023),
                CardType = 1,
            };
            epiServerContext?.AddCreditCard(creditCard);
            epiServerContext?.SaveChanges();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant