I haven't used foxycart plugin, but looking at the '_settings.html' file, it looks like it stores both the 'storedomain' and 'apikey' as part of the plugin settings. I would suspect that you would need to fork the plugin and modify it.
You could possibly add additional settings to the plugin for the different domains (i.e. storedomain-en, storedomain-es, apikey-en, apikey-es), and then add some logic in the plugins main 'init' method to pick up the different settings based on the current locale.
$settings = craft()->plugins->getPlugin('foxycart')->getSettings();
\FoxyCart_Helper::setSecret($settings['apikey-'.craft()->language]);
\FoxyCart_Helper::setCartUrl("https://" . $settings['storedomain-'.craft()->language] . "/cart");
Or, you could set the 'storedomain' and 'apikey' in your multi-environment config array:
return array(
'*' => array(
'storedomain' => array(
'en' => cart.en.domain.com,
'es' => cart.es.domain.com',
),
'apikey' => array(
'en' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'es' => 'YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY',
),
),
...
);
and then retrieve them using something like:
$settings = craft()->plugins->getPlugin('foxycart')->getSettings();
$storedomain = craft()->config->get('storedomain');
$apikey = craft()->config->get('apikey');
\FoxyCart_Helper::setSecret($apikey[craft()->language]);
\FoxyCart_Helper::setCartUrl("https://" . $storedomain[craft()->language] . "/cart");
You would probably also need to go and modify some the variable methods to return the localized versions, so that when you asked for 'storedomain', it returned the correct value. I.e. :
<form action="https://{{ craft.foxyCart.storedomain }}/cart" method="post" accept-charset="utf-8">
I have no idea what other integration points the foxycart plugin has with craft however. If it attempts to sync data in any way with foxycart, it might not like switching accounts like that.
Overall this sounds pretty messy. I would proceed with caution.