forked from apigy/selfstarter
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selfstarter now works with stripe :)
- Loading branch information
Showing
13 changed files
with
102 additions
and
99 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ | |
//= require jquery.textchange | ||
//= require preorder | ||
//= require_tree . | ||
//= require checkout |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
$(document).ready(function () { | ||
$('#checkout').submit(function (e) { | ||
$('#stripe_errors').hide() | ||
e.preventDefault(); | ||
var _this = this | ||
Stripe.card.createToken({ | ||
number: $('#card_number').val().replace(/ /g, ''), | ||
exp_month: $('#expires').val().split('/')[0], | ||
exp_year: $('#expires').val().split('/')[1], | ||
cvc: $('#cvv').val() | ||
}, function (error, result) { | ||
if (error == 200) { | ||
$('#stripe_token').val(result.id); | ||
console.log('stripe token added') | ||
_this.submit(); | ||
} | ||
else { | ||
//error | ||
$('#stripe_errors').show() | ||
return false; | ||
} | ||
}); | ||
}); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<div class="big_wrapper"> | ||
<div class="wrapper center" id="middle_reserve"> | ||
<h2><%= Settings.ships %></h2> | ||
<a href="/preorder/checkout" class="blue_button reserve"><%= Settings.middle_reserve_text %></a> | ||
<a href="/preorder/order" class="blue_button reserve"><%= Settings.middle_reserve_text %></a> | ||
</div> | ||
</div> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
Selfstarter::Application.routes.draw do | ||
root :to => 'preorder#index' | ||
match '/preorder' => 'preorder#index', :via => [:get,:post] | ||
get 'preorder/checkout' | ||
match '/preorder/share/:uuid' => 'preorder#share', :via => :get | ||
match '/preorder/ipn' => 'preorder#ipn', :via => :post | ||
match '/preorder/prefill' => 'preorder#prefill', :via => [:get,:post] | ||
match '/preorder/postfill' => 'preorder#postfill', :via => [:get,:post] | ||
match '/preorder' => 'preorder#index', :via => [:get,:post] | ||
get 'preorder/order' => 'preorder#checkout' | ||
post 'preorder/order' => 'preorder#order' | ||
|
||
match '/preorder/share/:uuid' => 'preorder#share', :via => :get | ||
match '/preorder/ipn' => 'preorder#ipn', :via => :post | ||
end |
This file contains 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
d573a83
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
d573a83
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey man, I found this branch from the original one. What do you think about move all this business logic to some PORO. Maybe we could build a public api from a interface to make available some basic methods to help with another payment gateways. You can follow my last commit.
apigy#83