Confirming how to use Stripe.net Customer on a plan

Clay Smith

I am new to stripe and have decided to use stripe.net (https://github.com/jaymedavis/stripe.net).

What I want to do is put the customer on a plan that will charge them monthly. I also want to give them the option to cancel their subscription to the plan. Here is the code that the stripe.net project shows to use.

StripeConfiguration.SetApiKey("[your api key here]");

var myCustomer = new StripeCustomerCreateOptions();

// set these properties if it makes you happy
myCustomer.Email = "[email protected]";
myCustomer.Description = "Johnny Tenderloin ([email protected])";

// set these properties if using a card
myCustomer.CardNumber = "4242424242424242";
myCustomer.CardExpirationYear = "2012";
myCustomer.CardExpirationMonth = "10";
myCustomer.CardAddressCountry = "US";            

myCustomer.PlanId = *planId*;                         

var customerService = new StripeCustomerService();
StripeCustomer stripeCustomer = customerService.Create(myCustomer);

Is this all I have to do to put the customer on a plan that charges them monthly? and to cancel the plan...

var customerService = new StripeCustomerService();
StripeSubscription subscription = customerService.CancelSubscription(*customerId*);

Is this all I have to do? There is also a section on the stripe.net page for creating a charge and I'm not sure if I have to do anything with that.

colinm

Yep, that's it. Were you expecting something more painful based on past experience? ;)

The Stripe API is designed to be really easy to use, and most of the available libraries (including Stripe.net) strive to maintain that.

You don't have to do anything with charges. If you need to bill a customer for some one-off thing, like a hat maybe, that's what a charge is for. Plans take care of themselves.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to credit customer with stripe

From Dev

Method for confirming Stripe payment

From Dev

How to Apply a Coupon to a Stripe Customer

From Dev

Stripe Ruby - Find existing customer by ID and add a plan

From Dev

How to set up Stripe Plan to bill quarterly using Stripe.Net

From Dev

How can I use Stripe to delay charging a customer until a physical item is shipped?

From Dev

How to create a customer in omnipay-stripe

From Dev

How to create a charge and a customer in Stripe (Rails)

From Dev

How to save customer card updates in Stripe, Rails?

From Dev

How to update customer default paymentMethod in Stripe?

From Dev

How to send Stripe customer ID to Parse

From Dev

How to create STRIPE customer using STRIPE API in IOS?

From Dev

How to create STRIPE customer using STRIPE API in IOS?

From Dev

How to retrieve the stripe customer id from the stripe object after creation of the customer

From Dev

Fatal error: Cannot use object of type Stripe\Customer as array

From Dev

How to implement multiple plan in rails with stripe checkout

From Dev

How to create both a customer and a card in a single action with Stripe?

From Dev

How to parse Stripe JSON response after Customer.create?

From Dev

How to charge a particular card on a customer with Stripe.com

From Dev

On Stripe, how can I link existing credit card to new customer?

From Dev

How do i get charge info from customer object in stripe

From Dev

Stripe - check if a customer exists

From Dev

Create Stripe Customer in Swift

From Dev

Card not saving for a Stripe Customer

From Dev

Stripe create customer iOS

From Dev

Stripe Checkout and Customer Creation

From Dev

Subscribe customer for some plan

From Dev

How to save changes by confirming password

From Dev

How to perform an automatic login after confirming the account with ASP.NET Identity

Related Related

  1. 1

    How to credit customer with stripe

  2. 2

    Method for confirming Stripe payment

  3. 3

    How to Apply a Coupon to a Stripe Customer

  4. 4

    Stripe Ruby - Find existing customer by ID and add a plan

  5. 5

    How to set up Stripe Plan to bill quarterly using Stripe.Net

  6. 6

    How can I use Stripe to delay charging a customer until a physical item is shipped?

  7. 7

    How to create a customer in omnipay-stripe

  8. 8

    How to create a charge and a customer in Stripe (Rails)

  9. 9

    How to save customer card updates in Stripe, Rails?

  10. 10

    How to update customer default paymentMethod in Stripe?

  11. 11

    How to send Stripe customer ID to Parse

  12. 12

    How to create STRIPE customer using STRIPE API in IOS?

  13. 13

    How to create STRIPE customer using STRIPE API in IOS?

  14. 14

    How to retrieve the stripe customer id from the stripe object after creation of the customer

  15. 15

    Fatal error: Cannot use object of type Stripe\Customer as array

  16. 16

    How to implement multiple plan in rails with stripe checkout

  17. 17

    How to create both a customer and a card in a single action with Stripe?

  18. 18

    How to parse Stripe JSON response after Customer.create?

  19. 19

    How to charge a particular card on a customer with Stripe.com

  20. 20

    On Stripe, how can I link existing credit card to new customer?

  21. 21

    How do i get charge info from customer object in stripe

  22. 22

    Stripe - check if a customer exists

  23. 23

    Create Stripe Customer in Swift

  24. 24

    Card not saving for a Stripe Customer

  25. 25

    Stripe create customer iOS

  26. 26

    Stripe Checkout and Customer Creation

  27. 27

    Subscribe customer for some plan

  28. 28

    How to save changes by confirming password

  29. 29

    How to perform an automatic login after confirming the account with ASP.NET Identity

HotTag

Archive