#Question About Sapphire API
1 messages · Page 1 of 1 (latest)
Just use discord native
It's under your discord developer portal -> your application -> monetisation
well, it's different
i have my own store with my local payment gateway
different indeed but also much better if you ask me
and the payment gateway is sending callback if the payment has been paid
what you're asking is
What I mean is this, I want to integrate my discord bot with the payment gateway that I use. The payment gateway will send a callback to my bot API if the transaction is successful. My question is, can Sapphire API be used for Callback API like that?
yes
it just uses node:http, the exact same thing that express, fastify, koa, etc use. Ergo, it can be used for it.
I see, then another question how do I use Middleware in the Sapphire API? I read the documentation and found Middleware, is it the same as Routes? create a middleware folder
yes
is there any exmaple to use the middleware?
the ones in the repo itself only really. No one has ever asked to implement their own middleware before so I have no idea if anyone has.
can you provide me the link?
what file name do i need to use? like for routes is hello.get.ts, for middleware?