#abrams_tank-checkout

1 messages · Page 1 of 1 (latest)

orchid sapphire
slim pecan
#

Hi, you are Stripe staff, right?

#

I have gone through Stripe support already, and they told me to come here

#

So if I send you screenshots here, the screenshots will be kept private, right?

orchid sapphire
slim pecan
#

Yes, I tried all that.

#

I even tried getting older versions of stripe.net.dll from Nuget

orchid sapphire
#

No, this is a public channel. Please don't share anything considered confidential

orchid sapphire
slim pecan
#

Well, I can't use the latest version of Stripe.net. I get an error with Nuget.

#

Can I send you the pictures privately?

#

Oops, I can't send the screenshots to you by private message.

#

It said "upload failed".

#

Anyways, the error message I get in Visual Studio 4.0 is "'Stripe.net' already has a dependency defined for 'Newtonsoft.json'"

#

I mean, Visual Studio 2010 with .Net 4.0

orchid sapphire
#

.NET Core/Standard/Framework?

slim pecan
#

.Net 4.0. So it's a very old version of .Net

#

.Net 4.0 comes with Visual Studio 2010. So I guess it's 10 years old

orchid sapphire
#

Hmm, my guess is our library doesn't support it

slim pecan
#

Is it possible to just use Javascript and HTML to redirect to Stripe's checkout page, while passing the price, short text description of the product, and the Order ID?

orchid sapphire
slim pecan
#

