Zen Cart Logo
Forums / General Questions / Switching between multiple merchant accounts

Switching between multiple merchant accounts

Views: 1,072

Results 1 to 8 of 8
13 Mar 2014, 6:44 PM
#1
ueberbill avatar

ueberbill

New Zenner

Join Date:
Mar 2014
Location:
United States
Posts:
3
Plugin Contributions:
0

Switching between multiple merchant accounts

We have one store set up with zen cart that uses our main authorize.net account. We are now going to a franchise model and would like to process payments using our franchisee's merchant accounts based on a customer input (allow them to select "their" store before checkout). Is it possible to programatically set which merchant account (they may not all be authorize.net accounts, either) w/ all relevant credentials in zen cart? We have development resources, just want to make sure this is something that's possible and perhaps some pointers on where in zencart we would do this.

Thanks!

14 Mar 2014, 2:01 PM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Switching between multiple merchant accounts

You want to restrict/filter access to various payment methods during checkout?

Add to the top of the payment processing files you want to restrict a filter that says something like this:

if (customer ID = ' (The ID number you want to filter) ') {
//allow payment method
return true;
} else {
// do not allow payment method
return false;
}

9 Apr 2014, 12:53 PM
#3
ueberbill avatar

ueberbill

New Zenner

Join Date:
Mar 2014
Location:
United States
Posts:
3
Plugin Contributions:
0

Re: Switching between multiple merchant accounts

Thanks for the response. That is helpful, but I also want to be able to switch merchant accounts between the same payment method. So if two stores have different authorize.net accounts, I want to be able to switch which credentials are being used based on user action. Is this possible?

9 Apr 2014, 2:16 PM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: Switching between multiple merchant accounts

ueberbill:

Thanks for the response. That is helpful, but I also want to be able to switch merchant accounts between the same payment method. So if two stores have different authorize.net accounts, I want to be able to switch which credentials are being used based on user action. Is this possible?
The built-in payment modules (authorize.net, linkpoint_api, paypal) assume that the credentials are stored in the database and, thus, available via PHP define variables containing that database information. To have the credentials provided on a customer-by-customer (or order-by-order) basis is possible, but custom coding (and core-file overrides) would be required.

18 Apr 2014, 8:24 PM
#5
ueberbill avatar

ueberbill

New Zenner

Join Date:
Mar 2014
Location:
United States
Posts:
3
Plugin Contributions:
0

Re: Switching between multiple merchant accounts

Thanks again. Forgive my limited PHP skills. I see where in the authorize.net module the login for the account is stored in MODULE_PAYMENT_AUTHORIZENET_LOGIN (presumably the define variable mentioned above) but I cannot find where it is set (and so override the code to select the login as necessary).

18 Apr 2014, 10:43 PM
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Switching between multiple merchant accounts

ueberbill:

Thanks again. Forgive my limited PHP skills. I see where in the authorize.net module the login for the account is stored in MODULE_PAYMENT_AUTHORIZENET_LOGIN (presumably the define variable mentioned above) but I cannot find where it is set (and so override the code to select the login as necessary).

More than likely in the database. Accessible through mysqladmin.

19 Apr 2014, 1:00 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,086
Plugin Contributions:
56

Re: Switching between multiple merchant accounts

mc12345678:

More than likely in the database. Accessible through mysqladmin.
The value **is **stored in the database, in the configuration table. Changes to the payment module's processing will be required to effect the change desired.

19 Apr 2014, 4:06 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Switching between multiple merchant accounts

ueberbill:

Thanks again. Forgive my limited PHP skills. I see where in the authorize.net module the login for the account is stored in MODULE_PAYMENT_AUTHORIZENET_LOGIN (presumably the define variable mentioned above) but I cannot find where it is set (and so override the code to select the login as necessary).
Simple: You don't bother with changing where it's defined.
Instead, you find every occurrence where that constant is used, and replace that constant with PHP code that determines the desired value to use instead.
You may have to do similarly with a few other constants as well, since transaction-key and md5hash, etc are all intended to work in conjunction with one another per-account.
You said you have development resources, so I'm assuming they'll understand what I've written here.