Creating Infusionsoft Payment Gateway For Pro Sites Plugin

We are trying to create a new gateway for Pro Sites and Infusionsoft and this will connect
with the Infusionsoft ecommerce module. We created one in past versions of the plugin and it was successful and easy to do, however things with 3.5+ versions has changed.

I have finished creating the class for Infusionsoft payment gateway and I have registered the gateway by writing this function in PHP:

psts_register_gateway( 'ProSites_Gateway_Infusionsoft', __( 'Infusionsoft',
'psts' ), __( 'Use your Infusionsoft Merchant Account to process payments
in Pro Sites', 'psts' ) );

Upon closer look into the new version of Pro Sites, I have found out that I
have to add the tabbing interface myself so I added this additional code:

https://gist.github.com/anonymous/6cb8ecfc6ba3d1d8f5d1

It added the gateway tab properly, but it won't render the settings page. I
discovered that I have to create a separate function for rendering the tab.
But upon checking the codes in Pro Sites, I can see this is not possible to
do because the lines 78 to 83 of /lib/ProSites/Tabs.php (version 3.5.1.4)
is currently commented out. So there is no way to add my own rendering
function for the tab. Ideally, I wanted to make it work with a global
function (as opposed to a class function).

Can you please provide details on how to setup the payment gateway based on our problems listed above. We had this working in the older versions of the plugin and need to upgrade asap to 3.5+ but can't until we get our gateway working again.

Thanks.

  • Ash
    • WordPress Hacker

    Hello @monsterdevelopment

    I hope you are doing good and thanks for asking the question.

    Let me tag the developer @Rheinard for his valuable opinion on this. Please note that, developer response might be slower than the usual staff response.

    Cheers
    Ash

  • Rheinard
    • The Incredible Code Injector

    Hi @monsterdevelopment,

    You are right that those lines are commented out. The best way for you to add your custom settings page would be to hook "psts_settings_page" on line 151 of the same file.

    This will require you to look to your $_GET variables to determine what content you want to output. Echoing your content will in turn be output by Pro Sites.

    To add your tab to the gateways page you will need to look at lib/ProSites/Helper/Tabs/Gateways.php. You can then hook the filter "prosites_gateways_tabs" to add your tab.

    These 2 hooks should be enough to allow you to build your settings page without having to worry about classes. The psts_settings_page is also a good hook to use for saving your settings.

    As for the rest of the implementation of your gateway, take a look at how the Stripe gateway is built. The file "lib/ProSites/View/Front/Gateway.php" looks for very specific methods in the gateways so the Stripe gateway is a good one to model upon if you're dealing with an API directly. Or, if you need to submit some information before handing over to the API you're working with, take a look at how the PayPal gateway was built.

    I hope this helps you in the right direction.

    Cheers,
    Rheinard

  • monsterdevelopment
    • Design Lord, Child of Thor

    @rheinardkorf

    Can you please tell me what the plans are for Pro Sites and additional payment gateways.

    Previous to the 3.5 release of Pro SItes plugin there was support for additional payment gateways and there was even documentation on the support / how to section of the Pro Sites plugin that spoke about how easy it was to add new gateways. Prior to 3.5 we had a Infusionsoft payment gateway working like a dream and it worked for almost 2 years. Then 3.5 Pro Sites was released and it broke as everything was totally changed in the code. No warning, no alerts as to what needed to be changed, everything was just changed and broke all custom payment gateways.

    Fast forward to today. Based on previous suggestions in this post, we had the payment gateway working again in Version 3.5.1.4 of Pro Sites. However, another several releases have been put out, so we upgraded to Version 3.5.1.8 of Pro Sites and now again, the code has been changed dramatically and our hard work is once again trashed and we have to rebuild the payment gateway code for the third time. It is very frustrating to say the least.

    Can you please let me know in great detail what the plans are for the payment gateways for Pro Sites and what kind of support for third party payment gateways will exist? It is very frustrating to have to go through this for every single upgrade and have to re-code the gateway on each new release. Is there plans to allow and support third party payment gateways or not in this plugin moving forward? If we can't get some consistency in the plugin code, we can't bother to use it and keep having to re-tool the plugin on each release. Prior to 3.5 it was a dream and very easy to work with our own payment gateways, after 3.5 it has been much more difficult as the code is not consistent and things "just get changed" and we don't get a road map posted on the website on what is changed and what needs to be changed on our end to keep things working. Not sure if this is by design as I have also noticed after 3.5 all mention of "how easy developers can add their own payment gateways" has been totally removed from the support / how to use section of the Pro Sites plugin page. Where do we stand on this?

    I have been a member of this website since 2008 and we have always had pretty good results with most of the plugins.

    However with Pro Sites, this has been extremely frustrating experience with the constant changes to Pro Sites payment gateways with no prior notice or publishing of what changes to expect in each new release from a developer perspective, when from the initial start of using the plugin it was marketed as "very easy to add new payment gateways too" and honestly it is the single plugin we keep our membership alive for. We want to use the plugin and have used it for a long time, but we need to be able to use Infusionsoft as our payment gateway. It is just that simple.

    Alternately, would WPMU Dev be able to include Infusionsoft as a payment gateway for this plugin? I have been a member for 8 years and this is my only request for a change to your plugins, Then you can support it and know what to change on each release to keep it working?

    One way or another, we need to use it since we used it for years at the pre 3.5 version and now we are dependent on the plugin.

    If you could please get back to me asap, this is a very important project for us and we need to get some clarity as to what is going to happen on the next upgrade. Will the dev team there continue to just "do whatever sounds good at the time" or will they stick to some sort of defined coding practice and structure so additional gateways will be supported moving forward?

    In other words, are we going to continue to have a broken payment gateway on each new release of Pro Sites because the code is just changed randomly with no consideration to past versions and how they functioned?

    Thank you.

  • Umesh Kumar
    • Code Wrangler

    Hi @monsterdevelopment,

    Apologies for the delay in here, there aren't much changes from 3.5.1.4 to latest release in Gateway code.

    So this shouldn't have happened in the first place, and the integration should be working fine.
    But if it isn't working, It must be something very small that needs to be fixed.

    I can take a look at the Integration code you are using, but can't give my words to definitely fix it for you.

    And since, I have never came across any other member asking for Infusionsoft gateway integration, we won't be including it in the plugin, at least not in near future releases.

    Thanks

    • Umesh Kumar
      • Code Wrangler

      Hey there,

      I've made some modifications to the gateway code, and forwarded it to you, on your email.

      Also, the current Pro Sites requires to uncomment a filter, so that the tab could be displayed for the registered Infusionsoft gateway.

      I've made the changes in code over here, and it'll be available in next release.

      Also, you'd need to made some more modification to the gateway code, in order to work properly.

      Thanks

      • monsterdevelopment
        • Design Lord, Child of Thor

        Umesh Kumar thank you....

        So if we use what you sent it will work again with this current version of Pro Sites and then the new (next version) you are releasing will require more changes or will the changes you made to our code continue to work with next release?

        Trying to make sure I understand what we need to change now and then, if I understand correctly, we will need to make more changes when the new version is released?

        Thanks again for your help.

        • Umesh Kumar
          • Code Wrangler

          So if we use what you sent it will work again with this current version of Pro Sites and then the new (next version) you are releasing will require more changes or will the changes you made to our code continue to work with next release?

          I need to make some changes to current version, basically uncomment one of the filters in the Pro Sites plugin. That fix will be available in next release, which is suppose to come very soon.

          After that release, the changes I have made in the Infusionsoft integration will work, this will allow your plugin to register the Infusionsoft Gateway in Pro Sites settings.

          But in order to make it 100% compatible, you'd have to make some more changes, I'll try to send over the details or I'll fix it myself ( Can't make any promises, I'll try my best ) and send it over to you.

          Those changes will allow the gateway to appear on checkout page. This will only enable the Gateway integration with Pro Sites.

          Rest of it ( Charges and subscription, site creation ) should be working fine, as you told me earlier, that it was working properly with earlier version of the plugin, or you'd have to look into that.

          Hope I'm making some sense in here :slight_smile:

          Cheers

  • monsterdevelopment
    • Design Lord, Child of Thor

    Hello Umesh Kumar,

    I need to make some changes to current version, basically uncomment one of the filters in the Pro Sites plugin. That fix will be available in next release, which is suppose to come very soon.

    After that release, the changes I have made in the Infusionsoft integration will work, this will allow your plugin to register the Infusionsoft Gateway in Pro Sites settings.

    But in order to make it 100% compatible, you'd have to make some more changes, I'll try to send over the details or I'll fix it myself ( Can't make any promises, I'll try my best ) and send it over to you.

    Can you let me know if you were able to get these changes made to Pro Sites? I would love to chat with you about this in more detail.

    Can you please contact me directly: support AT monsterdevelopment.com

    Thank you for your time. Looking forward to hearing back from you soon!

  • Umesh Kumar
    • Code Wrangler

    Hi monsterdevelopment,

    Yeah the changes were released in an earlier version of plugin.

    The gateway tab can be registered using, prosites_settings_tabs_render_callback, I've already made the required changes in Infusionsoft gateway file which I provided earlier, to you over email.

    This would allow you to register and see your Payment Gateway in the Pro Sites settings.

    I'll be happy to help if you need any.

    Cheers

    • Winston
      • WPMU DEV Initiate

      Umesh Kumar hey, I am kindly asking for some assistance with a similar issue. You said in an earlier post that a gatweway tab can be registered using "prosites_settings_tabs_render_callback".

      The code seems to have somewhat changed over the past couple of years. The problem is that only shows up in one file (pro-sites-files/lib/ProSites/Helper/Tabs.php) and has no indication of how to use it. No other gateways are registered in that file.

      I am able to add a tab in this file "pro-sites-files/lib/ProSites/Helper/Tabs/Gateways.php" but where do I link a configuration page to a tab? this is very unclear

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.