Back

how to handle stripe payments with appwrite?

  • 0
  • Flutter
  • Cloud
  • Self Hosted
  • Functions
  • Users
kamal.panara
14 Jul, 2023, 16:34

Hello there!

I come from firebase background, and I'm new to appwrite. i need to implement the stripe payment gateway with my flutter appwrite app as well as https://payme.io/ payment gateway with appwrite and flutter app. i need little guidence from appwrite ninja (expert).

TL;DR
To handle Stripe payments with Appwrite, you can use a webhook receiver. However, this feature is currently not supported in Appwrite. In the meantime, you can proxy the incoming webhook to your Appwrite instance to pass the necessary headers. There is a solution provided in the thread, which involves using Vercel and a proxy function. Additionally, there is a mention of the upcoming Appwrite functions gen that will support webhook receivers.
Binyamin
14 Jul, 2023, 16:39

For you to be able to use Stripe with Appwrite you'll need a way to complete Stripe fulfillment process, this is probably true to other Payment gateways out there.

Meaning, you'll need to have some way to except data from the outside into your Appwrite, so your Appwrite instance will act as Webhook receiver. Which is not supported yet in Appwrite. (it will be in the next functions gen https://github.com/appwrite/appwrite/discussions/5016)

As of now you'll need to proxy somehow the incoming webhook to your Appwrite because you'll need to pass the headers somehow Check this: https://discord.com/channels/564160730845151244/564160731327758347/1126589863819489280

kamal.panara
14 Jul, 2023, 16:41

thank you so much for giving me some direction.

Tessa
14 Jul, 2023, 20:57

does this help at all? There's a few tutorials out there using appwrite functions, flutter, and stripe

https://dev.to/hackmamba/build-a-subscription-based-service-with-stripe-and-appwrite-functions-in-flutter-bia

kamal.panara
15 Jul, 2023, 10:25

Thanks for this article, I'm trying to do just payments, not subscriptions, let me see how this article can help me do that. but definitely I will need subscription too in future! Thanks to everyone for helping! really appreciated!

D5
15 Jul, 2023, 10:31

I think it's practically the same way

D5
15 Jul, 2023, 10:31

No much difference

Tessa
22 Jul, 2023, 01:45

good luck! 🙂

Tanner Meade
8 Aug, 2023, 21:43

@Binyamin The functions v4 will not support stripe because it parses the request data for the function. Stripe security validation requires the function to have access to the raw unparsed request body. [EDIT: looks like it will and the github discussion wasn't updated]

Binyamin
8 Aug, 2023, 21:45

I think it planned to pass also the raw data.

Check this for example in the node js v4

Binyamin
8 Aug, 2023, 21:46

Check row 58 as well

Tanner Meade
8 Aug, 2023, 21:51

great -- thanks for digging that out for me. The solution in the past as been to use Railway for a free proxy but railway just trashed their free tier, so I'm having to figure this out again.

Tanner Meade
8 Aug, 2023, 21:52

Do you happen to know what the request size limit is? I think I remember meldiron telling me it was like 16MB or something but I could be wrong.

Tanner Meade
8 Aug, 2023, 21:53

The request size is relevant for stripe because the request size has been too small for some stripe webhook events.

Binyamin
8 Aug, 2023, 21:53

In the executor right now is 8MB

Drake
8 Aug, 2023, 21:56

i currently use vercel

Tanner Meade
8 Aug, 2023, 22:06

I've only used their static hosting -- looks like their serverless functions could work. Are you using vercel for stripe webhooks?

Drake
8 Aug, 2023, 22:11

payment webhook, but not stripe. If you have any questions or need any more help, feel free to create a new post

Binyamin
9 Aug, 2023, 00:35

Ohh i didn't realized that there's a question. Here's Steven solution with Vercel https://github.com/stnguyen90/appwrite-function-proxy

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more