Stripe subscription webhooks and registering users

2021.12.02 16:48 reth1nk Stripe subscription webhooks and registering users

So I'm working on my registration / subscription flow. I've got the core of it done but am thinking through some of the implications of how it's setup.
Current flow

  1. User registers via form
  2. Create user account in db
  3. Create session and currently store the user as non subscriber
  4. If user has selected the non free plan, I create the checkout session and redirect to stripe checkout page
  5. User cancels the subscription payment on stripe, redirects back to my cancelled_url and I just redirect to the dashboard where the user is already logged in as a non subscriber
  6. User completes the subscription payment on stripe, redirects back to my success_url, I update the session user preemptively to be a subscriber and redirect to the dashboard to allow for automatic login after registration.
Where I feel like I may run into some issues.
Because there is no reliable way to know based off completion of the checkout page on stripe if a payment is successful, I'm using webhooks and optimistically updating the session.user as a subscriber when redirected back to my success_url. When the webhook comes in, I will be fetching the user and updating the user in db with subscription_id(string) and subscriptionEndAt (timestamp). Which is all fine and dandy because the user is already logged in and because of my optimistic session update, they're marked on client as subscriber. But now what if they webhook comes back and the payment failed, I obviously not going to update the user in db as a subscriber. But the currently logged in user will be marked as a subscriber until the next authentication.

What webhooks from stripe will be the most reliable to use as truth of source of wether the user should be updated in the db as a subscriber? What are some of the ways to mitigate needing to have an optimistic session update to allow automatic login when the user is registering and finishes their subscription payment on stripe?
submitted by reth1nk to webdev [link] [comments]

2021.12.02 16:48 DrgnFyre In 100 years it will be normalized to comment on post of long dead people.

Assuming modern media like Facebook/Meta survive until then, it will be normal to view and comment on post made by said person from so long ago.
submitted by DrgnFyre to Showerthoughts [link] [comments]

2021.12.02 16:48 DAR0ME I seen this guy last night when I beat the game for the first time...then I hop on youtube and see a new trailer and he's in it! You guys got any ideas for names? I was thinking it'll be called "The One" or "The Hoard"

I seen this guy last night when I beat the game for the first time...then I hop on youtube and see a new trailer and he's in it! You guys got any ideas for names? I was thinking it'll be called submitted by DAR0ME to SonsOfTheForest [link] [comments]

2021.12.02 16:48 SixteenTimesTheTodd Praise Todd Howard

Praise The Legendary Game Developer Todd Howard
submitted by SixteenTimesTheTodd to PraiseToddHoward [link] [comments]

2021.12.02 16:48 PhantomPuppetYT I released something from the north pole, and it doesn’t like people.

Few things; my name is Jonathan Henry Fredric and I’m a researcher for the government. I don’t care if I signed the paper or swore that oath, I’m a dead man anyway. I realised something and I’m the last one. I know it’s a bit cliche but it’s true and this thing is not to be messed with. It’s huge, at least 24 feet tall and 15 feet wide at what I can only assume to be it’s shoulders. Let me just start from the beginning. I was hired by the government to do work on things the public couldn’t handle to see like monsters, super humans, and all around abnormalities.

This one was certainly no different; it went the same as any other abnormality, I got a call, I got ready, and we set off. When I got there a home base was already set up and I could see a hole that had to be at least 60 feet in diameter and a lot of equipment was set up around it. We landed and I was greeted by the general of the army. He said something along the lines of “we have a major problem and you're here to study, you’ll be briefed when you get inside.”

Sure enough when I got inside I was met by a man who looked to be in his late 30’s. He told me everything he knew at that point and I’ll list just a few: the hole was at a rough 80 degree drop, the walls have a gravitational pull that is similar to earth so the steep angle will not be a problem, the walls were made of a tungsten-titanium alloy that was nearly impossible to break, the small amount of light appears to be a type of neon light.

I was being sent in with a team of 20; 4 technicians, 3 researchers, 10 marines, 1 equipment specialist, 1 video expert, and me. I was fitted with a harness that connected up to a tow hook and a powerful motor. I was told that if anything were to go wrong, I had to push the button next to my collar bone on my right side. This would cause a signal to be sent to the tow hook so it could pull me back. We were given enough food and supplies to last us all a week and all the researchers and I were given enough paper to cover the entire opening twice over.

I didn’t know exactly what the marines had but I guessed it’s the regular stuff like food, water and the usual. We entered the opening and the change in direction of gravity made me lose my balance but I got it back before I fell and as I waited for the others to do the same I looked down the rest of the hole and I thought I saw something big retreat further into the darkness but I couldn’t tell.

