Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use POST instead of GET for CC

  • Loading branch information...
commit ef98217d0bbbc42e4143a4fce1942d523e9e127f 1 parent 12d5337
@dustball dustball authored
Showing with 5 additions and 4 deletions.
  1. +1 −1  main.py
  2. +3 −2 static/signin.js
  3. +1 −1  templates/main.html
View
2  main.py
@@ -374,7 +374,7 @@ def get(self,format):
self.response.out.write("\n")
class ChargeHandler(webapp.RequestHandler):
- def get(self):
+ def post(self):
card = CreditCard(
number = self.request.get('cc'),
month = self.request.get('month'),
View
5 static/signin.js
@@ -28,8 +28,10 @@ function charge(cc,month,year) {
$("input[name=email]").val("");
$('#ajaxloading').fadeIn();
$.ajax({
- url: '/api/charge?cc='+cc+'&month='+month+'&year='+year,
+ url: '/api/charge',
+ data: 'cc='+cc+'&month='+month+'&year='+year,
dataType: "json",
+ type: "post",
timeout: 14 * 1000,
error: function(data) {
auto_reset();
@@ -43,7 +45,6 @@ function charge(cc,month,year) {
setTimeout("$('#ccerror').fadeOut();",3 * 1000);
},
success: function(data) {
- console.log(data);
if (data.status_code==1) {
$('#ajaxloading').fadeOut();
$('#ccamount').html(data.dollar_amount);
View
2  templates/main.html
@@ -4,7 +4,7 @@
<title>Sign in</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="/static/md5.js"></script>
- <script type="text/javascript" src="/static/signin.js?v=5"></script>
+ <script type="text/javascript" src="/static/signin.js?v=6"></script>
<link rel="stylesheet" type="text/css" href="/static/signin.css" />
</head>
<body id="body">
Please sign in to comment.
Something went wrong with that request. Please try again.