├── .gitignore ├── Gemfile ├── Gemfile.lock ├── README.md ├── Rakefile ├── app ├── assets │ ├── images │ │ ├── .keep │ │ ├── green.jpg │ │ ├── rails.png │ │ └── white.jpg │ ├── javascripts │ │ └── application.js │ └── stylesheets │ │ ├── application.css │ │ └── main.scss ├── controllers │ ├── application_controller.rb │ ├── concerns │ │ └── .keep │ ├── cups_controller.rb │ └── orders_controller.rb ├── helpers │ └── application_helper.rb ├── mailers │ └── .keep ├── models │ ├── .keep │ ├── concerns │ │ └── .keep │ ├── cup.rb │ └── order.rb └── views │ ├── cups │ └── index.html.erb │ ├── layouts │ └── application.html.erb │ └── orders │ ├── new.html.erb │ └── show.html.erb ├── bin ├── bundle ├── rails ├── rake └── spring ├── config.ru ├── config ├── application.rb ├── boot.rb ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── alipay.rb.example │ ├── assets.rb │ ├── backtrace_silencers.rb │ ├── cookies_serializer.rb │ ├── filter_parameter_logging.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── session_store.rb │ └── wrap_parameters.rb ├── locales │ └── en.yml ├── routes.rb └── secrets.yml ├── db ├── migrate │ ├── 20150620080543_create_cups.rb │ └── 20150621013003_create_orders.rb ├── schema.rb └── seeds.rb ├── lib ├── assets │ └── .keep └── tasks │ └── .keep ├── log └── .keep ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico └── robots.txt ├── test ├── controllers │ └── .keep ├── fixtures │ └── .keep ├── helpers │ └── .keep ├── integration │ └── .keep ├── mailers │ └── .keep ├── models │ └── .keep └── test_helper.rb └── vendor └── assets ├── javascripts └── .keep └── stylesheets └── .keep /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | # Ignore bundler config 8 | /.bundle 9 | settings.yml 10 | *.swp 11 | 12 | # Ignore the default SQLite database. 13 | /db/*.sqlite3 14 | 15 | # Ignore all logfiles and tempfiles. 16 | /log/*.log 17 | /tmp 18 | alipay.rb 19 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | 4 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 5 | gem 'rails', '4.1.6' 6 | # Use mysql as the database for Active Record 7 | gem 'mysql2' 8 | # Use SCSS for stylesheets 9 | gem 'sass-rails', '~> 4.0.3' 10 | # Use Uglifier as compressor for JavaScript assets 11 | gem 'uglifier', '>= 1.3.0' 12 | # Use CoffeeScript for .js.coffee assets and views 13 | gem 'coffee-rails', '~> 4.0.0' 14 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 15 | # gem 'therubyracer', platforms: :ruby 16 | 17 | # Use jquery as the JavaScript library 18 | gem 'jquery-rails' 19 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 20 | gem 'turbolinks' 21 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 22 | gem 'jbuilder', '~> 2.0' 23 | # bundle exec rake doc:rails generates the API under doc/api. 24 | gem 'sdoc', '~> 0.4.0', group: :doc 25 | 26 | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 27 | gem 'spring', group: :development 28 | gem 'alipay', '~> 0.7.1' 29 | # Use ActiveModel has_secure_password 30 | # gem 'bcrypt', '~> 3.1.7' 31 | 32 | # Use unicorn as the app server 33 | # gem 'unicorn' 34 | 35 | # Use Capistrano for deployment 36 | # gem 'capistrano-rails', group: :development 37 | 38 | # Use debugger 39 | # gem 'debugger', group: [:development, :test] 40 | 41 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | actionmailer (4.1.6) 5 | actionpack (= 4.1.6) 6 | actionview (= 4.1.6) 7 | mail (~> 2.5, >= 2.5.4) 8 | actionpack (4.1.6) 9 | actionview (= 4.1.6) 10 | activesupport (= 4.1.6) 11 | rack (~> 1.5.2) 12 | rack-test (~> 0.6.2) 13 | actionview (4.1.6) 14 | activesupport (= 4.1.6) 15 | builder (~> 3.1) 16 | erubis (~> 2.7.0) 17 | activemodel (4.1.6) 18 | activesupport (= 4.1.6) 19 | builder (~> 3.1) 20 | activerecord (4.1.6) 21 | activemodel (= 4.1.6) 22 | activesupport (= 4.1.6) 23 | arel (~> 5.0.0) 24 | activesupport (4.1.6) 25 | i18n (~> 0.6, >= 0.6.9) 26 | json (~> 1.7, >= 1.7.7) 27 | minitest (~> 5.1) 28 | thread_safe (~> 0.1) 29 | tzinfo (~> 1.1) 30 | alipay (0.7.1) 31 | arel (5.0.1.20140414130214) 32 | builder (3.2.2) 33 | coffee-rails (4.0.1) 34 | coffee-script (>= 2.2.0) 35 | railties (>= 4.0.0, < 5.0) 36 | coffee-script (2.4.1) 37 | coffee-script-source 38 | execjs 39 | coffee-script-source (1.9.1.1) 40 | erubis (2.7.0) 41 | execjs (2.5.2) 42 | hike (1.2.3) 43 | i18n (0.7.0) 44 | jbuilder (2.3.0) 45 | activesupport (>= 3.0.0, < 5) 46 | multi_json (~> 1.2) 47 | jquery-rails (3.1.3) 48 | railties (>= 3.0, < 5.0) 49 | thor (>= 0.14, < 2.0) 50 | json (1.8.3) 51 | mail (2.6.3) 52 | mime-types (>= 1.16, < 3) 53 | mime-types (2.6.1) 54 | minitest (5.7.0) 55 | multi_json (1.11.1) 56 | mysql2 (0.3.18) 57 | rack (1.5.5) 58 | rack-test (0.6.3) 59 | rack (>= 1.0) 60 | rails (4.1.6) 61 | actionmailer (= 4.1.6) 62 | actionpack (= 4.1.6) 63 | actionview (= 4.1.6) 64 | activemodel (= 4.1.6) 65 | activerecord (= 4.1.6) 66 | activesupport (= 4.1.6) 67 | bundler (>= 1.3.0, < 2.0) 68 | railties (= 4.1.6) 69 | sprockets-rails (~> 2.0) 70 | railties (4.1.6) 71 | actionpack (= 4.1.6) 72 | activesupport (= 4.1.6) 73 | rake (>= 0.8.7) 74 | thor (>= 0.18.1, < 2.0) 75 | rake (10.4.2) 76 | rdoc (4.2.0) 77 | json (~> 1.4) 78 | sass (3.2.19) 79 | sass-rails (4.0.5) 80 | railties (>= 4.0.0, < 5.0) 81 | sass (~> 3.2.2) 82 | sprockets (~> 2.8, < 3.0) 83 | sprockets-rails (~> 2.0) 84 | sdoc (0.4.1) 85 | json (~> 1.7, >= 1.7.7) 86 | rdoc (~> 4.0) 87 | spring (1.3.6) 88 | sprockets (2.12.3) 89 | hike (~> 1.2) 90 | multi_json (~> 1.0) 91 | rack (~> 1.0) 92 | tilt (~> 1.1, != 1.3.0) 93 | sprockets-rails (2.3.1) 94 | actionpack (>= 3.0) 95 | activesupport (>= 3.0) 96 | sprockets (>= 2.8, < 4.0) 97 | thor (0.19.1) 98 | thread_safe (0.3.5) 99 | tilt (1.4.1) 100 | turbolinks (2.5.3) 101 | coffee-rails 102 | tzinfo (1.2.2) 103 | thread_safe (~> 0.1) 104 | uglifier (2.7.1) 105 | execjs (>= 0.3.0) 106 | json (>= 1.8.0) 107 | 108 | PLATFORMS 109 | ruby 110 | 111 | DEPENDENCIES 112 | alipay (~> 0.7.1) 113 | coffee-rails (~> 4.0.0) 114 | jbuilder (~> 2.0) 115 | jquery-rails 116 | mysql2 117 | rails (= 4.1.6) 118 | sass-rails (~> 4.0.3) 119 | sdoc (~> 0.4.0) 120 | spring 121 | turbolinks 122 | uglifier (>= 1.3.0) 123 | 124 | BUNDLED WITH 125 | 1.10.4 126 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ### 重要更新 3 | 4 | [支付宝这边](https://b.alipay.com/order/productSet.htm) 已经不提供咱们这里要使用的 __担保交易接口__ 了,悲催! 5 | 6 | 7 | ### 课程概要 8 | 9 | 对支付宝的双接口集成到一个网站进行讲解,实例代码采用 RubyonRails 框架。课程地址:http://haoqicat.com/alipay 10 | 11 | 12 | ### 欢迎批评或提问 13 | 14 | 欢迎添加 Peter 的微信: happypeter1983 (不承诺又问必答) 15 | 16 | 17 | ### 改版历史 18 | 19 | 2015年6月:支付宝官方已经取消了双接口服务,所以这次课程改版,采用了 [chloerei/alipay](https://github.com/chloerei/alipay)这个 gem ,实现了基于担保交易接口的收款功能。 20 | 21 | 2014 年:申请支付宝的双接口服务,结合自己的 alipay_dualfun gem 完成了课程。 22 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/assets/images/.keep -------------------------------------------------------------------------------- /app/assets/images/green.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/assets/images/green.jpg -------------------------------------------------------------------------------- /app/assets/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/assets/images/rails.png -------------------------------------------------------------------------------- /app/assets/images/white.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/assets/images/white.jpg -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 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 vendor/assets/javascripts of plugins, if any, 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. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require turbolinks 16 | //= require_tree . 17 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 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 vendor/assets/stylesheets of plugins, if any, 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 styles 10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new 11 | * file per style scope. 12 | * 13 | *= require_tree . 14 | *= require_self 15 | */ 16 | -------------------------------------------------------------------------------- /app/assets/stylesheets/main.scss: -------------------------------------------------------------------------------- 1 | *, *:before, *:after { 2 | -moz-box-sizing: border-box; 3 | -webkit-box-sizing: border-box; 4 | box-sizing: border-box; 5 | } 6 | .clearfix:before, .clearfix:after { 7 | content: " "; 8 | display: table; 9 | } 10 | .clearfix:after { 11 | clear: both; 12 | } 13 | 14 | 15 | body { 16 | background-color: rgb(235, 239, 242); 17 | -webkit-font-smoothing: antialiased; 18 | font-family: sans-serif; 19 | } 20 | body, ul, h3, h4, p { 21 | margin: 0; 22 | padding: 0; 23 | } 24 | ul { 25 | list-style-type: none; 26 | } 27 | a { 28 | text-decoration: none; 29 | } 30 | body { 31 | min-width: 1000px; 32 | } 33 | header { 34 | text-align: center; 35 | height: 80px; 36 | line-height: 80px; 37 | color: #FFF; 38 | font-size: 25px; 39 | font-weight: 600; 40 | background-color: rgb(77, 70, 180); 41 | box-shadow: 0 2px 6px rgba(0,0,0,0.2); 42 | } 43 | .wrapper { 44 | width: 960px; 45 | margin: 50px auto; 46 | } 47 | 48 | .items { 49 | width: 660px; 50 | margin: 0 auto; 51 | } 52 | .item { 53 | box-shadow: 0 1px 2px rgba(43,59,93,0.29); 54 | background-color: #FFF; 55 | width: 300px; 56 | margin: 15px; 57 | float: left; 58 | border-radius: 5px; 59 | .cover { 60 | display: block; 61 | width: 80%; 62 | margin: 10px auto; 63 | } 64 | .title { 65 | text-align: center; 66 | padding-top: 10px; 67 | padding-bottom: 20px; 68 | font-size: 18px; 69 | color: #333; 70 | } 71 | .buy-btn { 72 | transition: all .3s ease-out; 73 | display: block; 74 | width: 100%; 75 | line-height: 3; 76 | text-align: center; 77 | color: white; 78 | border-radius: 0 0 5px 5px; 79 | background-color: rgb(226, 30, 96); 80 | &:hover { 81 | background-color: rgb(243, 80, 135); 82 | } 83 | } 84 | } 85 | 86 | .order { 87 | text-align: center; 88 | background-color: #FFF; 89 | padding: 20px; 90 | box-shadow: 0 1px 2px rgba(43,59,93,0.29); 91 | table { 92 | width: 100%; 93 | height: 100px; 94 | margin: 20px auto 50px; 95 | text-align: center; 96 | border-collapse: collapse; 97 | th, td { 98 | border: 1px solid #ccc; 99 | padding: 10px; 100 | } 101 | th:first-child { 102 | width: 80px; 103 | } 104 | td { 105 | color: #333; 106 | } 107 | } 108 | .order-button { 109 | box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12); 110 | background-color: #26a69a; 111 | width: 150px; 112 | padding: 10px; 113 | text-align: center; 114 | color: #FFF; 115 | border: none; 116 | font-size: 20px; 117 | transition: all .3s ease-out; 118 | border-radius: 3px; 119 | &:hover { 120 | cursor: pointer; 121 | background-color: #2bbbad; 122 | box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15); 123 | } 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | end 6 | -------------------------------------------------------------------------------- /app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /app/controllers/cups_controller.rb: -------------------------------------------------------------------------------- 1 | class CupsController < ApplicationController 2 | def index 3 | @cups = Cup.all 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /app/controllers/orders_controller.rb: -------------------------------------------------------------------------------- 1 | class OrdersController < ApplicationController 2 | skip_before_action :verify_authenticity_token 3 | # 没有上面这一行,当接受 alipay.com 发过来的 POST 请求的时候,后台 log 中会报错 `Can't verify CSRF token authenticity` 4 | before_action :update_order, only: [ :done, :notify] 5 | def new 6 | @cup = Cup.find(params[:cup_id]) 7 | @order = Order.new 8 | @out_trade_no = Time.now.to_i.to_s 9 | end 10 | 11 | def create 12 | @order = Order.new 13 | @order.out_trade_no = params[:out_trade_no] 14 | @order.cup_id = params[:cup_id] 15 | @order.subject = params[:subject] 16 | @order.total_fee = params[:total_fee] 17 | @order.save 18 | redirect_to @order.pay_url 19 | end 20 | 21 | def show 22 | @order = Order.find_by_out_trade_no(params[:out_trade_no]) 23 | end 24 | 25 | def done 26 | redirect_to '/orders/' + @order.out_trade_no 27 | end 28 | 29 | def notify 30 | if @order.trade_status == "finished" 31 | render text: 'success' 32 | else 33 | render text: 'working' 34 | end 35 | end 36 | 37 | private 38 | def update_order 39 | options = { 40 | :trade_no => params[:trade_no], 41 | :logistics_name => 'runrunrun', 42 | :transport_type => 'DIRECT' # 文档上虽然标明“可空”,但是同时"与 create_transport_type" 不能同时为空 43 | } 44 | @order = Order.find_by_out_trade_no(params[:out_trade_no]) 45 | notify_params = params.except(*request.path_parameters.keys) 46 | if (@order.trade_status != "finished") && Alipay::Notify.verify?(notify_params) 47 | if params[:trade_status] == "WAIT_SELLER_SEND_GOODS" 48 | Alipay::Service.send_goods_confirm_by_platform(options) 49 | @order.update_attributes(trade_status: "finished") 50 | end 51 | end 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/mailers/.keep -------------------------------------------------------------------------------- /app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/models/.keep -------------------------------------------------------------------------------- /app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/app/models/concerns/.keep -------------------------------------------------------------------------------- /app/models/cup.rb: -------------------------------------------------------------------------------- 1 | class Cup < ActiveRecord::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/models/order.rb: -------------------------------------------------------------------------------- 1 | class Order < ActiveRecord::Base 2 | def pay_url 3 | Alipay::Service.create_partner_trade_by_buyer_url({ 4 | out_trade_no: out_trade_no, 5 | subject: subject, 6 | price: total_fee, 7 | quantity: 1, 8 | logistics_type: 'DIRECT', 9 | logistics_fee: '0', 10 | logistics_payment: 'SELLER_PAY', 11 | receive_name: 'none', 12 | receive_address: 'none', 13 | receive_zip: '100000', 14 | receive_mobile: '100000000000', 15 | return_url: 'http://alipay.haoqicat.com/orders/done', 16 | notify_url: 'http://alipay.haoqicat.com/orders/notify' 17 | }) 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /app/views/cups/index.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :head do %> 2 | 全部商品 3 | <% end %> 4 |
5 | <% @cups.each do |cup| %> 6 |
7 | <%= image_tag cup.cover , class: "cover" %> 8 |

