WPPizza – A Restaurant Plugin for WordPress › Support › Feature Requests › Multiple Authorize Net Accounts Based on Branch
- AuthorPosts
- 29 October, 2020 at 10:20 am #51840
Please add filters that allow us to change the Authorize Net gateway account based on branch, as you had did for Stripe accounts before:
add_filter('wppizza_gateway_stripe_filter_options', 'myprefix_filter_stripe_options', 10, 3); function myprefix_filter_stripe_options($gateway_options, $order_details, $filter_ident){ /* same *unique* identifier set for the formfield */ $unique_ident = 'shop_branch'; /* values branch 1 */ if($order_details['customer'][$unique_ident]['value'] == 'Branch 1' ){ /* set Stripe API keys as required for Branch 1 edit as required */ $gateway_options['LiveSecretKey'] = 'sk_live_someapikeybranch_1'; $gateway_options['LivePublishableKey'] = 'pk_live_someapikeybranch_1'; $gateway_options['TestSecretKey'] = 'sk_test_someapikeybranch_1'; $gateway_options['TestPublishableKey'] = 'pk_test_someapikeybranch_1'; $gateway_options['WebhookLiveKey'] = 'whsec_someapikeybranch_1'; $gateway_options['WebhookTestKey'] = 'whsec_someapikeybranch_1'; } /* values branch 2 */ elseif($order_details['customer'][$unique_ident]['value'] == 'Branch 2' ){ /* set Stripe API keys as required for Branch 2 edit as required */ $gateway_options['LiveSecretKey'] = 'sk_live_someapikeybranch_2'; $gateway_options['LivePublishableKey'] = 'pk_live_someapikeybranch_2'; $gateway_options['TestSecretKey'] = 'sk_test_someapikeybranch_2'; $gateway_options['TestPublishableKey'] = 'pk_test_someapikeybranch_2'; $gateway_options['WebhookLiveKey'] = 'whsec_someapikeybranch_2'; $gateway_options['WebhookTestKey'] = 'whsec_someapikeybranch_2'; } /* ... etc etc .... */ return $gateway_options; }
Thank you
14 November, 2020 at 9:46 am #52154This reply has been marked as private.14 November, 2020 at 4:24 pm #52158sorry, there are no updates and there won’t be any to that version as it will be soon superseeded by v4 which will work completely differently as the auth.net api has completely changed and the current way has been deprecated
although i am happy to add a couple of filters in that update to v4 (i suspect this to be available in the next week or 2)
– depending on the implementation you might choose (there will be different ones available using different auth.ent API implementations) – it’s not necessarily going to be possible to change credentials at the time the order is being submitted as those might have to be set *before* the order is submitted - AuthorPosts
- The topic ‘Multiple Authorize Net Accounts Based on Branch’ is closed to new replies.