Switching between two Square accounts?
-
Hi,
I have an interesting feature I need to get working and am wondering if someone can help.
I’m taking donations for an organization, and I process the donations through Woocommerce Square. I have several different donation funds set up as Woocommerce products, and most of the donations go to one Square account.
But for one fund in particular, the donations need to go to a different Square account.
My question: is it possible to hook into the “payment” loop in Woocommerce Square and change the API application_id and access_token for one particular product ID?
This is pseudocode for what I need to do: If IDs 1, 2, 3 are in checkout, use Woocommerce Square plugin API key settings, If any other ID, use the second Square account API keys.
function alternate_square_payment_ids( $gateways ) { if ( is_product( array (1, 2, 3 ) ) ) { return; // Use application_id and access_token as entered in the Woocommerce Square plugin settings // Use a second Square account ID and token for all other product IDs: $gateways['square']['application_id'] = 'second_account_application_id'; $gateways['square']['access_token'] = second_account_access_token'; } return $gateways;
Are the application_id and access_token all I need to use in order to switch between two Square accounts?
Will switching API keys effect Woocommerce Subscriptions, if used?
Thanks for any advice and help
- The topic ‘Switching between two Square accounts?’ is closed to new replies.