public override void SetModel(PaymentMethodBaseModel model, IStringResourceProvider stringResourceProvider) { base.SetModel(model, stringResourceProvider); if (!AppLogic.SecureNetVaultIsEnabled()) { return; } if (rblSecureNetVaultMethods.Items.Count != 0) { return; } if (this.Model == null) { return; } var vaultPaymentInfo = SecureNetModel.GetCustomerVault(); bool defaultToNewCard = true; rblSecureNetVaultMethods.Items.Clear(); foreach (var paymentInfo in vaultPaymentInfo) { string text = String.Format("<strong>{0}</strong>: {1} <strong>{2}</strong>: {3}", "account.creditcardprompt".StringResource(), paymentInfo.CardNumberPadded, "account.expires".StringResource(), paymentInfo.ExpDateFormatted); string value = paymentInfo.PaymentId; bool selected = value == (SecureNetModel.SelectedVaultPayment ?? SecureNetModel.GetCustomersSelectedSecureNetVault()); if (selected) { defaultToNewCard = false; } rblSecureNetVaultMethods.Items.Add( new ListItem { Text = text, Value = value, Selected = selected }); } rblSecureNetVaultMethods.Items.Add( new ListItem { Text = "Use a new credit card", Value = "-1", Selected = defaultToNewCard, }); }