#cryptoboyjr
1 messages · Page 1 of 1 (latest)
What's up?
Yes.
Waiting for you to ask a question. 🙂
that's my session id
adding a screenshot
what will be the ID for payment?
so I can reference the payment
This Checkout Session hasn't been used yet. The ID of the Payment Intent doesn't exist yet.
i know
and i understand that
but how I do I get the payment id then?
is the paymentid in this?
cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
sorry the payment id in the session?
I want to take an ID and put it in my database
so if someone says they didn't pay
we have an ID to review and look up
something that matches to the payment
i need something that ties the two systems together
You can use the Checkout Session ID for that.
how do I get that?
That's the ID you provided above, the cs_ one.
You can use that to retrieve the Checkout Session from the API and check the payment_status property: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-payment_status
var options = new SessionCreateOptions
{
CustomerEmail = Session["EmailAddress"].ToString(),
SuccessUrl = "https://other.sugarbertboxing.com/thankyouboxer.aspx",
CancelUrl = "https://other.sugarbertboxing.com/boxers.aspx",
PaymentMethodTypes = new List<string>
{
"card",
},
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
PriceData = new SessionLineItemPriceDataOptions
{
Currency = "usd",
//UnitAmount = 5000,
UnitAmount = 500,
ProductData = new SessionLineItemPriceDataProductDataOptions
{
Name = "SugarBert Boxing Registration",
}
},
Quantity = 1,
},
},
Mode = "payment",
};
var service = new SessionService();
Session session = service.Create(options);
sessionId = session.Id;
that's all that i have right now
all it does is redirect to my successurl
Right... that's you creating the Checkout Session.
Do you have a question about that?
i think i can do thsi right?
var service = new SessionService();
Session session = service.Get("");
// You can track :-
string test = session.Id;
string test2 = session.PaymentStatus; // Paid or Unpaid
string test3 = session.Status;
string test4 = session.Mode;
what would be the ID?
that i want?
string test4 = session.PaymentIntentId;?
You want the ID from the Checkout Session, which is probably test there, but I can't say for sure as I don't know exactly what your code is doing. If you try that was does test contain?
let me do a test real quick
string stripeSessionID = Session["StripeSessionID"].ToString();
var service = new SessionService();
Session session = service.Get(stripeSessionID);
// You can track :-
string test = session.Id;
string test2 = session.PaymentStatus; // Paid or Unpaid
string test3 = session.Status;
string test4 = session.PaymentIntentId;
yeah that didn't return anything
it foudn the session
What is stripeSessionID?
cs_live_a1pBIRwN5JCLxq3SOmqhIbxKGRHpKY2MZIKgvG4KTLfEQCMc9mrrFc8GXq
That's the ID you need, yeah. What is test? Is it the same ID or something else?
just test variables
can you check if a payment was made with that session id?
cs_live_a1pBIRwN5JCLxq3SOmqhIbxKGRHpKY2MZIKgvG4KTLfEQCMc9mrrFc8GXq
says it's unpaid
but i did pay using my credit card
Doesn't look like you did, at least not on that specific Checkout Session.
trying something else
Flagging you shouldn't be testing in live mode, BTW. You should test in test mode.
That's a Price ID, which defines how much you charge for a Product. It's not specific to any particular Checkout Session or transaction.
Let's back up.
What do you want to do, and what's preventing you from doing it?
i'm trying to get this
What is "this"?
You have that already though, in stripeSessionID, right?
Can you explain in detail why you're sharing that screenshot?
You want the pm_ ID? Why?
so let's say I take that ID to my database
if a user says they paid or didn't pay
we can look up their information by the ID we save
The Payment Method ID won't help you do that. The Payment Method ID represents their payment information. The same Payment Method ID might be used across 100 different payments.
You want to use the Checkout Session ID for this. The one starting with cs_.
That one is specific to a single transaction.
Checkout Sessions contain details about the payment status, what was purchased, etc.
Sorry, I'm not sure where the disconnect is here.
that's line items
StripeList<LineItem> lineItems = checkOutService.ListLineItems(session.Id);
The ID you want is the Checkout Session ID. That ID starts with cs_. The ID you just provided does not start with cs_.
You've mentioned the Checkout Session ID many times already.
This one: cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
That's a Checkout Session ID. Note how it starts with cs_.
That's the ID that's specific to that Checkout Session, that one transaction.
that's all i need then?
What does that mean? What payment details?
If you take that Checkout Session ID and search for it in the Dashboard what happens?
ok
so you are saying this id
cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
is all that I need?
Need for what? It seems like we're still not fully understanding each other.
let's say
a person uses stripe on my website
they pay
i save this id - cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
in my database
with me so far
Yes.
then a month passes
they said they paid
we want to look it up
cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
i have that id in my database now
is that how I look the payment up in stripe?
Yes. You use that ID to retrieve the Checkout Session from the API: https://docs.stripe.com/api/checkout/sessions/retrieve
When you retrieve it you'll have access to all of the properties listed here: https://docs.stripe.com/api/checkout/sessions/object
This is the Checkout Session ID: cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
It's the ID that begins with cs_.
cs stands for Checkout Session.
that's the ID i'm passing in
Okay.
right?
var checkOutService = new Stripe.Checkout.SessionService();
StripeList<LineItem> lineItems = checkOutService.ListLineItems(session.Id);
= cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
i have information
but what do I use in stripe to find out the payment details?
not by code
i search by this?
cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
Hang on. What do you mean by "the payment details"?
let's start over
a user uses my website
they pay using stripe
this is formed - cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
with me so far?
Yes.
stripe then says successful
i have this id still - cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
with me?
Yes.
ok i'm goign to save this
cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
Yep.
into my database as a stripe session id
2 months go by
the person who used stripe said they paid
I log into stripe
i want to see if they paid
or just the details
i only have this id
cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
Yep.
You use that ID to retrieve the Checkout Session from the Stripe API and all the details you want are on the returned object.
Or on objects that object references, which you can also retrieve from the API.
yeah i'm not worried about the api part of it
what i'm worried about is that i'm saving the correct id
so if i log onto stripe
and go into the dashboard
i can find that payment informatio using?
cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ
not in code
but logging into stripe through a browser
👋 stepping in as Rubeus needs to step away
k
There is no Dashboard page for a Checkout Session ID
ok
So if you want to be able to search in the Dashboard based on ID then you want the PaymentIntent ID
Sure
what i've noticed
there's a delay
once you submit
and stripe says the paymetn went through
however when checking
stripe still says unpaid
is that correct?
cs_test_a1YqnWiClxf1EON0hQOKXxKkBRXyhP12BxV55Bxz6pCv5l2mT6eJqfUplq
that went through fine
but i'm not seeing paymentid
That Checkout Session has not been completed
You want to wait for the checkout.session.completed Event to ingest this data
how long is the delay sometimes?
A couple seconds for Webhooks generally
cs_test_a15UtmrxQCdlMwc7XiuUQK6uFaSLmt8796s2enhPUBqrduRq8Eitdnur2n
can you check this?
i want to make sure I'm seeing it correctly
i'm not seeing a paymentintentid on this
says unpaid still
it's been like 2 minutes
Right because you haven't completed that Checkout Session
So I'm guessing you are mixing up your Checkout Session ID
i'm confused
If you retrieve the Checkout Session with the API the status will be updated immediately.
After it has been completed
cs_test_a15UtmrxQCdlMwc7XiuUQK6uFaSLmt8796s2enhPUBqrduRq8Eitdnur2n
that's the id
var options = new SessionCreateOptions
{
CustomerEmail = Session["EmailAddress"].ToString(),
//SuccessUrl = "https://other.sugarbertboxing.com/thankyouboxer.aspx",
//CancelUrl = "https://other.sugarbertboxing.com/boxers.aspx",
SuccessUrl = "http://localhost:2401/thankyouboxer.aspx",
CancelUrl = "http://localhost:2401/boxers.aspx",
PaymentMethodTypes = new List<string>
{
"card",
},
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
PriceData = new SessionLineItemPriceDataOptions
{
Currency = "usd",
//UnitAmount = 5000,
UnitAmount = 500,
ProductData = new SessionLineItemPriceDataProductDataOptions
{
Name = "SugarBert Boxing Registration",
}
},
Quantity = 1,
},
},
Mode = "payment",
};
var service = new SessionService();
Session session = service.Create(options);
sessionId = session.Id;
Session["StripeSessionID"] = sessionId;
SuccessUrl = "http://localhost:2401/thankyouboxer.aspx",
success directs me to this page
i check my session id
cs_test_a15UtmrxQCdlMwc7XiuUQK6uFaSLmt8796s2enhPUBqrduRq8Eitdnur2n
nothing
https://checkout.stripe.com/c/pay/cs_test_a15UtmrxQCdlMwc7XiuUQK6uFaSLmt8796s2enhPUBqrduRq8Eitdnur2n#fidkdWxOYHwnPyd1blpxYHZxWjA0SE5WYGNGT289c1JkQWdSbjBhYTxUa0tgTXZWYWBjM1NmaUBAfE48VUtyREFxVURnQDFQS1dkfDFudVc9cktuVUQ0NjJxdkFqMXFXV2BSaUxENWA0UFJkNTVVUVxjVkppVScpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl is the URL for that Checkout Session and you can clearly see that it isn't completed
So there is something wrong on your end
if it was completed what would it look like?
Go ahead and complete that one and you can then find out
ok
working onit
few min
cs_test_a1eKFe4KhjPF9kASvu1OgUdsoR3vmc1F6NkFvrhRYX0krePmC3YWFcHtBG
this one worked
pi_3OmKkNCJj8vWaDbW17gZOh3K
payment intent id
pi_3OmKkNCJj8vWaDbW17gZOh3K
this is a unique number value for every successful transaction?
Yes PaymentIntent IDs are unique
i tried putting this in
the url string
but it didnt' work
am I missign something?
cs_test_a1eKFe4KhjPF9kASvu1OgUdsoR3vmc1F6NkFvrhRYX0krePmC3YWFcHtBG
i haven't changed my code
Not sure what that means
Yeah that's not how it works.
There is a specific url returned in the response when you create a Checkout Session
That is the URL that you use to complete the Checkout Session
It is where you redirect your customers
nice
let me see if i have that
ty
i see this
/v1/checkout/sessions/cs_test_a1QMJ1DSdzpCmNhpKXFHzJ4Gb0NLOUfKRtnOfjmaeA54dOYSGHJkfRGz1T/line_items
If you want me to help you then you need to be explicit about what you are doing and what you are confused about. Just saying a generic statement or dropping a random ID or URL doesn't tell me anything.
i'm trying to get this url with my id
trying to see if it's in my code
var checkOutService = new Stripe.Checkout.SessionService();
StripeList<LineItem> lineItems = checkOutService.ListLineItems(session.Id);
this returns with good information
When you create the Checkout Session it will be in the response
It is literally the url proprerty: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-url
If you need an example. take a look at our quickstart: https://docs.stripe.com/checkout/quickstart?lang=dotnet