nopCommerce 2.65, Authorize.NET, and removing a card type (i.e. Amex)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Prior to upgrading to 2.65, I was running 1.90.  I distinctly remember being able to remove Amex from the available card types accepted.  However, now, it seems like it is hard coded into the Authorize.NET payment module (and PayPal Direct for that matter).

What is the proper approach to removing it?  It doesn't seems sensible to modify the code for the plugin, but I can if I have to.

NOTE: I cannot upgrade to the latest if that is your answer to this issue as this is still hosted on a Windows 2003 server and 2.65 is the last that supports that OS.
11 years ago
You're right, it is hardcoded.  If you download the source you just need to go to the plugin project, open PaymentAuthorizeNetController.cs in the Controllers folder, and remove this section:


model.CreditCardTypes.Add(new SelectListItem()
            {
                Text = "Amex",
                Value = "Amex",
            });


Then compile it and place the DLL in the corresponding folder on your server.
11 years ago
Are there any known plans for making it an easily configurable setting?  Seems like a no-brainer that doesn't require a whole lot of effort.  I guess I know what I'll be doing tonight.  PULL REQUEST!!!

AndyMcKenna wrote:
You're right, it is hardcoded.  If you download the source you just need to go to the plugin project, open PaymentAuthorizeNetController.cs in the Controllers folder, and remove this section:


model.CreditCardTypes.Add(new SelectListItem()
            {
                Text = "Amex",
                Value = "Amex",
            });


Then compile it and place the DLL in the corresponding folder on your server.
11 years ago
Just a tip... since nop is heavy on caching, you probably need to recycle the app pool to actually notice any change...
10 years ago
+1 vote for making this configurable please.
9 years ago
I did it in the view, as temporary solution

find in PaymentInfo.cshtml for Authorize.net plugin

@Html.DropDownListFor(model => model.CreditCardType, Model.CreditCardTypes, new { @class = "dropdownlists" })


and replace with


@Html.DropDownListFor(model => model.CreditCardType, Model.CreditCardTypes.Where(i => i.Text != "Amex"), new { @class = "dropdownlists" })
8 years ago
Would it be possible to remove both Amex and Discover with this method? I got rid of AMEX with the view solution but also need to have it remove Discover and a drop down item as well and I have no idea how to write the view code to do both.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.