This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger": "4.0", | |
"info": { | |
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", | |
"version": "1.0.0", | |
"title": "Swagger Petstore", | |
"termsOfService": "http://swagger.io/terms/", | |
"contact": { | |
"email": "[email protected]" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth = NokiaAuth(settings.CONSUMER_KEY, settings.CONSUMER_SECRET) | |
# Create your views here. | |
def index(request): | |
if 'user_id' not in request.session: | |
authorize_url = auth.get_authorize_url(settings.CALLBACK_URL_PROD) | |
return render(request, "index.html", {"authorize_url": authorize_url}) | |
else: | |
return render(request, "success.html", {"message": "Now you can upload your health data..."}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def place_order | |
# Find order by order_id saved in cookie. | |
order = Order.find cookies[:order_id] | |
# Get stripe_token whcih returned from stripe.js | |
token_stripe = params[:order][:token_stripe] | |
# Process payment(Not create subscription now, Subscription1 manually created in Stripe) | |
customer = order.process_payment token_stripe | |
if customer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe id="tweet-button" allowtransparency="true" frameborder="0" scrolling="no" | |
src="http://platform.twitter.com/widgets/tweet_button.html?via=marcus_christie&text=Replace%20Me&count=horizontal" | |
style="width:110px; height:20px;"></iframe> |