O'Reilly logo

Take My Money by Noel Rappin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Purchasing a Subscription

The workflow for purchasing a subscription is similar to purchasing an individual item, but there are also differences. On the client page, the user selects a subscription plan and enters his or her credit card information. As before, our application contacts Stripe from the client browser before the form is submitted and we receive a token. Also as before, we take that token and send it back to our server when the credit card form is finished.

From this point on, the server-side logic for a subscription purchase differs. Instead of sending a Stripe Purchase object to Stripe, a Customer object is created and associated with the token, which represents the payment method and our user. Now the subscription transaction ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required