Question About Sapphire API

Is Sapphire plugin api can be used only for callback? for example. I want to make API for callback payment gateway that my bot will receive and confirm the payment from the user that has been successfully pay the product that i sell, and i send the the product to the DM
18 Replies
Favna
Favna2w ago
Developers on Discord: Enjoy Premium App Subscriptions and more!
Today, we’re announcing the ability for eligible US, EU, and UK-based app developers to monetize their Discord Apps natively on the platform with Premium App Subscriptions.
Favna
Favna2w ago
Just use discord native It's under your discord developer portal -> your application -> monetisation
Favna
Favna2w ago
No description
Intan
IntanOP2w ago
well, it's different i have my own store with my local payment gateway
Favna
Favna2w ago
different indeed but also much better if you ask me
Intan
IntanOP2w ago
and the payment gateway is sending callback if the payment has been paid
Favna
Favna2w ago
what you're asking is
Artiel
Artiel2w ago
Standards
Fortunately, the charging one has been solved now that we've all standardized on mini-USB. Or is it micro-USB? Shit.
From An unknown user
927
Intan
IntanOP2w ago
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?
Favna
Favna2w ago
yes it just uses node:http, the exact same thing that express, fastify, koa, etc use. Ergo, it can be used for it.
Intan
IntanOP2w ago
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
Favna
Favna2w ago
yes
Intan
IntanOP2w ago
is there any exmaple to use the middleware?
Favna
Favna2w ago
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.
Intan
IntanOP2w ago
can you provide me the link?
Favna
Favna2w ago
GitHub
GitHub - sapphiredev/plugins: Plugins for the Sapphire Framework
Plugins for the Sapphire Framework. Contribute to sapphiredev/plugins development by creating an account on GitHub.
Intan
IntanOP2w ago
i tried to find it, but coulnd't find it ah, okay thanks thank you so much what file name do i need to use? like for routes is hello.get.ts, for middleware?
Favna
Favna2w ago
it works the same as all other pieces in sapphire. Routes are the only exception to the norm.

Did you find this page helpful?