#gecko-question

1 messages ยท Page 1 of 1 (latest)

manic tartan
#

Hello ๐Ÿ‘‹
not able to find your previous thread at the moment.
Let's chat here

hollow timber
#

ok thanks.

#

I am trying to setup a stripe payment mechanism for use within a Discord environment. My thinking is pretty simple: use a command in discord, which creates a URL, that goes to Stripe hosted checkout page. User does payment, and an event is created, which I need to watch for, so I can take action based on their payment.

#

most of the sample app code works within a webpage construct. my webpage/front is discord.

#

so...my thinking is I can create a session from node environment, which builds a URL to stripe hosted payment site....so first question: is there anything wrong with this approach?

manic tartan
#

hmm interesting workflow
unfortunately I don't have any experience integrating apps with discord so can't really say if this flow would work or not

hollow timber
#

discord is really just my UI....there's a bot running on node

#

seems straightforward to me....

manic tartan
#

Ah okay! the Checkout side of things do make sense.

hollow timber
#

but what I want to confirm, is that I can generate a checkout session (sample code implies this) in node.

#

I can have a product, with multiple prices, already created, and then just use a product/price ID in the checkout URL creation, to send to the user

#

they click on that, and off they go to stripe hosted...yes?

manic tartan
hollow timber
#

great. so assuming I get my product(s) and price(s) setup (once), then the checkout session refers to them, and also sends some customer-specific info to the URL, so that I can receive it in the response once payment occurs. ( I need a user id/server info type thing to flow along)

#

the sample code refers to generating web pages for success and failure cases in payments...all in the context of a localhost'ed web server. I assume actually, that within a Stripe hosted checkout, a "success" or "fail" page is included as part of the hosting, is it not?

manic tartan
#

I assume actually, that within a Stripe hosted checkout, a "success" or "fail" page is included as part of the hosting, is it not?
You'd have to build these pages. I'm almost very sure we don't have a success or failure page that can be used in this case.

hollow timber
#

so what happens in the stripe hosted environment, when a payment completes, and no successURL is given?

manic tartan
#

Typically, it'd be a 404 or an error that page wasn't found.

hollow timber
#

ok so I must have a success/fail redirects as part of the session creation.

#

how do I pass custom values into this URL, which stripe will pass back? Do I simply build them as things like "..?user=suzie&server=123456"? or is there anything I need to pass as optinoal info to the checkout session itself?

tardy chasm
hollow timber
#

I see the url inclusion

#

that's not my question

tardy chasm
#

You can use any method of string interpolation you want to build the URLs

hollow timber
#

ok, so any info I need to flow through, need to be included in the sucess/fail URLs...and the rest of the payment details I can get from Stripe APIs?

tardy chasm
hollow timber
#

I am trying to keep things simple, if I can....I want to know when payment succeeds. Do I really have to monitor the multiple stages of payment processing events?

tardy chasm
#

You can pick a single event to monitor. charge.succeeded would be a good place to start. But because authorizations from card issuers are asynchronous we cannot easily return whether the payment was successful in a synchronous call.