#cryptoboyjr

1 messages · Page 1 of 1 (latest)

runic pawnBOT
twin heron
#

What's up?

fading flare
#

hey

#

ok

#

let me get a session id

#

yu there?

twin heron
#

Yes.

fading flare
#

cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ

#

ok

twin heron
#

Waiting for you to ask a question. 🙂

fading flare
#

that's my session id

#

adding a screenshot

#

what will be the ID for payment?

#

so I can reference the payment

twin heron
#

This Checkout Session hasn't been used yet. The ID of the Payment Intent doesn't exist yet.

fading flare
#

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?

twin heron
#

No, it doesn't exist yet.

#

Why do you want the ID?

#

What are you trying to do?

fading flare
#

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

twin heron
#

You can use the Checkout Session ID for that.

fading flare
#

how do I get that?

twin heron
#

That's the ID you provided above, the cs_ one.

fading flare
#

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

twin heron
#

Right... that's you creating the Checkout Session.

#

Do you have a question about that?

fading flare
#

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;?

twin heron
#

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?

fading flare
#

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

twin heron
#

What is stripeSessionID?

fading flare
#

cs_live_a1pBIRwN5JCLxq3SOmqhIbxKGRHpKY2MZIKgvG4KTLfEQCMc9mrrFc8GXq

twin heron
#

That's the ID you need, yeah. What is test? Is it the same ID or something else?

fading flare
#

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

twin heron
#

Doesn't look like you did, at least not on that specific Checkout Session.

fading flare
#

trying something else

twin heron
#

Flagging you shouldn't be testing in live mode, BTW. You should test in test mode.

fading flare
#

yes

#

i just switched

#

price_1OmJvzCJj8vWaDbW2js5HRQM

#

is that the id?

twin heron
#

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?

fading flare
#

i'm trying to get this

twin heron
#

What is "this"?

fading flare
#

cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ

#

er

twin heron
#

You have that already though, in stripeSessionID, right?

fading flare
#

the payment method id

twin heron
#

Can you explain in detail why you're sharing that screenshot?

fading flare
#

that id

#

pm_10m

twin heron
#

You want the pm_ ID? Why?

fading flare
#

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

twin heron
#

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.

fading flare
#

k

#

let me see if i have that

twin heron
#

Checkout Sessions contain details about the payment status, what was purchased, etc.

fading flare
#

li_1OmJvzCJj8vWaDbWdrQpOJN6

#

?

twin heron
#

Sorry, I'm not sure where the disconnect is here.

fading flare
#

that's line items

#

StripeList<LineItem> lineItems = checkOutService.ListLineItems(session.Id);

twin heron
#

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.

fading flare
#

that's all i need then?

twin heron
#

Yes.

#

That links to everything else involved in that particular transaction.

fading flare
#

ok

#

but i don't see that in the payment details in stripe

twin heron
#

What does that mean? What payment details?

fading flare
twin heron
#

If you take that Checkout Session ID and search for it in the Dashboard what happens?

fading flare
#

ok

#

so you are saying this id

#

cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ

#

is all that I need?

twin heron
#

Need for what? It seems like we're still not fully understanding each other.

fading flare
#

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

twin heron
#

Yes.

fading flare
#

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?

twin heron
fading flare
#

k

#

then what is the checkout session id?

#

on thi spage

twin heron
#

This is the Checkout Session ID: cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ

#

It's the ID that begins with cs_.

#

cs stands for Checkout Session.

fading flare
#

that's the ID i'm passing in

twin heron
#

Okay.

fading flare
#

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

twin heron
#

Hang on. What do you mean by "the payment details"?

fading flare
#

let's start over

#

a user uses my website

#

they pay using stripe

#

this is formed - cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ

#

with me so far?

twin heron
#

Yes.

fading flare
#

stripe then says successful

#

i have this id still - cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ

#

with me?

twin heron
#

Yes.

fading flare
#

ok i'm goign to save this

#

cs_live_a1Epi5QnmikNdrl2UrKyptWFyIENJZEtnFSxEdEbfCK4xD3TQPE2T2cXhZ

twin heron
#

Yep.

fading flare
#

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

twin heron
#

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.

fading flare
#

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

runic pawnBOT
plush sinew
#

👋 stepping in as Rubeus needs to step away

fading flare
#

k

plush sinew
#

There is no Dashboard page for a Checkout Session ID

fading flare
#

ok

plush sinew
#

So if you want to be able to search in the Dashboard based on ID then you want the PaymentIntent ID

fading flare
#

so what id do i need to save then?

#

few min

#

let me do a test

plush sinew
#

Sure

fading flare
#

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

plush sinew
#

That Checkout Session has not been completed

#

You want to wait for the checkout.session.completed Event to ingest this data

fading flare
#

how do i do that in .net?

#

c#

#

i think that's the part im missing

fading flare
#

how long is the delay sometimes?

plush sinew
#

A couple seconds for Webhooks generally

fading flare
#

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

plush sinew
#

Right because you haven't completed that Checkout Session

fading flare
#

that's wrong

#

i have

plush sinew
#

So I'm guessing you are mixing up your Checkout Session ID

fading flare
#

i'm confused

plush sinew
#

If you retrieve the Checkout Session with the API the status will be updated immediately.

#

After it has been completed

fading flare
#

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;

#

success directs me to this page

#

i check my session id

#

cs_test_a15UtmrxQCdlMwc7XiuUQK6uFaSLmt8796s2enhPUBqrduRq8Eitdnur2n

#

nothing

fading flare
#

if it was completed what would it look like?

plush sinew
#

Go ahead and complete that one and you can then find out

fading flare
#

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?

plush sinew
#

Yes PaymentIntent IDs are unique

fading flare
#

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

plush sinew
#

Not sure what that means

plush sinew
#

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

fading flare
#

nice

#

let me see if i have that

#

ty

#

i see this

#

/v1/checkout/sessions/cs_test_a1QMJ1DSdzpCmNhpKXFHzJ4Gb0NLOUfKRtnOfjmaeA54dOYSGHJkfRGz1T/line_items

plush sinew
#

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.

fading flare
#

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

plush sinew
#

When you create the Checkout Session it will be in the response

fading flare
#

ok ty

#

i think i'm good for now

#

i'll reviw the links