#abrams_tank-checkout
1 messages · Page 1 of 1 (latest)
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?
What is stripe.net.dll? Have you tried using our .NET lib? https://github.com/stripe/stripe-dotnet
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - GitHub - stripe/stripe-dotnet: Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class libr...
Yes, I tried all that.
I even tried getting older versions of stripe.net.dll from Nuget
No, this is a public channel. Please don't share anything considered confidential
What specific issues are you seeing?
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
.NET Core/Standard/Framework?
.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
I also tried getting stripe.net.dll version 2.7.2 from Nuget: https://www.nuget.org/packages/Stripe.net/2.7.2. This is an older version of the stripe.net.dll. But I couldn't get that working either.
Hmm, my guess is our library doesn't support it
Yes, if it's not possible for me to use Visual Studio 2010 and .Net 4.0, I was wondering if I can just use client side Javascript and HTML. I can do this with PayPal at the moment, I don't need any DLLs with PayPal
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?
So you have a couple options with just client-side JS:
- Client-only Checkout (not recommended): https://stripe.com/docs/payments/checkout/client
- Payment Links: https://stripe.com/docs/payments/no-code
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.
Indeed a pre-existing Price object is a requirement. As I said, it's pretty limited and not recommended
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 😢
.NET Framework 4.6.1+ is required for the most recent versions of stripe-dotnet. Let me check
Yes, that is my understanding too. If there is an older version of stripe.net.dll that works with Visual Studio 2010 and .Net framework 4.0 to do what I want, please let me know, along with the associated code example.
Looking at this: https://github.com/stripe/stripe-dotnet/issues/703
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
When I read the thread, near the bottom of that thread, the user cadilhac writes "I found earlier posts here where it seems upgrading to .Net 4.5 is the only solution."
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 ...
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
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).
You can make calls to our API without the .NET library if you wanted
It's not required, just recommended
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.
Yep, you'd just be creating a Checkout Session which allows you to use ad-hoc data via the price_data parameter: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So if I understand you correctly, using Javascript, I should be able to create a Session object with Javascript. And after the session object is created with Javscript, I can call stripe.redirectToCheckout in Javascript and pass the session object's session ID to stripe.redirectToCheckout?
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
Ahh, I see. If I have to use .Net on the backend server side to create the Checkout Session, then I need to get stripe.net.dll working in Visual Studio 2010, right?
No, you can make HTTP calls to the API without it
Oh, that's cool! Do you have a .Net code excerpt on how to make an HTTP call to create a Checkout Session object? C# code excerpt preferably, but if not, any .Net code excerpt would be fine.
Our code samples only use our client libraries (or curl)
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.
Nice! You don't need to create a Product object, you can pass product_data: https://stripe.com/docs/api/checkout/sessions/create?lang=python#create_checkout_session-line_items-price_data-product_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, I will look at that.
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)
There's no security risk, no. Just the client libraries are just convenience wrappers that make some stuff easier
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?
Yes, we expect a 200 response from a webhook handler for every event otherwise we will deem it non-functioning and disable it
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?
I think there is only a Python code example at https://stripe.com/docs/webhooks on sending the 200 response back to Stripe, but not a .Net example
Ok, good. I see the "return Ok();" statement for the .Net code exceprt which sends back the 200 status code.
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)
Sure, you can use client_reference_id. Alternatively there's the metadata hash (both will be in the webhook payload we send)
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.
Can you share a screenshot?
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
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
It'll be from the Product object, yes
If you use product_data you can make this ad-hoc per Checkout Session
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
Yes, exactly. It'll create a Product & Price object ad-hoc via that single API call
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.
Np! Happy to help