Multiple Authorize Net Accounts Based on Branch

WPPizza – A Restaurant Plugin for WordPress Support Feature Requests Multiple Authorize Net Accounts Based on Branch

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #51840
    Ghaleb Kassab
    Participant

      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

      #52154
      Ghaleb Kassab
      Participant
        This reply has been marked as private.
        #52158
        Olly
        Admin & Mod

          sorry, 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

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘Multiple Authorize Net Accounts Based on Branch’ is closed to new replies.