<%= cup.name %>(<%= cup.price %>元)

9 | 10 | 购买 11 | 12 |
13 | <% end %> 14 |
15 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HaoqiAlipay 5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> 6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 |
12 | <%= yield :head %> 13 |
14 |
15 | <%= yield %> 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/views/orders/new.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :head do %> 2 | 新建订单 3 | <% end %> 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
订单号商品名称商品价格(元)付款状态
<%= @out_trade_no %><%= @cup.name %><%= @cup.price %>未付款
19 | <%= form_tag "/checkout" do %> 20 | <%= hidden_field_tag :cup_id, @cup.id %> 21 | <%= hidden_field_tag :subject, @cup.name %> 22 | <%= hidden_field_tag :out_trade_no, @out_trade_no %> 23 | <%= hidden_field_tag :total_fee, @cup.price * 1 %> 24 |
25 | <%= submit_tag "提交订单", class: "order-button" %> 26 |
27 | <% end %> 28 |
29 | -------------------------------------------------------------------------------- /app/views/orders/show.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :head do %> 2 | 订单信息 3 | <% end %> 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 26 | 27 | 28 |
交易号商品名称商品价格(元)付款状态
<%= @order.out_trade_no %><%= @order.subject %> <%= @order.total_fee %> 20 | <% if @order.trade_status == "finished" %> 21 | 已付款 22 | <% else %> 23 | 未付款 24 | <% end %> 25 |
29 |
30 | 31 | -------------------------------------------------------------------------------- /bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path("../spring", __FILE__) 4 | rescue LoadError 5 | end 6 | APP_PATH = File.expand_path('../../config/application', __FILE__) 7 | require_relative '../config/boot' 8 | require 'rails/commands' 9 | -------------------------------------------------------------------------------- /bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | begin 3 | load File.expand_path("../spring", __FILE__) 4 | rescue LoadError 5 | end 6 | require_relative '../config/boot' 7 | require 'rake' 8 | Rake.application.run 9 | -------------------------------------------------------------------------------- /bin/spring: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # This file loads spring without using Bundler, in order to be fast. 4 | # It gets overwritten when you run the `spring binstub` command. 5 | 6 | unless defined?(Spring) 7 | require "rubygems" 8 | require "bundler" 9 | 10 | if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) 11 | Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } 12 | gem "spring", match[1] 13 | require "spring/binstub" 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(*Rails.groups) 8 | 9 | module HaoqiAlipay 10 | class Application < Rails::Application 11 | config.generators do |g| 12 | g.assets false 13 | g.helper false 14 | g.test_framework false 15 | end 16 | # Settings in config/environments/* take precedence over those specified here. 17 | # Application configuration should go into files in config/initializers 18 | # -- all .rb files in that directory are automatically loaded. 19 | 20 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 21 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 22 | # config.time_zone = 'Central Time (US & Canada)' 23 | 24 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 25 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 26 | # config.i18n.default_locale = :de 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) 5 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # MySQL. Versions 5.0+ are recommended. 2 | # 3 | # Install the MYSQL driver 4 | # gem install mysql2 5 | # 6 | # Ensure the MySQL gem is defined in your Gemfile 7 | # gem 'mysql2' 8 | # 9 | # And be sure to use new-style password hashing: 10 | # http://dev.mysql.com/doc/refman/5.0/en/old-client.html 11 | # 12 | default: &default 13 | adapter: mysql2 14 | encoding: utf8 15 | pool: 5 16 | username: root 17 | password: 18 | socket: /var/run/mysqld/mysqld.sock 19 | 20 | development: 21 | <<: *default 22 | database: haoqi_alipay_development 23 | 24 | # Warning: The database defined as "test" will be erased and 25 | # re-generated from your development database when you run "rake". 26 | # Do not set this db to the same as development or production. 27 | test: 28 | <<: *default 29 | database: haoqi_alipay_test 30 | 31 | # As with config/secrets.yml, you never want to store sensitive information, 32 | # like your database password, in your source code. If your source code is 33 | # ever seen by anyone, they now have access to your database. 34 | # 35 | # Instead, provide the password as a unix environment variable when you boot 36 | # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database 37 | # for a full rundown on how to provide these environment variables in a 38 | # production deployment. 39 | # 40 | # On Heroku and other platform providers, you may have a full connection URL 41 | # available as an environment variable. For example: 42 | # 43 | # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" 44 | # 45 | # You can use this database configuration with: 46 | # 47 | # production: 48 | # url: <%= ENV['DATABASE_URL'] %> 49 | # 50 | production: 51 | <<: *default 52 | database: haoqi_alipay_production 53 | username: haoqi_alipay 54 | password: <%= ENV['HAOQI_ALIPAY_DATABASE_PASSWORD'] %> 55 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations. 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | 30 | # Adds additional error checking when serving assets at runtime. 31 | # Checks for improperly declared sprockets dependencies. 32 | # Raises helpful error messages. 33 | config.assets.raise_runtime_errors = true 34 | 35 | # Raises error for missing translations 36 | # config.action_view.raise_on_missing_translations = true 37 | end 38 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both threaded web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 20 | # config.action_dispatch.rack_cache = true 21 | 22 | # Disable Rails's static asset server (Apache or nginx will already do this). 23 | config.serve_static_assets = false 24 | 25 | # Compress JavaScripts and CSS. 26 | config.assets.js_compressor = :uglifier 27 | # config.assets.css_compressor = :sass 28 | 29 | # Do not fallback to assets pipeline if a precompiled asset is missed. 30 | config.assets.compile = false 31 | 32 | # Generate digests for assets URLs. 33 | config.assets.digest = true 34 | 35 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 36 | 37 | # Specifies the header that your server uses for sending files. 38 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 39 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 40 | 41 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 42 | # config.force_ssl = true 43 | 44 | # Set to :debug to see everything in the log. 45 | config.log_level = :info 46 | 47 | # Prepend all log lines with the following tags. 48 | # config.log_tags = [ :subdomain, :uuid ] 49 | 50 | # Use a different logger for distributed setups. 51 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 52 | 53 | # Use a different cache store in production. 54 | # config.cache_store = :mem_cache_store 55 | 56 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 57 | # config.action_controller.asset_host = "http://assets.example.com" 58 | 59 | # Ignore bad email addresses and do not raise email delivery errors. 60 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 61 | # config.action_mailer.raise_delivery_errors = false 62 | 63 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 64 | # the I18n.default_locale when a translation cannot be found). 65 | config.i18n.fallbacks = true 66 | 67 | # Send deprecation notices to registered listeners. 68 | config.active_support.deprecation = :notify 69 | 70 | # Disable automatic flushing of the log to improve performance. 71 | # config.autoflush_log = false 72 | 73 | # Use default logging formatter so that PID and timestamp are not suppressed. 74 | config.log_formatter = ::Logger::Formatter.new 75 | 76 | # Do not dump schema after migrations. 77 | config.active_record.dump_schema_after_migration = false 78 | end 79 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails.application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = 'public, max-age=3600' 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | 37 | # Raises error for missing translations 38 | # config.action_view.raise_on_missing_translations = true 39 | end 40 | -------------------------------------------------------------------------------- /config/initializers/alipay.rb.example: -------------------------------------------------------------------------------- 1 | Alipay.pid = 'YOUR_PID' 2 | Alipay.key = 'YOUR_KEY' 3 | -------------------------------------------------------------------------------- /config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Version of your assets, change this if you want to expire all your assets. 4 | Rails.application.config.assets.version = '1.0' 5 | 6 | # Precompile additional assets. 7 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 8 | # Rails.application.config.assets.precompile += %w( search.js ) 9 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.action_dispatch.cookies_serializer = :json -------------------------------------------------------------------------------- /config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails.application.config.session_store :cookie_store, key: '_haoqi_alipay_session' 4 | -------------------------------------------------------------------------------- /config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails.application.routes.draw do 2 | root 'cups#index' 3 | get 'orders/new' => 'orders#new' 4 | get 'orders/done' => 'orders#done' 5 | post 'orders/notify' => 'orders#notify' 6 | get 'orders/:out_trade_no' => "orders#show" 7 | post '/checkout' => 'orders#create' 8 | 9 | # The priority is based upon order of creation: first created -> highest priority. 10 | # See how all your routes lay out with "rake routes". 11 | 12 | # You can have the root of your site routed with "root" 13 | # root 'welcome#index' 14 | 15 | # Example of regular route: 16 | # get 'products/:id' => 'catalog#view' 17 | 18 | # Example of named route that can be invoked with purchase_url(id: product.id) 19 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase 20 | 21 | # Example resource route (maps HTTP verbs to controller actions automatically): 22 | # resources :products 23 | 24 | # Example resource route with options: 25 | # resources :products do 26 | # member do 27 | # get 'short' 28 | # post 'toggle' 29 | # end 30 | # 31 | # collection do 32 | # get 'sold' 33 | # end 34 | # end 35 | 36 | # Example resource route with sub-resources: 37 | # resources :products do 38 | # resources :comments, :sales 39 | # resource :seller 40 | # end 41 | 42 | # Example resource route with more complex sub-resources: 43 | # resources :products do 44 | # resources :comments 45 | # resources :sales do 46 | # get 'recent', on: :collection 47 | # end 48 | # end 49 | 50 | # Example resource route with concerns: 51 | # concern :toggleable do 52 | # post 'toggle' 53 | # end 54 | # resources :posts, concerns: :toggleable 55 | # resources :photos, concerns: :toggleable 56 | 57 | # Example resource route within a namespace: 58 | # namespace :admin do 59 | # # Directs /admin/products/* to Admin::ProductsController 60 | # # (app/controllers/admin/products_controller.rb) 61 | # resources :products 62 | # end 63 | end 64 | -------------------------------------------------------------------------------- /config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure the secrets in this file are kept private 11 | # if you're sharing your code publicly. 12 | 13 | development: 14 | secret_key_base: 827c0eef8fa2bb558b94960844865759daa8f85ad76c8c915fb3629b3ce19862e721243e581799d2f4f78e791e9423050c5282a511af2240aff2adbf75e2b3b8 15 | 16 | test: 17 | secret_key_base: c9a1ecf811a8062a68dc0907283ef754e6226f134d44332edcaaf4ef50fbc558157c9aeb5430187e764fa0498ac52edb1acb20ff3be4339390d16be17f70759e 18 | 19 | # Do not keep production secrets in the repository, 20 | # instead read values from the environment. 21 | production: 22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 23 | -------------------------------------------------------------------------------- /db/migrate/20150620080543_create_cups.rb: -------------------------------------------------------------------------------- 1 | class CreateCups < ActiveRecord::Migration 2 | def change 3 | create_table :cups do |t| 4 | t.string :name 5 | t.float :price 6 | t.string :cover 7 | 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20150621013003_create_orders.rb: -------------------------------------------------------------------------------- 1 | class CreateOrders < ActiveRecord::Migration 2 | def change 3 | create_table :orders do |t| 4 | t.string :out_trade_no 5 | t.string :subject 6 | t.float :total_fee 7 | t.integer :cup_id 8 | t.string :trade_status 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20150621013003) do 15 | 16 | create_table "cups", force: true do |t| 17 | t.string "name" 18 | t.float "price", limit: 24 19 | t.string "cover" 20 | t.datetime "created_at" 21 | t.datetime "updated_at" 22 | end 23 | 24 | create_table "orders", force: true do |t| 25 | t.string "out_trade_no" 26 | t.string "subject" 27 | t.float "total_fee", limit: 24 28 | t.integer "cup_id" 29 | t.string "trade_status" 30 | t.datetime "created_at" 31 | t.datetime "updated_at" 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | 9 | Cup.create([{ name: '白色杯子', price: '4.5', cover: 'white.jpg'}, { name: '绿色杯子', price: '7.5', cover: 'green.jpg'}]) 10 | -------------------------------------------------------------------------------- /lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/lib/assets/.keep -------------------------------------------------------------------------------- /lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/lib/tasks/.keep -------------------------------------------------------------------------------- /log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/log/.keep -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The page you were looking for doesn't exist.

62 |

You may have mistyped the address or the page may have moved.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

The change you wanted was rejected.

62 |

Maybe you tried to change something you didn't have access to.

63 |
64 |

If you are the application owner check the logs for more information.

65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 6 | 55 | 56 | 57 | 58 | 59 |
60 |
61 |

We're sorry, but something went wrong.

62 |
63 |

If you are the application owner check the logs for more information.

64 |
65 | 66 | 67 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/test/controllers/.keep -------------------------------------------------------------------------------- /test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/test/fixtures/.keep -------------------------------------------------------------------------------- /test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/test/helpers/.keep -------------------------------------------------------------------------------- /test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/test/integration/.keep -------------------------------------------------------------------------------- /test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/test/mailers/.keep -------------------------------------------------------------------------------- /test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/test/models/.keep -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV['RAILS_ENV'] ||= 'test' 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 7 | fixtures :all 8 | 9 | # Add more helper methods to be used by all tests here... 10 | end 11 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/happypeter/haoqi_alipay/309294eaeca59c228d9b409ff955be098c49be42/vendor/assets/stylesheets/.keep --------------------------------------------------------------------------------