4
5 Comments

Help using Stripe Connect for customers to accept direct payments

Hi All - any chance someone out there has experience with the Stripe Connect API? Heads up sorry for the lengthy post.

I'm trying to build a platform where my customers can use my platform to sign up to take payments online from their customers. Right now I'm trying to focus on building the customer side so they can take payments from their customer's and receive notifications (via an endpoint) when those payments come thru.
Later I'll focus on building the platform and billing/saving my direct customers.

I've followed a few of the tutorials on the Stripe Docs and have gotten to the point where I'm able to create a payment intent and confirm that the payment intent succeeded.

However I'm struggling with a few things -

  1. I'm getting success messages, but not seeing any test payments on my dashboard?
  2. implementing webhooks to listen for confirmed payments. I have a node server that i wanted to listen on. Using the Stripe CLI I know its working when I test w/ the CLI (i see the events from my CLI on the dashboard) but struggling to implement programmatically for every confirmed payment
  3. adding sales tax - I saw a github repo (https://github.com/stripe-samples/adding-sales-tax) but it seems the best way to implement is via webhooks.

What's making all of this complex is I'm testing it locally. The endpoint I want the webhook to trigger on is the same node server that I'd like the payments to be made too.

If it helps - here is my relevant github repo's:
Screen that loads the Stripe Promise and passes into Stripe Elements
https://github.com/idodekerobo/takeout-app/blob/master/takeout-frontend/src/screens/CheckoutScreen.js

Form that loads Stripe card element and POSTs to server:
https://github.com/idodekerobo/takeout-app/blob/master/takeout-frontend/src/containers/CheckoutForm.js

Backend logic that takes that post and creates a payment intent and sends back the client secret:
https://github.com/idodekerobo/takeout-app/blob/master/takeout-backend/routes/checkout.js

  1. 2

    Hey!

    I would help to learn more about what kind of charges and what kind of accounts you use. I can kind of read out that you use direct charges (due to stripeAccount: process.env.TEST_CONNET_ACCOUNT_ID).

    1. I'm getting success messages, but not seeing any test payments on my dashboard?

    With direct charges, they would appear on your connected account, not your own. So they would be on whatever account process.env.TEST_CONNET_ACCOUNT_ID is.

    With these direct charges, the transaction is OWNED by the connected account. You are just getting a commission.

    implementing webhooks to listen for confirmed payments.

    I'm not familiar with Stripe CLI and would recommend to use https://ngrok.com/ to cover the real life scenario. This will help a lot with testing.

    Also note that with your direct charges, you need to set up all your webhooks in the "Endpoints receiving events from Connect applications" section, otherwise they won't get triggered.

    sales tax

    Can't help you with that as I'm in Europe. Maybe a drop-in integration helps?

    https://stripe.com/en-gb-ch/partners/apps-and-extensions/tax-calculation

    You can also charge flat tax rates on subscriptions. Not sure if your rates are flat, mine are :D

    https://stripe.com/docs/billing/subscriptions/taxes

    1. 1

      Thinking about it again. I think I just need to calculate the total (including tax) direct charge on the server and send that payment to stripe. My assumption was that I needed to send the subtotals and have Stripe somehow programmatically calc the tax and totals.

    2. 1

      Thank you! Right now, yep I'm using direct charges. The idea is the customers own everything and I'm just enabling the payment.

      With direct charges, they would appear on your connected account, not your own. So they would be on whatever account >process.env.TEST_CONNET_ACCOUNT_ID is.

      That seems like an easy one in hindsight but I completely overlooked it. You're right! I do see those transactions now.

      I'm not familiar with Stripe CLI and would recommend to use https://ngrok.com/ to cover the real life scenario. This will help a lot with testing.

      I'll try that. It seems like it'd be helpful because the CLI is needed for testing on a local host and I can't get it to work the way I want too. Stripe doesn't allow defining a local host endpoint to test outside of the CLI. So I can define an endpoint w/ ngrok and start testing sending data to the server w/ the webhooks.

      As for tax, I'll look into the links you sent. My customers will have to charge their customers tax so it'll need to be added to the initial transaction. And it'll need to be a high volume/unstructured amount of transactions. Not necessarily a 1x per month type of thing. Not yet sure if those integrations help w/ that yet but it. Now that I see the payment data on the connected account, it may be something that needs to be done on the connected account end.

      I'll eventually have tax on the subscription billing but I haven't even gotten that far yet. I'll probably just use a paypal/venmo/cash app for billing while I'm building out the MVP.

      Thanks again! I'll start playing w/ the tools you mentioned tonight and this weekend.

  2. 2

    Hello @idodekerobo
    I have implemented it in c# but I can defiantly check for you in node. PM me at https://twitter.com/mhrnik

Trending on Indie Hackers
Here's how we got our first 200 users 30 comments Reaching $100k MRR Organically in 12 months 28 comments What you can learn from Marc Lou 20 comments Software Developers Can Build Beautiful Software 13 comments Worst Hire - my lessons 11 comments How to Secure #1 on Product Hunt: DO’s and DON'Ts / Experience from PitchBob – AI Pitch Deck Generator & Founders Co-Pilot 10 comments