Stripe integration of pro sites documentation?

Any documentation out there at all for integrating stripe? Or are you going to make me dig into the code? :p

Side note, any developers for hire for digging into the code. I hate ajax

  • Craig Grella
    • Recruit

    haha, i started to implement stripe as well, and just didn't have time to dig into it either.

    This is on my to do list, eventually, as it's pretty ostensible, and relatively easy to use front end.

    I'll let you know when I tackle it. Shoot me a note if you come up with anything good as well.

    Thanks.

    Craig

  • Kimberly
    • Champion of Loops

    Hey Guys!

    We don't have any documentation on integrating them. However we do use Stripe in Marketpress so that might be a good place to look for some guidance. Our Gateways there are pretty well documented from what I understand, although I've never built one myself.

    I'll also ask Aaron if he has anything to offer here, he may be interested in this :slight_smile:

    Best,

    Kimberly

  • in-mn
    • The Crimson Coder

    The big thing is I need to know how to mark a payment, ie, what ajax call is necessary.

    What fields the prosites purchase page is looking to submit, and what needs to be passed back to prosites (page and values)

    marketpress uses a different featureset of course, so unless its extremely similar, i am not sure how i will get what field names need to be passed to through, and back from the gateway.

  • in-mn
    • The Crimson Coder

    Oh now dont i feel stupid.

    Here i thought we had to integrate stripe a much harder way than checking a radio button. Sorry - missed that

    Aaron how would you go about implementing the addition of an optional setup fee when using stripe?

  • in-mn
    • The Crimson Coder

    @Aaron

    I have more detailed questions having read more on the stripe api for an hr. Hopefully these dont waste your time

    Stripe questions

    1) Do you want to have the subscription be Marked as Unpaid or Cancelled? I assume cancelled to deactivate Pro Sites, but what would Mark as Unpaid do?

    2) Do Coupons Exist Solely on the Pro Sites side? Or do they also need to be added to Stripe?

    3) How does Pro Sites handle Subscription billing?

    It seems that Pro Sites sends a plan name to Stripe - such as Number_Duration; and I will need to have that plan Setup in Stripe. So lets say I have a Basic and a Pro Annual option
    Basic = 1_12
    Pro = 2_12

    So then I would need to go into strip, and setup my Pro plan name of 2_12 with the correct terms?

    4) Trial of a Plan, Stripe Setting.
    When setting up a subscription, you can choose an optional trial period, So the subscription amount is charged after the trial period. Of couse, this feature is not necessary, as theres an option in Pro Sites, however, it is my understanding that before the paument is made, invoices are generated (which flows in the latter question)

    5) If we charge a setup fee, I am seeing that it is possible to submit to stripe an invoiced item outside the purchase of the subscription plan. So when it is time to renew the subscription, it uses the open invoice for that customer?

    So then how would you recommend implementing this?

    Another obvious option, if the Changing of Planb types syncs with the stripe subscription would simply be to manually change them down? A better method could be the Confirmation page could include the curl section for invoiceitems, with customer, amount, currency, description

    Ala https://stripe.com/docs/subscriptions

    What do you recommend?

  • Aaron
    • CTO

    Wow. Everything you would need is handled by the gateway automatically. Plan syncing, coupon syncing, cancelations, plan changes, etc. You don't need to worry about doing anything on the stripe side, or even how they work.

    As far as adding a setup fee, I think you would need to modify the gateway, or make a customized version of it. That's beyond what we can do for you though. This gateway took me 100+ hours to code, it's incredibly complex and powerful.

  • Alexander
    • DEV MAN’s Mascot

    Just don't forget to add the little "Web Hook" that is shown where you setup the stripe gateway on the Pro Sites settings page. I missed this and was frustrated for hours when Pro Sites never marked anything as paid. Oh the important little details....

  • in-mn
    • The Crimson Coder

    Wow huh?

    So if all is added by the Pro Sites system, why am i getting errors?

    Which makes these questions relevant.

    Request:

    {
      "prorate": "true",
      "card": "tok_09LGfr5mHY1A7h",
      "plan": "2_12"
    }
    {
      "error": {
        "type": "invalid_request_error",
        "param": "plan",
        "message": "No such plan: 2_12"
      }
    }

    So it seems that if we switch, it is not handled.

    I assume that the sync only happens when a plan is created, so if I was using paypal, switched, then my coupons, plans, and such will not be synced on the Pro Sites end?

    Also, the questions regarding what happens when level is changed, is still there.

    Do you prorate, or do you just change on invoice ?

  • Alexander
    • DEV MAN’s Mascot

    I think you should delete your stripe data and start over. Or open a new stripe account. The gateway itself will handle creating the plans and keeping everything in order. The only thing you need to do from the stripe interface is setup the web hook and get your API key. It's been working just fine for me.

  • in-mn
    • The Crimson Coder

    Also - when you save new levels, it seems like it removes the plans from Stripe, then readds them.

    As I see my plans disappearing from stripe during the Saving of the Pro Sites plan.

    I am not sure if this is just how the stripe interface handles an update plan, or if the code itself is removing, then readding the plans, etc. But its possible that a server error may prevent plans from being readded? And I am not sure how that would affect the subscribers of the plan. Just an FYI, for the Wow file.

  • in-mn
    • The Crimson Coder

    Rohman - the gateway doesnt do anything. Pro Sites does. So there needs to be a trigger for plans to be created.

    So - having existing plans, and switching the gateway didnt have any plans on Stripe.

    I had to do a function in pro sites, Edit, ad New, etc, so it could interact with stripe. Adding an api key doesnt do this. Im assuming the same will be true with coupons, etc.

    So the simple answer. Add stripe api, webhook url. Then go edit/save your plans, coupons, etc so they all sync

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.