Yes, I have been looking at stripe.redirectToCheckout. Looking at the example code you just linked, the code fragment is: stripe.redirectToCheckout({
lineItems: [{
price: '{{PRICE_ID}}', // Replace with the ID of your price

#

This requires me to define the product and price ahead of time in my Stripe account, right? I don't want to do that. My website calculates the price dynamically.

orchid sapphire
#

Indeed a pre-existing Price object is a requirement. As I said, it's pretty limited and not recommended

slim pecan
#

Ok. It seems like I need to get stripe.net.dll working then. So I guess the final answer regarding stripe.net.dll, is that it does not work with Visual Studio 2010 and .Net framework 4.0?

#

If this is the case, my website cannot integrate Stripe at this moment then. I have exhausted all my options 😢

orchid sapphire
#

.NET Framework 4.6.1+ is required for the most recent versions of stripe-dotnet. Let me check

slim pecan
orchid sapphire
#

5.1.1 seems like it'll work. But that's such an old version that predates Checkout so it won't support that API

slim pecan
#

I guess there is also the issue if older versions of stripe.net.dll support TLS 1.2. I am currently able to get TLS 1.2 working with PayPal with .Net framework 4.0. But if older versions of stripe.net.dll do not support TLS 1.2, that is a problem too ...

orchid sapphire
#

Yeah, you're working with a pretty old version of the framework and subsequently a very old version of our client library. It's less than ideal

slim pecan
#

I see. Unfortunately, Stripe doesn't have what PayPal does. With PayPal, I make a call to PayPal's server, and then they send me back the HTML for an encrypted button. The customer clicks on this encrypted button and they are redirected to PayPal's checkout page. No DLLs required, and I can pass whatever price I want to PayPal (PayPal will take the price that is passed to its server, and insert the price into the encrypted button).

orchid sapphire
#

You can make calls to our API without the .NET library if you wanted

#

It's not required, just recommended

slim pecan
# orchid sapphire You can make calls to our API *without* the .NET library if you wanted

Will that allow me to do what I want? I just need to pass the price (the price is calculated dynamically by my website), a short text description of the purchase, and the Order ID to Stripe when the customer clicks on the checkout button that redirects them to Stripe. Stripe would then need to contact my webserver when the purchase is complete, and pass my webserver back the Order ID.

orchid sapphire
slim pecan
orchid sapphire
#

No, you'd need to create the Checkout Session with a server-side element (.NET I guess)

#

Then you can redirect to the page using redirectToCheckout in your frontend

slim pecan
orchid sapphire
#

No, you can make HTTP calls to the API without it

slim pecan
orchid sapphire
#

Our code samples only use our client libraries (or curl)

slim pecan
#

Hi again. I have been able to use CURL to call the Stripe test server with the .Net HttpWebRequest object. I first had to create a test Product at the Stripe website. Then I dynamically created a Price object using a CURL call to stripe. And then I finally created a Session object using a CURL call to Stripe. And then I can make a stripe.redirectToCheckout call using the Session ID returned from the Stripe CURL call. It's not fully integrated yet (I am copying and pasting the price ID and copying and pasting the session ID at the moment), but I think I can get it integrated over the next few days.

orchid sapphire
slim pecan
#

So for my first question. Yesterday, you said, "You can make calls to our API without the .NET library if you wanted. It's not required, just recommended." Do you mean using CURL calls is NOT RECOMMENDED? Is there an inherent security risk, or other risks if I just make CURL calls with the .Net HttpWebRequest object?

#

(I have 4 questions in total, this is the first question)

orchid sapphire
#

There's no security risk, no. Just the client libraries are just convenience wrappers that make some stuff easier

slim pecan
#

Ok, for my second question, it's about Webhooks. It appears the Webhooks send back a JSON string to .Net. Then the Webhook documentation says, "Your endpoint must quickly return a successful status code (2xx) prior to any complex logic that could cause a timeout ... ... If Stripe doesn’t quickly receive a 2xx response status code for an event, we mark the event as failed and stop trying to send it to your endpoint. After multiple days, we email you about the misconfigured endpoint, and automatically disable it soon after if you haven’t addressed it."

#

My webserver just needs to receive a message from Stripe that the payment was completed by the customer, and I need the Order ID from the webhook call to my webserver. I am not doing anything complicated like changing invoices, or anything really complex. Actually, after my webserver receives the message from Stripe that the customer has successfully paid for the purchase, there is no reason for my webserver to contact Stripe again (until the next customer makes a purchase). So I still need to send a 200 status back to Stripe in my case?

orchid sapphire
#

Yes, we expect a 200 response from a webhook handler for every event otherwise we will deem it non-functioning and disable it

slim pecan
#

Ok, but at https://stripe.com/docs/webhooks, I am looking at the .Net code example, and there isn't a code excerpt on the 200 response that is sent back to Stripe? Is there a .Net code excerpt somewhere else on the 200 response sent back to Stripe? And what is the exact Stripe address to send the 200 response back to?

orchid sapphire
slim pecan
#

For my third question, I mentioned yesterday (and also today) that I need to send the Order ID to Stripe and receive this back from the webhook when the customer completes the purchase at Stripe. Looking at the documentation, would this be the clientReferenceId string parameter on the stripe.redirectToCheckout method? Thus, when the customer completes the purchase successfully, I should receive the clientReferenceId back from the webhook, which would contain my Order ID? And is there a maximum length of clientReferenceId? (if it's not clientReferenceId, I need to know how to pass my Order ID to Stripe and receive it back in the webhook call)

orchid sapphire
#

Sure, you can use client_reference_id. Alternatively there's the metadata hash (both will be in the webhook payload we send)

slim pecan
#

Ok, I assume the client_reference_id can store up to 30 characters, which should be enough for me to use.

#

Ok, for my fourth and last question. Is there a way to change the text description the customer sees above the price? Would this be a parameter that I can pass to stripe.redirectToCheckout, to change the text description above the price? I think that text description comes from the Product when I created a test Product in my Stripe account.

orchid sapphire
slim pecan
#

Yes. Is there a way to send a private message to you? I would like to keep my screenshots private from other people in this channel

orchid sapphire
#

I'm afraid not

#

You can just crop it to the area

slim pecan
#

Ok. I am referring to the red box in this picture

#

The "L ... ... ..." inside the red box where ... ... ... is redacted. The "L ... ... ..." is the description above the price. I would like to change this text. But I think it's a permanent text when I created the test product in my Stripe account

orchid sapphire
#

It'll be from the Product object, yes

#

If you use product_data you can make this ad-hoc per Checkout Session

slim pecan
#

Oh, I see. So I should be able to define both the price_data, and define the product_data when I make the CURL call to Stripe, right? If I do it in this way, then I don't have to create a separate price object, and a separate product object?

#

I mean, when I make the CURL call to Stripe to create a Session object

orchid sapphire
#

Yes, exactly. It'll create a Product & Price object ad-hoc via that single API call

slim pecan
#

Ok, thank you. This is all the questions I have for now. Maybe I will have more questions as I continue my development of trying to integrate with Stripe.

orchid sapphire
#

Np! Happy to help