When everyone finally started moving nothing important happened other than losing sight of the entrance, we all thought we had somehow gotten turned around many times but we all eventually decided it was impossible to get turned around without us knowing because we had the tow hook tied to us. It took I don’t know how long to reach the end, we all had watches that told us how long we had been down there but they stopped working at some point. The room we had made it to looked like it was made with the same stuff as the hole itself.

The one difference is the room had to be 80 feet tall and it was too long we couldn’t see the end but just as a guess I said the room looked hexagonal because of the walls we could see but for all we knew it could have been a giant triangle or something like that. We all decided it would be best to keep heading in a line so it would be easier to get pulled out. As we walked we saw nothing other than the plain darkness with the occasional light visible for a quick second and soon we ran into a wall. This was strange in the fact that there was a slightly humanoid shape carved into it.

I would explain to you what it looked like but I don’t have the words to. Just then as we were taking notes, discussing, recording and the like we heard a loud thud next to us when we looked we couldn’t see anything but I was the unfortunate one who looked up but that might have saved my life. What I saw was a head that could be described as boney, ape-like and oddly human-like. It had a hand on the wall and it peered down at us, almost inquisitive. Then it let out this roar that made it feel like I was standing next to a speaker at a concert.

I was about to hit the return button when I grabbed a notebook I was writing in but when I turned back I saw that the marines had started shooting the thing but before any of them could hurt that thing it shot out a type of needle that impaled them and stuck them to the ground. I hit the button still clutching the book and without a thought for anyone else I shot backwards to the hole as I was pulled back to the top I heard the sounds of very quick thuds as if that thing was chasing after me and after a minute of sliding I saw one boney hand land on the wall next to me then on the other side. When I turned on my flashlight I saw that things face not 10 feet from mine.

When the light hit it, the thing recoiled and fled out of the range of my flashlight but it was still chasing me when I finally reached the top the thuds stopped then retreated. As I got up I realized I couldn’t hear and the thudding was just the vibration and my brain filling in the blank. Not thinking about anything else I sat down in the snow and scribbled down what I just saw below the part where I talked about the wall. I then threw it on the table next to the general and walked inside to go to sleep. I then had a thought, if this thing can’t be out in the light when the night half of the year starts there will be no stopping this thing from killing us all.

Now to get to the part where I’m all alone; that thing has been taking pot shots by running up the hole, sticking an arm out and slamming it into the ground then running back down and it’s been doing this every day. We have sent down many different groups. That thing has killed so many that most of the people have died but the ones who haven’t died, left. I’m that last one and I can see the sun starting to set as it reaches that time. I can’t leave because the helicopter is destroyed, the radio is destroyed and even if it wasn’t it doesn’t have any power any more.

I don’t think they care that I’m gone and not coming back but just maybe this will get me away from here so I can warn the right people and if not at least I won’t die from it. I think this is my last night because yesterday it poked its head out and didn’t retreat so as a last ditch effort, please don’t go to the North Pole because whatever’s here certainly isn’t Santa Claus.
submitted by PhantomPuppetYT to nosleep [link] [comments]

2021.12.02 16:48 themanre Lincoln 210 tig help

Has anyone had success running the 210 mp (fully set up for tig) on 110? I believe I am all set up correctly but I can’t seem to keep an arc going. Is it my 110 circuit? I haven’t tried it on 220 yet only because it will require some modifications in the garage.
submitted by themanre to Welding [link] [comments]

2021.12.02 16:48 FabFeline51 Part-time work that pays over minimum wage?

Does this type of work really exist (aside some specialized free-lance stuff)?
I feel like most part-time work is retail/customer service, most of which pays minimum-wage. Thoughts?
submitted by FabFeline51 to PersonalFinanceCanada [link] [comments]

2021.12.02 16:48 WeAreTheChampi0ns Recommendations for Taxi Booking apps in Luxembourg

Moien Luxembourg Redditors. Looking for recommendations for Taxi booking apps with fare estimator. Since we don't have Uber how do we book taxis here?
P.S. I know bus and tram and free and have great service, but sometimes we need a Taxi.
submitted by WeAreTheChampi0ns to Luxembourg [link] [comments]

2021.12.02 16:48 Narrow_Willow_3982 🤞🏽 WHO WANTS AN NFT? 💰 DETAILS IN COMMENT SECTION 💰 UPVOTE ⬆️⬆️⬆️

🤞🏽 WHO WANTS AN NFT? 💰 DETAILS IN COMMENT SECTION 💰 UPVOTE ⬆️⬆️⬆️ submitted by Narrow_Willow_3982 to NFTMarketplaceShop [link] [comments]

2021.12.02 16:48 TheCartoonDweeb Kallin Reviews Every Movie He Owns!!! Trailer

Kallin Reviews Every Movie He Owns!!! Trailer submitted by TheCartoonDweeb to Critics [link] [comments]

2021.12.02 16:48 Jackson1014 There’s no place like home (Madam Tussaud Wax Museum - Los Angeles)

