#Ecnarongi-return_url

1 messages · Page 1 of 1 (latest)

rugged agate
#

hello @pulsar hamlet , the return_url is the url your customer will be directed to after they complete payment. This is typically a page on your application/site

#

it's not the webhook endpoint url

pulsar hamlet
#

cool, that makes sense

rugged agate
#

for example, when the customer is directed to that page, you may want to display a "payment successful" message

pulsar hamlet
#

I get it like an Order page or Thank you

rugged agate
#

yep!

pulsar hamlet
#

where would the webhook go in this process, I was going through the migration page for the PaymentElement and it instructed me to connect a webhook, the question is where am I connecting that webhook to?

rugged agate
pulsar hamlet
#

I set it up in my dashboard, I am under the impression the webhook has to be invoked or initialized before it starts listening for events

#

yes that is the link

rugged agate
#

can you share your account id? i'll take a look at how it's been setup

pulsar hamlet
#

how would I share my account, do you need my account number?

rugged agate
#

nonono, you should never give your account number

#

the account id which i'm referring to is a unique account id for your Stripe account

#

it typically looks like acct_123

#

it's in the upper right hand corner

pulsar hamlet
#

acct_1HciXvC2qX544g6W

rugged agate
#

you've already setup your webhook successfully, an event has also been delivered to your webhook endpoint i.e. evt_3KBs9fC2qX544g6W02BHNA7B

#

nothing else needs to be done

pulsar hamlet
#

should I not be expecting a response in my webhook, e.g. once received do something?

#

I was under the impression that once I received a response that I would update the db with data sent from stripe

rugged agate
#

ah alright, i understand what you mean now. yes, you will want to implement the logic to handle any follow up processes

pulsar hamlet
#

so you see why I am asking WHERE do I connect the webhook in the payment process

#

like when is the webhook called/accessed?

rugged agate
#

you can take a look at this guide for an example of how to setup webhooks : https://stripe.com/docs/webhooks/quickstart

For example, if you want to update your database when you receive a payment_intent.successful event, you can do it here

when 'payment_intent.succeeded'
    payment_intent = event.data.object # contains a Stripe::PaymentIntent
    puts "Payment for #{payment_intent['amount']} succeeded."
    # Then define and call a method to handle the successful payment intent.
    # handle_payment_intent_succeeded(payment_intent)
pulsar hamlet
#

yes

#

say all of this code lives in server.php

#

when does server.php get called?

#

is it automatically served from the stripe server?

rugged agate
#

when Stripe sends a webhook event to your server

pulsar hamlet
#

gotcha

#

I was under the wrong impression

#

I was trying to fit a square peg into a round hole for almost a week

#

thank you

rugged agate
#

you're welcome, feel free to reach out anytime you have questions!

pulsar hamlet
#

no problem, happy holidays