#ruslan_checkout-urls

1 messages ยท Page 1 of 1 (latest)

silk portalBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1247574348559028324

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

tall heartBOT
cinder ridge
#

Hi there ๐Ÿ‘‹ I'm not sure I understand the question. If you're using the {CHECKOUT_SESSION_ID} syntax, then we will replace that placeholder with the ID of the Checkout Session when your customer is directed to your success or return URL. You don't provide a value there, but rather you read the value we provide.

spiral tartan
spiral tartan
#

Main code - I mean code of my project where I really use API key and hit Stripe API

#

no test function code

cinder ridge
#

I'm going to need more context about what you're seeing. Are you logging the query params you're receiving when your success or cancel URL is hit after completing the checkout flow?

spiral tartan
silk portalBOT
spiral tartan
#

fjnvdkjfnvkru

uneven trellis
#

ruslan_checkout-urls

spiral tartan
#

let's say it a result of logging session id

#

point is that is not pulled to the placeholders

#

aka - CHECKOUT_SESSION_ID

uneven trellis
#

Can you share an example Checkout Session id for me to look at?

spiral tartan
#

it is just for testing purposes within my test function

#

it is not even real id

#

as you can see it shorter and not descriptive

uneven trellis
#

I need a real Checkout Session id. The cs_test_123

spiral tartan
uneven trellis
#

okay so I confirmed that your code passed {CHECKOUT_SESSION_ID} properly. So what exactly is the issue? What do you see in the browser's URL bar after the redirect?

spiral tartan
uneven trellis
#

I don't know what those words mean unfortunately

spiral tartan
#

URL is not valid

#

so as conclusion - it can't see those values

uneven trellis
#

What exact error do you get with what exact parameters and which exact request id req_12345 so I can help you

spiral tartan
#

uppercase url

#

one sec

spiral tartan
#

You can see error message

uneven trellis
spiral tartan
uneven trellis
#

yeah sorry this still doesn't make any sense to me, I don't know what you are asking.

This is a "placeholder". It's in your URL so that we (Stripe) can replace it with the real Checkout Session id when we redirect the customer.

spiral tartan
#

Allow me this

#
  1. Initially defined placeholders in create sessin method
#
  1. Create a real session inside my test function
#

on step 2 I need to pass real session id

#

which I subsequently pass to certain payment

#

payment_user = sample_payment(
borrowing=self.borrowing_1,
session_url=session.url,
session_id=session.id,
money_to_pay=self.borrowing_1.book.daily_fee
)

#

but prior to it I create a session itself

spiral tartan
#

so, where can I get a relevant session id

#

let's say so

#

my point is (and I want to clearly expound it to you) that on the step I am creating a real session, placeholder should be automatically replaced with real value

#

otherwise it won't work

uneven trellis
#

you create a Checkout Session, you get a response from our API in the session variable. That is an entire Checkout Session resource, you can do session.id and see the Checkout Session id

spiral tartan
#

paradox

uneven trellis
#

yeah you seem to really misunderstand the whole thing

spiral tartan
#

How can I put real id inside PLaceholder in case when I just have no one - session is not created

#

I do

uneven trellis
#

It is a placeholder. You do nothing other than what you do already.

spiral tartan
#

So, it is real trap

#

because app doesn't pull value to placeholder place

#

automatically

uneven trellis
#
  1. Create a Checkout Session
  2. Go the the URL
  3. Click on the back arrow in the top left corner
  4. Notice the cs_test_123 is in the URL automatically which is exactly what you want
spiral tartan
#

black arrow where?

#

in browser?

uneven trellis
#

Please do step 1 and 2 and then share a screenshot of what you see

spiral tartan
#

point 1

#

I can't even see URL bar

uneven trellis
#

Okay step 1 you create a Checkout Session.
Then print session.url or look at the URL property. That's the URL that you would send your customer to in a browser. Can you please share that exact URL that you see in our API response?

spiral tartan
#

Request req_SLW2Yv8SxsWna9: Not a valid URL

#

Session couldn't be created

uneven trellis
#

But I already explained this today before.

spiral tartan
#

that is initial point of the whole discussion

uneven trellis
#

You are not passing a valid URL. You never passed https:// in your URL you passed a fake/bad value

spiral tartan
#

How can I pass real vakue

#

being inside test function

uneven trellis
#

You are a developer. You are writing the code. You control exactly what to pass

spiral tartan
#

we don't need to manually put value in placeholders, do we?

#

It is pulled automatically on this place

uneven trellis
#

yes

spiral tartan
#

so, in my case why not?

uneven trellis
#

But please, you're still lost, so please try to do exactly what I said

#

@spiral tartan have you created that Checkout Session now?

silk portalBOT