There’s no place like home (Madam Tussaud Wax Museum - Los Angeles) submitted by Jackson1014 to Polaroid [link] [comments]

2021.12.02 16:48 Vihanga_Thathsara Jackfruit Curry, Dried Shrimps Tempered, Thebu Kola Sambol

Jackfruit Curry, Dried Shrimps Tempered, Thebu Kola Sambol submitted by Vihanga_Thathsara to UK_Food [link] [comments]

2021.12.02 16:48 femalemadman How did Heather Dubrow not know her new friend sued her husband?

On the OC premiere, we see heather having lunch with new cast member nicole.
Shannon later spills that years earlier, this nicole had sued terry dubrow.
The implication seems to be that heather is unaware of this. How could that be?
They've been married for over 20yrs, and while i suppose the lawsuit could pre-date their relationship, wouldnt he have mentioned it at some point over the years?
Recap for anyone who missed it!
submitted by femalemadman to realhousewives [link] [comments]

2021.12.02 16:48 SixteenTimesTheTodd Praise Todd Howard

Praise The Legendary Game Developer Todd Howard
submitted by SixteenTimesTheTodd to PraiseToddHoward [link] [comments]

2021.12.02 16:48 Difficult-Pen-4053 Best seed for enchanted sword?

submitted by Difficult-Pen-4053 to Terraria [link] [comments]

2021.12.02 16:48 CobradordelFrac New Mexicans recognize booster shot shortage (misleading title)

New Mexicans recognize booster shot shortage (misleading title) submitted by CobradordelFrac to coronavirusnewmexico [link] [comments]

2021.12.02 16:48 thegrandpriest MSG/Umami quick question

Hi people,
I've been considering adding MSG after so many video experiments I've seen on the internet and I was wondering, how much MSG should I add in my food in order not to exagerate with the quantity.
Should I sprinkle it like salt or is it a different way?
Needless to mention that generally I cook 2 portions of food(600-700g)
submitted by thegrandpriest to AskCulinary [link] [comments]

2021.12.02 16:48 0bsidian New Ender 3 Max: Homing failed printer halted

Hi, just picked up a brand new Ender 3 Max, I triple checked the axis motor cables and end stop cables, they are all plugged in as per instruction manual. However, when I choose auto-home, none of the axes move and it reports "Homing failed! Printer halted please reset." If I choose to move home one axis at a time, none of them move. The Z-axis makes a thump sound but still nothing happens.
Any troubleshooting suggestions? Do I have a dud?
submitted by 0bsidian to Creality [link] [comments]

2021.12.02 16:48 No_Understanding1922 Can’t wait!!!!

Can’t wait!!!! submitted by No_Understanding1922 to deadbydaylight [link] [comments]

2021.12.02 16:48 curiousentrepeneur Labelling requirements for selling ear protection products?

I want to get a product for ear protection manufactured and branded. I was wondering where I could find the requirements for what information needs to be on the box. Particularly, I want to know whether or not I need to include my business address on the box.
Can anyone help?
submitted by curiousentrepeneur to LegalAdviceUK [link] [comments]

2021.12.02 16:48 ab1aze Thought I would post my Current EDH Decks as I am probably going to dissect and rebuild some of them this weekend.

submitted by ab1aze to mtg [link] [comments]

2021.12.02 16:48 tatsujb New Interview : Sanctuary RTS's musician : Phillip Crofts

New Interview : Sanctuary RTS's musician : Phillip Crofts submitted by tatsujb to SanctuaryRTS [link] [comments]

2021.12.02 16:48 5mgchannel IDIOTIC: Switch between dimensions while facing a scene full of bullets ...

IDIOTIC: Switch between dimensions while facing a scene full of bullets ... submitted by 5mgchannel to indiegamedevforum [link] [comments]

2021.12.02 16:48 AlessandroPiccione Samsung Tab S5. É possibile vedere video su TV HDMI ?

Ho un tablet Samsung Tab S5. Ha una presa USB Type-C. Posso connetere il tablet ad un televisore usando un adattatore TypeC-HDMI ? (Vorrei vedere sulla TV filmati youtube). Con il libretto allegato al tablet e online non sono riuscito a capire se é possibile e quindi sono indeciso se comprare l'adattatore o meno. Grazie.
P.S. Ho provato a postare questa tessa domanda, in inglese su samsung ma il post viene automaticamente moderato con un messaggio che dice che domande tecniche e di aiuto DEVONO essere fatte su Discord. Mi viene da piangere.
submitted by AlessandroPiccione to ItalyInformatica [link] [comments]

2021.12.02 16:48 SixteenTimesTheTodd Praise Todd Howard

Praise The Legendary Game Developer Todd Howard
submitted by SixteenTimesTheTodd to PraiseToddHoward [link] [comments]