Browse Source

include link to access paypal api example

mk200789 10 years ago
parent
commit
0e5f5b5f19

+ 1 - 0
hackathon_starter/hackathon/scripts/paypal.py

@@ -51,6 +51,7 @@ class PaypalOauthClient(object):
 		'''
 
 		auth_url = authorization_url + self.client_id + '&response_type=code&scope=openid&redirect_uri=http://localhost:8000/hackathon/paypal/'
+		print auth_url
 		return auth_url
 
 

+ 2 - 2
hackathon_starter/hackathon/templates/hackathon/api_examples.html

@@ -11,8 +11,8 @@
 			<div class="col-sm-4"><a href="http://127.0.0.1:8000/hackathon/linkedin/">LinkedIn Example</a></div>
 		-->
 		<div class="col-sm-4"><a href="http://127.0.0.1:8000/hackathon/twilio/">Twilio Example</a></div>
-		<div class="col-sm-4"><a href="{{instagram_url}}">Instagram Example
-		</a></div>
+		<div class="col-sm-4"><a href="{{instagram_url}}">Instagram Example</a></div>
+		<div class="col-sm-4"><a href="{{paypal_url}}">Paypal Example</a></div>
 		<div class="col-sm-4"><a href="http://localhost:8000/hackathon/quandlstocks/">Quandl Example</a></div>
 
   	</div>

+ 3 - 1
hackathon_starter/hackathon/views.py

@@ -47,12 +47,13 @@ def index(request):
 
 def api_examples(request):
     instagram_url =getInstagram.get_authorize_url()
+    paypal_url = getPaypal.get_authorize_url()
     if not getTumblr.accessed:
         obtain_oauth_verifier = getTumblr.authorize_url()
     else:
         obtain_oauth_verifier = '/hackathon/tumblr'
     #obtain_oauth_verifier = getTumblr.authorize_url()
-    context = {'title': 'API Examples Page', 'tumblr_url': obtain_oauth_verifier, 'instagram_url':instagram_url}
+    context = {'title': 'API Examples Page', 'tumblr_url': obtain_oauth_verifier, 'instagram_url':instagram_url, 'paypal_url': paypal_url}
     return render(request, 'hackathon/api_examples.html', context)
 
 #################
@@ -264,6 +265,7 @@ def instagramMediaByLocation(request):
 ####################
 #    PAYPAL API    #
 ####################
+
 def paypal(request):
     authorization_code = request.GET['code']
     refresh_token = getPaypal.get_access_token(authorization_code)