Skip to content

Instantly share code, notes, and snippets.

@keikubo
Last active December 15, 2015 00:49
Show Gist options
  • Save keikubo/5175269 to your computer and use it in GitHub Desktop.
Save keikubo/5175269 to your computer and use it in GitHub Desktop.
>>> customer = stripe.Customer.create(
... card="tok_1SxLsd4YtToozX")
>>> plan = stripe.Plan.create(
... amount=2000,
... interval='month',
... name='Amazing Gold Plan',
... currency='usd',
... id='gold')
>>> customer.update_subscription(
... plan="gold")
>>> import stripe
>>> stripe.api_key = "sample_test_api_key"
>>> stripe.api_base = "https://api.webpay.jp"
>>> stripe.Charge.create(
... amount=400,
... currency="jpy",
... card={
... "number": '4242424242424242',
... "exp_month": '12',
... "exp_year": '2014',
... "cvc": '123'
... }
... )
>>> customer = stripe.Customer.create(
... card="tok_1SxLsd4YtToozX")
>>> plan = stripe.Plan.create(
... amount=2000,
... interval='month',
... name='Amazing Gold Plan',
... currency='jpy',
... id='gold')
>>> customer.update_subscription(
... plan="gold")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment