Pay in installments

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] these are unprecedented times businesses are responding quickly to these new circumstances and at stripe our priority is to help you serve your customers and keep your payments infrastructure operating reliably so we're working quickly to add new features that will help you take action and one of the ways you might consider serving your customers is to offer installment plans for some of these larger purchases so you can achieve this using subscriptions and today I'm excited to share with you how I might approach this so in today's demo we'll build in SCA ready paint flow for collecting a large payment over time in installments using a subscription that will automatically cancel once the iterations of a payment are complete so as an agenda for today first we're gonna create a bunch of plans for our subscription that then will go set up the payment details in an SCA ready way and then we'll create a customer in the actual payment plan by way of a subscription and then finally we'll use web hooks to fulfill an order now in today's demo we're just going to be using a simple installment plan where each installment is the same amount and if you want to be if you want to take a more complex approach or more advanced approach you might want to look at subscription schedules that allow you to define different phases so you could take for example 50% of the payment up front and then 10% of the payment after that in monthly installments so you can you have a little bit more control over the phases but in today's demo we're just going to start really simply with we have some big amount that we want to break up into set number of months and what we'll use a subscription that is going to charge every month for a fixed amount and that's how we'll achieve our installments welcome back to stripe developer office hours this is the demo that we're going to go over today so we have a pay in installments where we're gonna buy this bike and the user can enter their email address here and then pick the number of months that they want the installments to the month the number of months that they want to pay over so in this case they'll break up the payment three hundred dollars across two months and then they'll enter their card number and then click pay and we'll see that they are able to create a customer and schedule that subscription and we see that the subscription was created and it will be they'll be charged immediately one hundred fifty dollars and then next month they'll be charged another $150 and then we'll kind of send them the goods so this is what we're gonna do today I'm CJ a villa a developer support engineer let's jump into the code so I'm gonna remove the code that we used for the demo for the initial demo and we'll start over so we're gonna start from scratch we're gonna use the stripe sample called developer office hours stripe samples create developer office hours I'm using the stripe CLI to install a sample if you're unfamiliar with the stripe CLI we have another episode about how to use that and if you're unfamiliar with the boilerplate for the node example we also have an episode about how we get from zero to this this starter code I'm gonna jump into developer office hours I'm gonna copy that bike PNG into our client because we'll use that as our as part of our demo so in most office hours demos we write the JavaScript directly in the index of HTML today we're going to be doing that in a store GS file just so we have a little bit more because we have quite a bit of JavaScript we're gonna write on the client I wanted to break that out into a separate file and then on the server will just write our code in this server das file so before we write any code though I wanted to go walk through the process of setting up some some plans so let's go to the stripe dashboard and in test mode here under products I'm going to create a new product called bike let's say yeah fancy bike fancy bike and it is a recurring product fancy bike and what I want to do is in the unit label I'm actually going to call this an installment so that it shows up as an installment every month that they pay it will show as an installment on the sort of invoice that we're creating so we'll continue we have our product name in our unit label and then we want to create a bunch of plans so for when we're paying in a single installment that will be a one month plan and we want to charge the entire amount for the bike so let's say that our bike costs $3,000 so we'll call fancy bike one this is if they pay in one single installment and the the total cost will be $3,000 very fancy bike $3,000 per installment and this is if they're paying in one single installment so I will create that pricing plan let's add another pricing plan fancy bike to this is if they pay in two installments so this would be $1,500 per installment its per month we want this to be recurring and the idea here will be fancy bike too technically you don't need to set the ID of the plan I'm gonna do this just for demonstration purposes so you can see would it see the plan IDs if you leave the plan ID blank then you will be assigned a plan ID and it'll look like plan underscore and then some random string so I'm adding the pricing plan for the two payment installments so fancy bike too and then we'll also add one for fancy bike three where we pay in three installments and if we pay in three installments then each installment is $1,000 so we'll add that pricing plan and this is really how we can add you can continue to add as you may imagine more more plans to pay in more installments as you kind of break out the total cost of the bike across multiple multiple different installments so when we define the plan we don't actually say how long the plan lasts so we're just saying that this this plan is a monthly plan and we're going to subscribe to that monthly plan and we need to make sure that when we create the subscription we're canceling at the right date so that we only take three payments so subscriptions when we create them they have an argument that we can pass called cancel at that allows us to cancel the subscription at a specific date so we can pass this cancel at option with the proration behavior and so one thing that I want to talk about with the preparation behavior is this will only cause preparation if the cancel at is before the period end so by default proration behavior is not being modified when we're setting cancel at that is outside of the current period so if we if we're canceling in three months from now then setting the proration behavior right now does not actually apply to the subscription the proration behavior will only apply if we're sending the cancel at in say 15 days from now if we have a monthly subscription so yeah so we want to do cancel at as the way to set when we're going to end the subscription so we have our we have our three plans created let's go back into the code and we're gonna start by implementing this page here which now does not exist so okay so in our index dot HTML we're gonna say pay in installments and this is going to be for three thousand dollars and we want our our image of our bike and we're gonna style that because it's naturally too big to 200 pixels okay yay CSS okay and then as part of our our form element here we need a couple of things we want to collect we want to collect the email address the number of installments and then the card details the payment details so let's add some form fields for those email is gonna be an email input and the default value here is Jenny Rosen at example.com obviously you wouldn't leave in a default value in the the email input field but it makes it really helpful for testing so you don't have to go enter an email every single time okay let's add another field here for the installments and these are gonna be monthly and we're gonna use a select box for this and it's going to be called installments input option one option two option three and great so you could if you didn't want to use a select box you could use a number input with steps and then do some validation I'm using select just because it's a little bit easier to constrain the options that they have you might also use radio buttons or some other some other control to collect the number for installments okay next we want to add a card input so this is going to be the the card input that you'll enter your credit card details and we're going to mount this with stripe elements we're gonna use stripe elements to create a card number input field that'll have the the field for the number the expiry and zip code etc so here I just want to create a field that has the card and there's actually it's actually not an input we're going to use a div with an ID of card in the class of field just to keep it nice and pretty and then we're gonna need to mount this card element with stripe elements so before we go beyond that now we need a button to click and we'll just say the ID is pay and we'll call the the text of the button pay now here at the bottom of our HTML right before the closing body tag I mean I'm going to include stripe j/s and I'm also going to include our door Jes that we're we're gonna use to implement our client-side JavaScript okay so this is really how how the page looks when we and we can fire up our server by saying node R NPM install and then node server to run to run the server-side code and because we're starting with that boilerplate we already have a way to return the index at HTML and so this is what we're starting with this is the the starting our starting point so let's talk through kind of what we need to do so first we we noticed that the card element isn't you can't actually interact with this yet that's because we haven't set up stripe elements or mounted the card element next we need a way to collect the card payment details in an SCA ready way and so today what we're gonna do is use a setup intent which allows us to gain permission to charge a card later and this is most useful when you're in the EU but is something that you can use globally and if you do not require authentication then it's kind of just a pass-through so we're gonna use the setup intent construct in order to gain permission to charge the customers card later so the way that works is we need to make an API request to stripe to create the setup intent and then when we're when we receive the setup intent back from stripe we can use the client secret related to that setup intent to authenticate the card details and setup the card and once the card is set up we can attach it to a customer and reuse that payment method later so we're gonna the first thing we need to do is create a setup intent return it to the client mount the card and then when we click pay we're going to confirm the card payment which will you know open an authentication modal if required otherwise it will will receive the payment method that was tokenized on the client and we'll pass the email address the installments and the new payment method from the client back to our server and use those to create a customer and then create a subscription so the customer we need to create a customer in order to reuse the payment method and we need to create a subscription to control when we're collecting these installments so let's go over to the server and first create a route that we can use to make a setup intent so we'll go over to the server and we'll add a new get route here called set up in tents that will create a new set up in tent and return just return the the JSON for that set up intent so we want to say something like Const set up in tent is a weight stripe dot set up in tents dot create and we need to pass in a couple things so first we want to tell it which payment method types we support and we're gonna support just card types today so let's see looks like this if you want to support other payment method types you could pass those in that list and then we want to say usage is off session this means that we're going to charge the card later when the customer is not on our website and we're gonna return all of the JSON for this setup intent just like that so now when we make a get request to slash setup intents we should return the JSON for the setup intent so we'll restart the server and we'll just try this out with curl and we get back the JSON for the setup intent that looks great let's pass it to JQ to make it pretty and we see this client secret is this Sethi underscore with the secret that's what we need to use on the client when we call confirm card setup and pass in our card element on the client so now that we've got a setup intent we can pass this to the client and use this special client secret value in order to confirm the cards setup ok so that is looking good let's go back to the client so in store J s we need to initialize an instance of stripe we need to initialize an instance of elements create a card element and then mount it to that card div that we just that we defined in the HTML next we need to fetch the setup intent from the server and store the client secret related to that setup intent so that we can use it later when we confirm card setup so I'm gonna say setup intent secret here and I'm going to use the result of the so the data that we get back here is going to be the JSON for the setup intent and that will have a client secret attribute now so we're gonna say setup intent secret equals data client secret all right so that is looking good I also want to add just a debug function here so that we can print out some messages to to the page as we're working through it so in our index dot HTML let's add a debug message here at the bottom right under the button debug message okay all right so now we can say things like debug we're creating the setup intent and then when the setup intent is finally created we can say setup intent created and we can also maybe print out the setup intent secret all right so that should work great and let's let's just go check and make sure that that's working so I'm going to use the chrome tube debugger or the chrome dev tools by saying right-click and inspect or you can use command option I to crack open these dev tools now I need to go to the store jas implementation and I need to refresh the page because we just updated store j s the definition of store j s and the first thing i noticed is that there's an error here and it looks like i spelt setup intense wrong setup in tents ok so refresh again and it looks like that is working now ok and we see in the in the log here that we just added this debug in this debug pane we see we're creating a setup in tent setup intent was created we see the secret that's all fantastic the next step is to listen for the click on this button oh you'll also notice that the the card element is now mounted so we see the placeholders there and we could enter you know some card details here so the next the next thing to do is listen for click on this button and when the button is clicked we want to confirm the card setup using this client secret so let's grab reference to a number of things so we want to say we want reference to the button which is its ideas pay we want reference to the email input and we want reference to the installments input and we need reference to I think that's it actually let's see so we've got the email we've got the installments we've got reference to the card and now the submit button ok cool so now we want to say when the pay button is clicked we want to confirm card setup so the way we do that is we say const confirmation is a wait stripe dot confirm card setup and we pass in the first argument is the client secret that we just fetched from the server and then the second argument is this options block where we need to pass in the card which is going to be the stripe element that refers to the cards we're going to pass the card element here the second is we can pass some billing details and since we're collecting the email address we might as well pass that here so we can say email input value so that should confirm the card setup so let's add some more debugging confirming card setup and then we can say a confirmed card setup now if confirmation so this confirmation the value of confirmation is going to be either an object that has an error property that tells us why we weren't able to confirm the card setup or it will be an object that has a setup intent attached in that setup intent will now have a payment method so just in terms of like doing a little bit of error handling we can say if confirmation dot error then we want to debug like confirmation of card details failed and we can just print out the entire confirmation directly into that the debug statement and we also want to probably return early just so that we don't continue taking any other actions so we're gonna let's go see if this is working as expected so we'll go back to the browser refresh the page and then we can click on a number line in the gutter here to see what's happening so if we don't enter any card number and we go into the click handler or we're noticing that the click handler is collect Lee registered on the pay button so we said pay button add eventlistener click and it says when the button the pay button is clicked then run this function so we are correctly handling the click of the button and we're entering this callback and so we're saying prevent the default so that we don't bubble up and do a full page reload or submit the form directly so we want to handle some of this stuff in JavaScript so we're saying prevent default then we're going to print out this debug statement and now we're going to try to confirm the card setup by passing the client secret which looks correct we're also passing the card element that looks good and the email input value which was correctly Jenny Rosen it at example.com but the problem is that the card element wasn't populated so I expect that confirmation is going to have an error so we push play here we'll see that confirmation does have an error it says you know invalid request error received unknown params card and billing details that is confirmed card setup hmm yeah it's an interesting error because we didn't actually pass it anything so let's let's see what happens if we if we enter some details here if we enter the card but we don't fill out the expiry then we're gonna come in here and say received unknown params card billing details huh oh you know what okay this is perfect I made a mistake so these card and billing details are actually nested under payment method so it's great that we're inspecting this error because this is really incorrect payment method is an object that has these things the card in the billing details alright so refresh the page our debugger should stay where it was yep so we've got we still got our breakpoint there let's try clicking play again now our error will say incomplete number great so the your card number is incomplete this is the error that we really want this was so there was no card number typed in so we are going to push play and I'll say you know confirmation of card details failed and we get the whole output here of of the error response okay so the card number was incomplete let's try it now with a complete card number so we type in a the full card number and we hit play and we confirm card set up and we confirmed card set up let's also like you to add the breakpoint there refresh the page and see what this looks like because I want to show you that the setup intent in the confirmation will have the payment method so confirmation is returned now it has an object called setup intent there is no error but inside of the setup intent we have payment method which is this p.m. underscore and then a random string that's the payment method so that that is the ID the the token so p.m. 1 GT blah blah blah refers to the card details that were entered so this is the the ID that we're going to use from now on to refer to those payment details and also this was this was setup in an SCA ready way so if we were to refresh the page and try one of the regulatory test cards 3 155 for instance when we hit pay we get this authentication modal that pops up and asks us to go through 3d secure authentication in in live mode this would be the bank's authentication page if required by the the issuer of the card and so we can say a complete authentication now in reality it might be you know a page that requires a one-time pin that was texted to the user or a one-time pin that was emailed to the user they might have to take some action here in test mode we just have a button that says complete card card complete card authentication so at the end of all of this we have a tokenized payment method that we can then use to to charge the customer so what we want to do is pass this payment method the number of installments and the email back to the server to actually set up the customer and subscription so let's do that next so on the server we're gonna add a new route this is gonna be a post route that receives a post request to the BI endpoint and first we need to create a customer and then we want to create a subscription and we're gonna return the subscription at the end okay so we're gonna say let customer and subscription and we're gonna use the try/catch block here and we're gonna say if there was an error will console dot log the error otherwise we and also yeah we want to return res status for - - and maybe JSON is message like failed to create customer and the details of the error will just send back the whole error object e and then we want to create the customer so that's going to look like this customer equals a wait stripe duck customers create we're gonna pass in some arguments so we have the email address it's gonna pass the email wreck body email we have the payment method payment method is wrecked by a payment method okay so this will attach the payment method to the customer so that we can use it with this customer to make charges I'm also going to specify the payment method under invoice settings default payment method and the reason we do that is that we we want to use this payment method for the subscription that we're about to create with yeah with the payment method instrument for or the payment method abstraction for making payments we need to either specify the payment method and customer ID directly when making a payment intent or we need to explicitly specify the payment method in most cases the one case that we have the ability to set a customer Y default is for billing and so we can set that under invoice settings so I'm I'm gonna pass that here also so in voice settings default payment method is a wreck body payment method okay so that's going to create our customer if it fails its we're going to console.log let's also console.log creating customer and then we will blog that we created created customer and then we'll also let's just print their ID customer ID just so we have reference of that next we're gonna create a subscription similar try-catch situation here we're in fact just going to use all the same stuff with a new message failed to create subscription and the subscription is created like this subscription equals a weight striped subscriptions dot create and then we pass in all the arguments for creating a subscription okay so here what we want to do is pass the customer we want to pass plans which is going to be i'm sorry not plans items which is the plan and we need to figure out which plan we want to use depending on the iterations they gave us so i'm gonna create a dictionary of or just to maybe an array of plans that will we can index into with the installments that were passed so rec body dot installments I believe that's what we called it let's check store oh we haven't actually made this fetch request yet okay so we need to pass the customer we need to pass the plan quantity for now we're just gonna allow them to purchase one bike at a time but if you wanted to allow them to purchase multiple bikes on installment plans you might also collect the quantity meaning how many bikes they want to buy from the client passing that down to the server and specifying that here the next thing we need to do is set a cancel at and here we need to figure out what is what is like n months into the future when we want to cancel so we need to figure out what is that what is the UNIX timestamp that is the number of installments in months in the future that we want to cancel that so let's write a method here called like get our like months from now and we'll pass in the the number that we were retrieved on the front end for the number of installments and so we'll define this function that will take some number in return a UNIX timestamp for the time from now that we want to cancel so let's say let's just define this up here so we're gonna say something like cons months from now is a new function that takes in n and it will return let's see so we need to create a new date VAR d equals new date so that's a new javascript date object now if we say something like D dot set month two-digit month plus n that will give us back a the time in milliseconds I believe so we want to take this time in milliseconds and divide this because it's in milliseconds we want in seconds when divided by a thousand and then we also because we're dividing we're gonna get back a floating-point number so we want to go math dot floor probably so something roughly like this should give us the timestamp for n months from now I believe okay so let's for fun let's just test this out so let's try let's try this so we'll copy that code and then we can just paste it in the console in the JavaScript console in our browser so months from now is a new function and let's just make sure this works so months from now let's say what is uhm four months from now we get back this timestamp also today is April 3rd 2020 so if I used this shortcut so four months from now is August third that looks correct and that's roughly yep that's exactly the right time so four months from now now what's what if we wanted to use this for like twenty four months from now let's see if that works so twenty four months from now would be yep 2022 August third so that is also looking correct so we've got we've got a little helper function that will give us the UNIX timestamp for some number of months from now so we can use that function again here in our cancel out so we are creating a new subscription we're passing in the ID of the customer we're passing in when we want this to cancel and we are passing in plans and again we haven't actually defined this we need to we need to define this this plans constant which is going to just be I'm gonna make it just a super simple so we'll make it a list where the first element is null because we don't have any zero month plans and then we'll say what was our what was our plan names here our plan IDs so back over here fancy bike - and then the number so let's see two and one so if they pay in one installment we use this plan they pay in two installments we use this plan three installments we use this plan and again you could add as many as you wanted here and then we're gonna key into the plans array with the number of installments that we got back so if they are gonna pay in two installments then we're gonna use index two which will return this plan ID okay so we are now creating a subscription and passing in those items and plans okay so this should I believe this should work I think we're ready to go test we will see so let's also before we go too far let's add some more logging creating a subscription and then created subscription and then the ID subscription ID okay restart our server and let's head oh you know what we haven't actually like used this from the client yet so we need to go to the client and implement the rest of our button click handler so now we have we have our confirmation which includes the setup intent with its payment method and now down here we need to create customer and subscription okay so we're gonna make a post request back to our server and that's going to go to slash buy and we need to pass the email address so email it's gonna be e-mail input value we need to pass the installments which is going to be installments dot value and we need to pass the payment method which is going to be available in confirmation dot setup intent dot payment method i believe okay so the thing about installment value though is because we're using a select input here we're using this select box the values are actually going to be string values for one two and three because we are hard coding those and we're confident that those are actually integers I'm gonna just use parse int here and pass in that string value with base ten just to make sure that we are passing an integer value back to the server and we're just constantly working with with integers now from now on okay let's see so I think we're ready to test things move this debug statement in here all right let's see let's take it for a take it for a spin so we're gonna refresh this page and let's pick a number of installments three and then our card number is going to be four - four - just to start and then we'll click pay so we're confirming card setup creating customer and subscription and we got an error so the nice thing about having the chrome console open as you're playing around these things is you'll see the errors just pop up in the console directly and you can see this kind of like big red X over here with the warning signs so creating customer and subscription we got to that point and then it failed and down here it says uncaught reference error installments is not defined I think I called it installment inputs installments yeah installments input input okay so let's try this again refresh the page enter our four two four two card and click pay confirming card setup creating customer and subscription takes a little second created sub and the customer so now we have a subscription ID and we said one installment so let's go to our dashboard and pull up this subscription we'll go to building subscriptions and this does this ID match it does ok alright so we've got our new subscription it cancels May 3rd that's fine because we just took payment for the full price of the bike three thousand dollars and it's going to cancel on on May third and we will not be collecting another payment because this was just in one installment May third is when the subscription cancels but we're not actually going to take payment on May 3rd because we took payment for that one month on April 3rd so May 3rd is one full cycle out but that's ok because we already took payment for the full price of the subscription here with so we have one full payment of three thousand dollars that was successful we have an invoice here it's marked as paid and we are looking good you also notice that there is no upcoming invoice so that means that this this customer and the subscription is going to end and we we are not going to charge the customer again all right let's try another subscription now maybe with installments let's do three installments and we'll try our SCA friendly card so we click pay it prompts us for authentication we click complete authentication and we're creating the customer and subscription and we got back the subscription everything is looking great another way we can confirm when this is going to end is we can grab this cancel at timestamp and then use DF to inspect and make sure that the date time is what we expect so here July 3rd so in three installments we're going to take the first on April 3rd the second on May 3rd and the third on June 3rd and then this will cancel on July 3rd so that is also looking great so we'll grab the subscription ID and then rather than searching I'm just going to change the ID in the URL here to subscription with h1 bla bla bla so let's see so something you'll notice on the subscription is that it's marked as incomplete so incomplete means that this subscription requires some more actions so if we look at the response that we got from creating the subscription we can see that the status is incomplete and that usually means that there's some further action that we have to take now I suspect this is because we created the subscription without telling it that it's off session so let's go take a look back at our the way that we're creating the subscription here so back down to subscription create and we need to pass one more argument here so in order to tell the subscription that it's going to cycle off session and it needs to use the permission that we that we got with the setup intent we have to say off session true and this will make it so that we can use the mandate or the the permission that we received from the setup intent when cycling this subscription so let's go try that again with the esier card again [Music] note server startup our server again and restart and type in our SCA card ok let's try this again three months with the SCA card we pop the modal we confirm authentication and now we're looking for the status of the subscription to be active so if we go back to them to the bottom we see the status of the subscription returned now is active instead of incomplete so let's go take a look at this in the dress in the dashboard again I'm just going to update the ID in the URL to our new subscription we just created and in this case we see that we are we have an active subscription it's not incomplete we did take payment so the payment was successful and it's paid here and this was correctly $1000 we're gonna take 1000 may 3rd or I'm sorry 1000 today April 3rd 1000 - month April May 3rd and then we're gonna take 1000 in June 3rd and then this will cancel on July 3rd this subscription will cancel on July 3rd and that will be the end of the installments required for collecting the 3000 dollars for this very fancy bike so yeah that that concludes the demo for actually creating payment let's go into how we might fulfill the payment and just talk briefly about how we can use web hooks the stripe web hooks to do that so here at the bottom of the file as part of the boilerplate we include a route for handling web hooks so this receives a post request to slash web hook we have another episode that's all about web hooks if you're curious about how these work I would recommend going and checking that out so here what we want to do is switch on the event type and so we're going to receive event notifications of a bunch of different types and in this case we likely want to fulfill purchase on the payment intent succeeding or the the invoice payment succeeding when we first cycle payment so that you know oftentimes when you're receiving payments in installments for a large purchase as soon as you receive that first the first payment then you send out your goods so here we might say something like invoice dot payment succeeded and then we want to do like you know send goods we likely also want to send an email thanking the customer for payment here we might also like make API calls to the inventory management system we might also post in slack or you know take other actions to automate the fulfillment of this purchase we want to do those as part of the webhook because if for some reason we like the alternative is to use the clients browser when they make a post request to us to or you know the on the successful payment of this subscription here the successful setup of the subscription here to take some action to star fulfillment but it's it's much more reliable to set up your fulfillment based on the web hook because those are requests that are coming directly from stripe they're post requests and stripe is gonna if for some reason the web hook handler fails stripe will retry those web hook requests up to three days with exponential back-off so there's a lot more reliability and depending on stripe sending you information in the web hook rather than depending on the client being you know constantly connected so this is likely how you would fulfill the purchases by adding a web hook handler here I want to show you one more thing so in order to get at the invoice that's sent to us we can say invoice is equal to event data object and just for demonstration will console.log you know fulfilling purchase for and then the invoice ID okay so again we'll use stripe CLI to to test this out okay so I'm going to use stripe listen for word two for two for two slash webhook so that'll fire up a stripe listener this makes a direct connection between stripe in your local machine so that when events happen on your account they're forwarded directly to your local webhook handler and then in this pane I can I can say stripe trigger and then the event type that we just implemented our webhook handler for so this is going to be invoiced stop payment succeeded and whoops that's not it's Addie at the end okay so this is gonna set up a bunch of fixtures and make API requests in the background that will result in an invoice up payments exceeded event happening so you can see that as part of stripe trigger it's making a whole bunch of different requests because we need a few different objects in order to get into the invoice payments exceeded event so in the server log we see that a bunch of these are firing and we do see that at least one of them was our invoice payment succeeding and so in the server so this is sorry this was a listener this is the log for the stripe lesson and this is the log for our server so here in the top left we see fulfilling purchase for this invoice and that's the invoice that we triggered with or that was created as a result of stripe trigger invoice payment being succeeded so let's now that we have that set up and that seems to be working well let's see here and start up the server forward we were I killed the listener that which forms the direct connection between stripe and our our local local machine so we've restarted the server reset up the listener alright let's try this again so refresh the page two installments pay okay now let's watch our server log okay so we're seeing some events come through we created the subscription and the next thing we're looking for is that we are fulfilling the purchase fantastic so that is now firing as expected so we fulfilled the purchase for that invoice and that is great that's exactly what we are looking for that's exactly what we wanted so that is the end of today's demo again I really hope this is helpful for for our users and for you as a developer trying to implement solutions to respond to this odd scenario with COBIT 19 more resources are available if you go to stripe comm slash Kobo - 19 we are trying our best to add new features and really empower you to respond and serve your customers and serve their needs as best as possible we're always happy to help if you want to reach out we're available at support dot stripe comm and also on the the free node IRC Network in the stripe Channel we would always be happy to help chat through any developer questions that you may have also if you haven't already we have a Developer digest that you can add yourself to the list by going to most docs pages and at the very bottom there is an email input and then finally we do have thick-skinned we really want to improve these episodes so if you have any feedback at all for us please let us know in the feedback forum in the description below alright friends until next time you
Info
Channel: Stripe Developers
Views: 5,847
Rating: undefined out of 5
Keywords: stripe, payments, subscription, installments, node.js, express, stripe-node
Id: YBSBcjyKWWU
Channel Id: undefined
Length: 46min 31sec (2791 seconds)
Published: Mon Apr 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.