Subscriptions with coupons

Share it with your friends Like

Thanks! Share it with your friends!

Close

In this edition of Stripe Developer Office Hours, follow along as Ali Riaz builds a create Subscription flow with optional coupon.

## Resources
Official guide: https://stripe.com/docs/billing/subscriptions/discounts
Demo repo: https://github.com/stripe-samples/developer-office-hours/tree/master/2020-04-13-coupons-and-subscriptions

## Presenter
Ali Riaz, Developer Support Engineer @ Stripe – https://www.linkedin.com/in/syedaliriaz/ https://twitter.com/alilahriaz

## Table of contents

00:05 Introduction
01:40 Install starter boilerplate
04:08 Setup client-side
09:45 Collect payment details on client-side
17:45 Add server route to create subscription
21:38 Create product and price in the dashboard
26:32 Setup success page with coupon entry
32:34 Create coupons in the dashboard
37:00 Collect coupon on client-side
39:54 Update server to apply coupon to new subscription

If you have a question, please feel free to reach out to our support team at https://support.stripe.com/ or join us on Freenode IRC in #stripe.

What would you like to see in future episodes? https://docs.google.com/forms/d/e/1FAIpQLScx_BtXcakIJ_EFso-4-fnCrTVFXxsh-5BPM-SdhNG6W7kzbw/viewform?usp=sf_link

#Stripe #Subscriptions #Coupons

Comments

Amine Laglil says:

Why two button ??, one to validate the coupon code and the other for subscribe , we cannot do both in a single subscribe button ?

Alexander Rusa says:

could it be, that this video is from april 2020 and already outdated in september 2020? when i follow it i get "This customer has no attached payment source or default payment method." and according to the documentation i should use SetupIntent…

Christian L says:

Great vid, would be great to show Stripe Elements integration with React and Node/Express

Kim Doyle says:

I need to speak with you privately. We want to do something like this.

Deepinder Singh says:

hello i am getting an error , i am using php code

$payment_intent = StripePaymentIntent::create([

"description" => "Donation Money",

'shipping' => [

'name' => $first_name,

'address' => [

'line1' => $address_1,

'postal_code' => $postal_code,

'city' => $city,

'state' => $state,

'country' => $country

]

],

"amount" => $amount."00",

"currency" => "usd",

"payment_method" => ['type'=>"card"],

]);

and i am getting

{

"description": "Donation Money",

"shipping": {

"name": "XXXXXXXXXXXXXXXXXXXXx",

"address": {

"line1": "XXXXXXXXXXXXXXXXXXXXx",

"postal_code": "XXXXXXXXXXXXXXXXXXXXx",

"city": "XXXXXXXXXXXXXXXXXXXXx",

"state": "XXXXXXXXXXXXXXXXXXXXx",

"country": "XXXXXXXXXXXXXXXXXXXXx"

}

},

"amount": "1100",

"currency": "usd",

"payment_method_types": {

"0": "card"
/////////////////////////// i am getting error here i dont know why i am getting 0 here and where it is come from
}

}

plz plzplzplzplzplzpzl help me mate

Jorge Apodaca says:

Could we create STRIPE trial subscriptions without requesting from the user the payment information? and how to do that? is there an example of that scenario? thanks in advance…

Тatjana Riet says:

Could you give some examples in django please. Thanks in advance.

Write a comment

*