stripe_wrapper 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +56 -0
- data/app/assets/config/stripe_wrapper_manifest.js +2 -0
- data/app/assets/javascripts/stripe_wrapper/application.js +13 -0
- data/app/assets/javascripts/stripe_wrapper/customers.js +2 -0
- data/app/assets/stylesheets/scaffold.css +84 -0
- data/app/assets/stylesheets/stripe_wrapper/application.css +15 -0
- data/app/assets/stylesheets/stripe_wrapper/customers.css +4 -0
- data/app/controllers/stripe_wrapper/application_controller.rb +5 -0
- data/app/controllers/stripe_wrapper/charges_controller.rb +15 -0
- data/app/controllers/stripe_wrapper/customers_controller.rb +62 -0
- data/app/helpers/stripe_wrapper/application_helper.rb +4 -0
- data/app/helpers/stripe_wrapper/customers_helper.rb +4 -0
- data/app/jobs/stripe_wrapper/application_job.rb +4 -0
- data/app/mailers/stripe_wrapper/application_mailer.rb +6 -0
- data/app/models/stripe_wrapper/application_record.rb +5 -0
- data/app/models/stripe_wrapper/charge.rb +4 -0
- data/app/models/stripe_wrapper/customer.rb +4 -0
- data/app/views/layouts/stripe_wrapper/application.html.erb +14 -0
- data/app/views/stripe_wrapper/charges/_pay.html.haml +47 -0
- data/app/views/stripe_wrapper/customers/_form.html.erb +67 -0
- data/app/views/stripe_wrapper/customers/edit.html.erb +6 -0
- data/app/views/stripe_wrapper/customers/index.html.erb +45 -0
- data/app/views/stripe_wrapper/customers/new.html.erb +5 -0
- data/app/views/stripe_wrapper/customers/show.html.erb +54 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20161215195603_create_stripe_wrapper_customers.rb +18 -0
- data/db/migrate/20161215195608_create_stripe_wrapper_charges.rb +23 -0
- data/lib/stripe_wrapper.rb +5 -0
- data/lib/stripe_wrapper/engine.rb +5 -0
- data/lib/stripe_wrapper/version.rb +3 -0
- data/lib/tasks/stripe_wrapper_tasks.rake +4 -0
- metadata +139 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b426fd7e75ae008a4d614827ad23ff8292bc2e2b
|
4
|
+
data.tar.gz: 05b487dde23e9116aad0e782249419e86bfed45c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d2dd4b8df81c57e50af2c439fd8c07adb74654b53bb05158eb4e81b59ede9d7063987c0de6d30758828502657408b5a4267245e93df548644a249377fc20105e
|
7
|
+
data.tar.gz: ecdb622b2bf9d65ac6f7ab525bc476de712642c1e3ebff3b2b1bd04467138b25be9969f7a232e1af658e6349a270c1c7d4bfbe15f2accb7c69566b186273a76b
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2016 John Peebles
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# StripeWrapper
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'stripe_wrapper'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install stripe_wrapper
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'StripeWrapper'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
namespace :dev do
|
37
|
+
desc 'Start development web server'
|
38
|
+
task :server do
|
39
|
+
require 'rails/commands/server'
|
40
|
+
|
41
|
+
host = '0.0.0.0'
|
42
|
+
port = ENV['PORT'] || 9292
|
43
|
+
ENV['RACK_ENV'] = ENV['RAILS_ENV'] = 'development'
|
44
|
+
Dir.chdir 'test/dummy'
|
45
|
+
|
46
|
+
Rack::Server.start(
|
47
|
+
environment: 'development',
|
48
|
+
Host: host,
|
49
|
+
Port: port,
|
50
|
+
config: 'config.ru'
|
51
|
+
)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,84 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #fff;
|
3
|
+
color: #333;
|
4
|
+
}
|
5
|
+
|
6
|
+
body, p, ol, ul, td {
|
7
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
8
|
+
font-size: 13px;
|
9
|
+
line-height: 18px;
|
10
|
+
margin: 33px;
|
11
|
+
}
|
12
|
+
|
13
|
+
pre {
|
14
|
+
background-color: #eee;
|
15
|
+
padding: 10px;
|
16
|
+
font-size: 11px;
|
17
|
+
}
|
18
|
+
|
19
|
+
a {
|
20
|
+
color: #000;
|
21
|
+
}
|
22
|
+
|
23
|
+
a:visited {
|
24
|
+
color: #666;
|
25
|
+
}
|
26
|
+
|
27
|
+
a:hover {
|
28
|
+
color: #fff;
|
29
|
+
background-color: #000;
|
30
|
+
}
|
31
|
+
|
32
|
+
th {
|
33
|
+
padding-bottom: 5px;
|
34
|
+
}
|
35
|
+
|
36
|
+
td {
|
37
|
+
padding-bottom: 7px;
|
38
|
+
padding-left: 5px;
|
39
|
+
padding-right: 5px;
|
40
|
+
}
|
41
|
+
|
42
|
+
div.field,
|
43
|
+
div.actions {
|
44
|
+
margin-bottom: 10px;
|
45
|
+
}
|
46
|
+
|
47
|
+
#notice {
|
48
|
+
color: green;
|
49
|
+
}
|
50
|
+
|
51
|
+
.field_with_errors {
|
52
|
+
padding: 2px;
|
53
|
+
background-color: red;
|
54
|
+
display: table;
|
55
|
+
}
|
56
|
+
|
57
|
+
#error_explanation {
|
58
|
+
width: 450px;
|
59
|
+
border: 2px solid red;
|
60
|
+
padding: 7px;
|
61
|
+
padding-bottom: 0;
|
62
|
+
margin-bottom: 20px;
|
63
|
+
background-color: #f0f0f0;
|
64
|
+
}
|
65
|
+
|
66
|
+
#error_explanation h2 {
|
67
|
+
text-align: left;
|
68
|
+
font-weight: bold;
|
69
|
+
padding: 5px 5px 5px 15px;
|
70
|
+
font-size: 12px;
|
71
|
+
margin: -7px;
|
72
|
+
margin-bottom: 0;
|
73
|
+
background-color: #c00;
|
74
|
+
color: #fff;
|
75
|
+
}
|
76
|
+
|
77
|
+
#error_explanation ul li {
|
78
|
+
font-size: 12px;
|
79
|
+
list-style: square;
|
80
|
+
}
|
81
|
+
|
82
|
+
label {
|
83
|
+
display: block;
|
84
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require_dependency "stripe_wrapper/application_controller"
|
2
|
+
|
3
|
+
module StripeWrapper
|
4
|
+
class CustomersController < ApplicationController
|
5
|
+
before_action :set_customer, only: [:show, :edit, :update, :destroy]
|
6
|
+
|
7
|
+
# GET /customers
|
8
|
+
def index
|
9
|
+
@customers = Customer.all
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET /customers/1
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /customers/new
|
17
|
+
def new
|
18
|
+
@customer = Customer.new
|
19
|
+
end
|
20
|
+
|
21
|
+
# GET /customers/1/edit
|
22
|
+
def edit
|
23
|
+
end
|
24
|
+
|
25
|
+
# POST /customers
|
26
|
+
def create
|
27
|
+
@customer = Customer.new(customer_params)
|
28
|
+
|
29
|
+
if @customer.save
|
30
|
+
redirect_to @customer, notice: 'Customer was successfully created.'
|
31
|
+
else
|
32
|
+
render :new
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# PATCH/PUT /customers/1
|
37
|
+
def update
|
38
|
+
if @customer.update(customer_params)
|
39
|
+
redirect_to @customer, notice: 'Customer was successfully updated.'
|
40
|
+
else
|
41
|
+
render :edit
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# DELETE /customers/1
|
46
|
+
def destroy
|
47
|
+
@customer.destroy
|
48
|
+
redirect_to customers_url, notice: 'Customer was successfully destroyed.'
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
# Use callbacks to share common setup or constraints between actions.
|
53
|
+
def set_customer
|
54
|
+
@customer = Customer.find(params[:id])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Only allow a trusted parameter "white list" through.
|
58
|
+
def customer_params
|
59
|
+
params.require(:customer).permit(:customer_id, :account_balance, :created, :currency, :default_source, :delinquent, :description, :discount, :email, :livemode)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Stripe wrapper</title>
|
5
|
+
<%= stylesheet_link_tag "stripe_wrapper/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "stripe_wrapper/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
= javascript_include_tag 'https://js.stripe.com/v2/'
|
2
|
+
= form_tag process_payment_public_client_infos_path, method: :post, role:'form',id: 'payment_form' do
|
3
|
+
=hidden_field_tag :stripe_token
|
4
|
+
.container.payment_partial
|
5
|
+
.row
|
6
|
+
.col-xs-12.col-md-7.col-md-offset-2
|
7
|
+
.panel.panel-default
|
8
|
+
.panel-heading
|
9
|
+
%h3.panel-title
|
10
|
+
Detalles del pago
|
11
|
+
/ .checkbox.pull-right
|
12
|
+
/ %label
|
13
|
+
/ %input{:type => "checkbox"}/
|
14
|
+
/ Remember
|
15
|
+
.panel-body
|
16
|
+
%span.payment-errors
|
17
|
+
.form-group
|
18
|
+
%label{:for => "cardNumber"}
|
19
|
+
NÚMERO DE TARJETA
|
20
|
+
.input-group
|
21
|
+
= text_field_tag :card_number,nil, placeholder: 'Número de tarjeta válido', class: 'form-control',data:{stripe:'number'}
|
22
|
+
%span.input-group-addon
|
23
|
+
%span.glyphicon.glyphicon-lock
|
24
|
+
.row
|
25
|
+
.col-xs-7.col-md-7
|
26
|
+
.form-group
|
27
|
+
%label{:for => "expityMonth"} FECHA DE EXPIRACIÓN
|
28
|
+
.col-xs-6.col-lg-6.pl-ziro
|
29
|
+
= text_field_tag :card_month,nil, placeholder: 'Mes', class: 'form-control',data:{stripe:'exp_month'}
|
30
|
+
.col-xs-6.col-lg-6.pl-ziro
|
31
|
+
= text_field_tag :card_year,nil, placeholder: 'Año', class: 'form-control',data:{stripe:'exp_year'}
|
32
|
+
.col-xs-5.col-md-5.pull-right
|
33
|
+
.form-group
|
34
|
+
%label{:for => "cvCode"}
|
35
|
+
CÓDIGO CV
|
36
|
+
= text_field_tag :card_cv,nil, placeholder: 'CV', class: 'form-control',data:{stripe:'cvc'}
|
37
|
+
%ul.nav.nav-pills.nav-stacked
|
38
|
+
%li.active
|
39
|
+
%a{:href => "#"}
|
40
|
+
%span.badge.pull-right
|
41
|
+
%span.glyphicon.glyphicon-usd>
|
42
|
+
10.000
|
43
|
+
Total
|
44
|
+
%br/
|
45
|
+
=submit_tag 'Pagar', class: 'btn btn-success btn-lg btn-block submit'
|
46
|
+
:javascript
|
47
|
+
Stripe.setPublishableKey("#{ENV['STRIPE_PUBLIC_KEY']}");
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<%= form_for(customer) do |f| %>
|
2
|
+
<% if customer.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(customer.errors.count, "error") %> prohibited this customer from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% customer.errors.full_messages.each do |message| %>
|
8
|
+
<li><%= message %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :customer_id %>
|
16
|
+
<%= f.text_field :customer_id %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label :account_balance %>
|
21
|
+
<%= f.number_field :account_balance %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="field">
|
25
|
+
<%= f.label :created %>
|
26
|
+
<%= f.datetime_select :created %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="field">
|
30
|
+
<%= f.label :currency %>
|
31
|
+
<%= f.text_field :currency %>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="field">
|
35
|
+
<%= f.label :default_source %>
|
36
|
+
<%= f.text_field :default_source %>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="field">
|
40
|
+
<%= f.label :delinquent %>
|
41
|
+
<%= f.check_box :delinquent %>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div class="field">
|
45
|
+
<%= f.label :description %>
|
46
|
+
<%= f.text_field :description %>
|
47
|
+
</div>
|
48
|
+
|
49
|
+
<div class="field">
|
50
|
+
<%= f.label :discount %>
|
51
|
+
<%= f.text_field :discount %>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div class="field">
|
55
|
+
<%= f.label :email %>
|
56
|
+
<%= f.text_field :email %>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div class="field">
|
60
|
+
<%= f.label :livemode %>
|
61
|
+
<%= f.check_box :livemode %>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<div class="actions">
|
65
|
+
<%= f.submit %>
|
66
|
+
</div>
|
67
|
+
<% end %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Customers</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Customer</th>
|
9
|
+
<th>Account balance</th>
|
10
|
+
<th>Created</th>
|
11
|
+
<th>Currency</th>
|
12
|
+
<th>Default source</th>
|
13
|
+
<th>Delinquent</th>
|
14
|
+
<th>Description</th>
|
15
|
+
<th>Discount</th>
|
16
|
+
<th>Email</th>
|
17
|
+
<th>Livemode</th>
|
18
|
+
<th colspan="3"></th>
|
19
|
+
</tr>
|
20
|
+
</thead>
|
21
|
+
|
22
|
+
<tbody>
|
23
|
+
<% @customers.each do |customer| %>
|
24
|
+
<tr>
|
25
|
+
<td><%= customer.customer_id %></td>
|
26
|
+
<td><%= customer.account_balance %></td>
|
27
|
+
<td><%= customer.created %></td>
|
28
|
+
<td><%= customer.currency %></td>
|
29
|
+
<td><%= customer.default_source %></td>
|
30
|
+
<td><%= customer.delinquent %></td>
|
31
|
+
<td><%= customer.description %></td>
|
32
|
+
<td><%= customer.discount %></td>
|
33
|
+
<td><%= customer.email %></td>
|
34
|
+
<td><%= customer.livemode %></td>
|
35
|
+
<td><%= link_to 'Show', customer %></td>
|
36
|
+
<td><%= link_to 'Edit', edit_customer_path(customer) %></td>
|
37
|
+
<td><%= link_to 'Destroy', customer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
38
|
+
</tr>
|
39
|
+
<% end %>
|
40
|
+
</tbody>
|
41
|
+
</table>
|
42
|
+
|
43
|
+
<br>
|
44
|
+
|
45
|
+
<%= link_to 'New Customer', new_customer_path %>
|
@@ -0,0 +1,54 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Customer:</strong>
|
5
|
+
<%= @customer.customer_id %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>Account balance:</strong>
|
10
|
+
<%= @customer.account_balance %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<strong>Created:</strong>
|
15
|
+
<%= @customer.created %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<strong>Currency:</strong>
|
20
|
+
<%= @customer.currency %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
<p>
|
24
|
+
<strong>Default source:</strong>
|
25
|
+
<%= @customer.default_source %>
|
26
|
+
</p>
|
27
|
+
|
28
|
+
<p>
|
29
|
+
<strong>Delinquent:</strong>
|
30
|
+
<%= @customer.delinquent %>
|
31
|
+
</p>
|
32
|
+
|
33
|
+
<p>
|
34
|
+
<strong>Description:</strong>
|
35
|
+
<%= @customer.description %>
|
36
|
+
</p>
|
37
|
+
|
38
|
+
<p>
|
39
|
+
<strong>Discount:</strong>
|
40
|
+
<%= @customer.discount %>
|
41
|
+
</p>
|
42
|
+
|
43
|
+
<p>
|
44
|
+
<strong>Email:</strong>
|
45
|
+
<%= @customer.email %>
|
46
|
+
</p>
|
47
|
+
|
48
|
+
<p>
|
49
|
+
<strong>Livemode:</strong>
|
50
|
+
<%= @customer.livemode %>
|
51
|
+
</p>
|
52
|
+
|
53
|
+
<%= link_to 'Edit', edit_customer_path(@customer) %> |
|
54
|
+
<%= link_to 'Back', customers_path %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateStripeWrapperCustomers < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
create_table :stripe_wrapper_customers do |t|
|
4
|
+
t.string :customer_id
|
5
|
+
t.integer :account_balance
|
6
|
+
t.datetime :created
|
7
|
+
t.string :currency
|
8
|
+
t.string :default_source
|
9
|
+
t.boolean :delinquent
|
10
|
+
t.string :description
|
11
|
+
t.string :discount
|
12
|
+
t.string :email
|
13
|
+
t.boolean :livemode
|
14
|
+
|
15
|
+
t.timestamps
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class CreateStripeWrapperCharges < ActiveRecord::Migration[5.0]
|
2
|
+
def change
|
3
|
+
create_table :stripe_wrapper_charges do |t|
|
4
|
+
t.string :stripe_id
|
5
|
+
t.string :object
|
6
|
+
t.float :amount
|
7
|
+
t.float :amount_refunded
|
8
|
+
t.string :application
|
9
|
+
t.float :application_fee
|
10
|
+
t.string :balance_transaction
|
11
|
+
t.boolean :captured
|
12
|
+
t.datetime :created
|
13
|
+
t.string :currency
|
14
|
+
t.string :customer
|
15
|
+
t.text :description
|
16
|
+
t.string :cvc_check
|
17
|
+
t.string :failure_code
|
18
|
+
t.string :failude_message
|
19
|
+
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stripe_wrapper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- John Peebles | @waclock
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.0.0
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 5.0.0.1
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 5.0.0
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 5.0.0.1
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rails-i18n
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: stripe
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: sqlite3
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
description: Wrapper around Stripe for rails.
|
76
|
+
email:
|
77
|
+
- john@mispistachos.cl
|
78
|
+
executables: []
|
79
|
+
extensions: []
|
80
|
+
extra_rdoc_files: []
|
81
|
+
files:
|
82
|
+
- MIT-LICENSE
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- app/assets/config/stripe_wrapper_manifest.js
|
86
|
+
- app/assets/javascripts/stripe_wrapper/application.js
|
87
|
+
- app/assets/javascripts/stripe_wrapper/customers.js
|
88
|
+
- app/assets/stylesheets/scaffold.css
|
89
|
+
- app/assets/stylesheets/stripe_wrapper/application.css
|
90
|
+
- app/assets/stylesheets/stripe_wrapper/customers.css
|
91
|
+
- app/controllers/stripe_wrapper/application_controller.rb
|
92
|
+
- app/controllers/stripe_wrapper/charges_controller.rb
|
93
|
+
- app/controllers/stripe_wrapper/customers_controller.rb
|
94
|
+
- app/helpers/stripe_wrapper/application_helper.rb
|
95
|
+
- app/helpers/stripe_wrapper/customers_helper.rb
|
96
|
+
- app/jobs/stripe_wrapper/application_job.rb
|
97
|
+
- app/mailers/stripe_wrapper/application_mailer.rb
|
98
|
+
- app/models/stripe_wrapper/application_record.rb
|
99
|
+
- app/models/stripe_wrapper/charge.rb
|
100
|
+
- app/models/stripe_wrapper/customer.rb
|
101
|
+
- app/views/layouts/stripe_wrapper/application.html.erb
|
102
|
+
- app/views/stripe_wrapper/charges/_pay.html.haml
|
103
|
+
- app/views/stripe_wrapper/customers/_form.html.erb
|
104
|
+
- app/views/stripe_wrapper/customers/edit.html.erb
|
105
|
+
- app/views/stripe_wrapper/customers/index.html.erb
|
106
|
+
- app/views/stripe_wrapper/customers/new.html.erb
|
107
|
+
- app/views/stripe_wrapper/customers/show.html.erb
|
108
|
+
- config/routes.rb
|
109
|
+
- db/migrate/20161215195603_create_stripe_wrapper_customers.rb
|
110
|
+
- db/migrate/20161215195608_create_stripe_wrapper_charges.rb
|
111
|
+
- lib/stripe_wrapper.rb
|
112
|
+
- lib/stripe_wrapper/engine.rb
|
113
|
+
- lib/stripe_wrapper/version.rb
|
114
|
+
- lib/tasks/stripe_wrapper_tasks.rake
|
115
|
+
homepage: https://mispistachos.cl
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
metadata: {}
|
119
|
+
post_install_message:
|
120
|
+
rdoc_options: []
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
requirements: []
|
134
|
+
rubyforge_project:
|
135
|
+
rubygems_version: 2.5.1
|
136
|
+
signing_key:
|
137
|
+
specification_version: 4
|
138
|
+
summary: Wrapper around Stripe for rails.
|
139
|
+
test_files: []
|