I want to know how to add a Gumroad payment gateway

I want to integrate Gumroad as a payment gateway.

Can you tell me HOW this is done? A simple button of "Make Payment" that takes into account the User's current payment plan.

If there is a tutorial on that, I'd love to go through it.

Here's what I'm thinking:

1. I need a separate URL for each type of payment.
2. I have four types of payments that a User can make. There are two levels (call them COP and IP), and each level has a monthly and an annual payment set up.
3. I have set up these in Gumroad. With Gumroad, I just need to send the user to a URL. I have FOUR URLs for the four types of payments.
4. Now, What I need:

How can I change the URL of the PAY NOW button depending on the selection the User has made?

Is the question making sense here? I hope so.

Let me know please. Thank you.

  • Tyler Postle

    Hey Momekh,

    Pro Sites doesn't currently support Gumroad and I haven't seen any tutorials out there on integrating it. I think the issue you will run into is that there is no communication between the two. Pro Sites won't know if they cancel the subscription or if the payment is declined and that's what Pro Sites works off of. When the payment is approved then it sends that info to your site and enables the site/features.

    This would take some custom coding to implement. Be a good one to post on the jobs board. See if a talented community member would be interested in getting that integrated for you.

    Let me know if you have any futher questions on this :slight_smile:

    Cheers,
    Tyler

  • Momekh

    Thank you for the reference.

    But to be clear...

    I want to do what I mentioned in Step 4. That's it. A simple ajax code to change the URL depending on the selection.

    The fact that Pro Sites won't cancel etc is not relevant to me, because I use WHMCS for that.

    And also note, this is a quick-fix, to get the prototype working fully. I will be integrating WHMCS and asking questions related to that. But for now, I just need to set a URL for each selection. A code that helps me do that, I have looked into the PHP files of the Manual payment and I am hoping that a small function that does that will set me on my way.

  • DavidM

    Hi @Momekh,

    Working with Tyler here, I think he and I may have misunderstood you here. Could you maybe elaborate more on exactly what you're trying to achieve?

    From what I understand, you'll be using WHMCS yet you want to integrate Gumroad for the payment process, is that correct?

    Since WHMCS would normally be used for the payment process, is there a reason you're using Gumroad in that case? And were you instead looking to integrate that gateway with WHMCS?

    Regarding the step 4 you mentioned, you can easily attach a JavaScript event listener to the Pro Sites buttons so that you can then do something more specific on button presses.

    But you wouldn't need any AJAX since you could easily get all the info you need from the form values on the page. I've attached a screenshot showing the values available via HTML.

    You could also easily send the user to another URL based on those values, using just JavaScript. No AJAX communication is needed for that.

    Is that what you were looking to do though?

    Cheers,
    David

  • Momekh

    Thank you so much for the response. Yes, I want to eventually use the WHMCS integration fully (right now I have been unable to make it work -- but that requires a different support thread). For now, I am in "beta mode" where I am just putting up a simple way for people to give payments, depending on the level they select. Once they make the payment, ideally I would need to inform ProSites of this so their membership could be done etc. But that I am doing manually so far. I will receive an email that payment has been made, and I will manually set the ProSites extension.

    So, I would send the user to a different URL using this, how? Should I call a php file when the form is submitted, and then do a if/then check? Can I do it in the functions.php file?

  • DavidM

    Hi @Momekh,

    Thanks for your patience here! Yep, you can add PHP to your functions.php file, or you can add code using Code Snippets:
    http://wordpress.org/plugins/code-snippets/

    In this case, you'll want to use the wp_head hook to add custom JavaScript to your site's head section. Here's a tutorial on how that can be done:
    http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/

    For the code itself, it's easiest to use the jQuery click method to attach some custom code to the click event for the Pro Sites checkout button.

    Based on the click event, you can then send a user to a custom url like described here (the reference isn't specific to jQuery but it's the quickest explanation):
    http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery-javascript

    While we don't have the resources to assist with all the custom code needed in that case, I hope that helps to see how it can be done.

    If you're not really familiar with JavaScript code though, you could try posting a job in the Job Board as Tyler mentioned initially.

    Hope this helps! :slight_smile:

    Cheers,
    David

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.