veritrans 2.1.3 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +6 -1
- data/.travis.yml +3 -5
- data/CHANGELOG.md +20 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +89 -94
- data/Procfile +1 -1
- data/README.md +62 -13
- data/api_reference.md +10 -10
- data/example/rails/cable/Gemfile +48 -0
- data/example/rails/cable/Gemfile.lock +184 -0
- data/example/rails/cable/README.md +29 -0
- data/example/rails/cable/Rakefile +6 -0
- data/example/rails/cable/app/assets/config/manifest.js +3 -0
- data/example/rails/cable/app/assets/images/.keep +0 -0
- data/example/rails/cable/app/assets/javascripts/application.js +15 -0
- data/example/rails/cable/app/assets/javascripts/cable.js +13 -0
- data/example/rails/cable/app/assets/javascripts/channels/.keep +0 -0
- data/example/rails/cable/app/assets/javascripts/chats.js +39 -0
- data/example/rails/cable/app/assets/javascripts/rooms.js +55 -0
- data/example/rails/cable/app/assets/stylesheets/application.css +16 -0
- data/example/rails/cable/app/assets/stylesheets/chatbox.scss +31 -0
- data/example/rails/cable/app/assets/stylesheets/peoplebox.scss +6 -0
- data/example/rails/cable/app/channels/application_cable/channel.rb +4 -0
- data/example/rails/cable/app/channels/application_cable/connection.rb +4 -0
- data/example/rails/cable/app/channels/rooms_texting_channel.rb +13 -0
- data/example/rails/cable/app/controllers/application_controller.rb +3 -0
- data/example/rails/cable/app/controllers/chats_controller.rb +18 -0
- data/example/rails/cable/app/controllers/concerns/.keep +0 -0
- data/example/rails/cable/app/controllers/pays_controller.rb +28 -0
- data/example/rails/cable/app/controllers/rooms_controller.rb +4 -0
- data/example/rails/cable/app/helpers/application_helper.rb +2 -0
- data/example/rails/cable/app/helpers/chats_helper.rb +2 -0
- data/example/rails/cable/app/helpers/rooms_helper.rb +5 -0
- data/example/rails/cable/app/jobs/application_job.rb +2 -0
- data/example/rails/cable/app/jobs/chat_broadcaster_job.rb +15 -0
- data/example/rails/cable/app/mailers/application_mailer.rb +4 -0
- data/example/rails/cable/app/models/application_record.rb +3 -0
- data/example/rails/cable/app/models/chat.rb +41 -0
- data/example/rails/cable/app/models/concerns/.keep +0 -0
- data/example/rails/cable/app/models/order.rb +2 -0
- data/example/rails/cable/app/models/user.rb +2 -0
- data/example/rails/cable/app/views/chats/_chat.html.erb +18 -0
- data/example/rails/cable/app/views/layouts/application.html.erb +19 -0
- data/example/rails/cable/app/views/layouts/mailer.html.erb +13 -0
- data/example/rails/cable/app/views/layouts/mailer.text.erb +1 -0
- data/example/rails/cable/app/views/rooms/_chatbox.html.erb +13 -0
- data/example/rails/cable/app/views/rooms/_online_people.html.erb +53 -0
- data/example/rails/cable/app/views/rooms/index.html.erb +9 -0
- data/example/rails/cable/bin/bundle +3 -0
- data/example/rails/cable/bin/rails +9 -0
- data/example/rails/cable/bin/rake +9 -0
- data/example/rails/cable/bin/setup +34 -0
- data/example/rails/cable/bin/spring +16 -0
- data/example/rails/cable/bin/update +29 -0
- data/example/rails/cable/config.ru +5 -0
- data/example/rails/cable/config/application.rb +16 -0
- data/example/rails/cable/config/boot.rb +3 -0
- data/example/rails/cable/config/cable.yml +9 -0
- data/example/rails/cable/config/database.yml +20 -0
- data/example/rails/cable/config/environment.rb +5 -0
- data/example/rails/cable/config/environments/development.rb +57 -0
- data/example/rails/cable/config/environments/production.rb +86 -0
- data/example/rails/cable/config/environments/test.rb +42 -0
- data/example/rails/cable/config/initializers/application_controller_renderer.rb +6 -0
- data/example/rails/cable/config/initializers/assets.rb +11 -0
- data/example/rails/cable/config/initializers/backtrace_silencers.rb +7 -0
- data/example/rails/cable/config/initializers/cookies_serializer.rb +5 -0
- data/example/rails/cable/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/rails/cable/config/initializers/inflections.rb +16 -0
- data/example/rails/cable/config/initializers/mime_types.rb +4 -0
- data/example/rails/cable/config/initializers/new_framework_defaults.rb +24 -0
- data/example/rails/cable/config/initializers/session_store.rb +3 -0
- data/example/rails/cable/config/initializers/sidekiq.rb +2 -0
- data/example/rails/cable/config/initializers/veritrans.rb +46 -0
- data/example/rails/cable/config/initializers/wrap_parameters.rb +14 -0
- data/example/rails/cable/config/locales/en.yml +23 -0
- data/example/rails/cable/config/puma.rb +47 -0
- data/example/rails/cable/config/routes.rb +18 -0
- data/example/rails/cable/config/secrets.yml +22 -0
- data/example/rails/cable/config/spring.rb +6 -0
- data/example/rails/cable/config/veritrans.yml +13 -0
- data/example/rails/cable/db/development.sqlite3 +0 -0
- data/example/rails/cable/db/migrate/20161215070044_create_chats.rb +10 -0
- data/example/rails/cable/db/migrate/20161215072021_create_users.rb +10 -0
- data/example/rails/cable/db/migrate/20161219110219_create_orders.rb +11 -0
- data/example/rails/cable/db/schema.rb +37 -0
- data/example/rails/cable/db/seeds.rb +41 -0
- data/example/rails/cable/db/test.sqlite3 +0 -0
- data/example/rails/cable/lib/assets/.keep +0 -0
- data/example/rails/cable/lib/tasks/.keep +0 -0
- data/example/rails/cable/public/404.html +67 -0
- data/example/rails/cable/public/422.html +67 -0
- data/example/rails/cable/public/500.html +66 -0
- data/example/rails/cable/public/apple-touch-icon-precomposed.png +0 -0
- data/example/rails/cable/public/apple-touch-icon.png +0 -0
- data/example/rails/cable/public/favicon.ico +0 -0
- data/example/rails/cable/public/images/avatar1.jpg +0 -0
- data/example/rails/cable/public/images/avatar2.jpg +0 -0
- data/example/rails/cable/public/images/avatar3.jpg +0 -0
- data/example/rails/cable/public/images/avatar4.jpg +0 -0
- data/example/rails/cable/public/images/avatar5.jpg +0 -0
- data/example/rails/cable/public/images/avatar6.jpg +0 -0
- data/example/rails/cable/public/robots.txt +5 -0
- data/example/rails/cable/vendor/assets/javascripts/.keep +0 -0
- data/example/rails/cable/vendor/assets/stylesheets/.keep +0 -0
- data/example/rails/cable/vendor/assets/stylesheets/photon.css +2333 -0
- data/example/rails/simplepay/Gemfile +54 -0
- data/example/rails/simplepay/Gemfile.lock +178 -0
- data/example/rails/simplepay/README.md +30 -0
- data/example/rails/simplepay/Rakefile +6 -0
- data/example/rails/simplepay/app/assets/config/manifest.js +3 -0
- data/example/rails/simplepay/app/assets/images/.keep +0 -0
- data/example/rails/simplepay/app/assets/javascripts/application.js +16 -0
- data/example/rails/simplepay/app/assets/javascripts/cable.js +13 -0
- data/example/rails/simplepay/app/assets/javascripts/channels/.keep +0 -0
- data/example/rails/simplepay/app/assets/javascripts/pay.js +18 -0
- data/example/rails/simplepay/app/assets/stylesheets/application.css +15 -0
- data/example/rails/simplepay/app/assets/stylesheets/style.css +254 -0
- data/example/rails/simplepay/app/channels/application_cable/channel.rb +4 -0
- data/example/rails/simplepay/app/channels/application_cable/connection.rb +4 -0
- data/example/rails/simplepay/app/controllers/application_controller.rb +3 -0
- data/example/rails/simplepay/app/controllers/concerns/.keep +0 -0
- data/example/rails/simplepay/app/controllers/home_controller.rb +16 -0
- data/example/rails/simplepay/app/controllers/pay_controller.rb +10 -0
- data/example/rails/simplepay/app/helpers/application_helper.rb +2 -0
- data/example/rails/simplepay/app/helpers/pay_helper.rb +2 -0
- data/example/rails/simplepay/app/jobs/application_job.rb +2 -0
- data/example/rails/simplepay/app/mailers/application_mailer.rb +4 -0
- data/example/rails/simplepay/app/models/application_record.rb +3 -0
- data/example/rails/simplepay/app/models/concerns/.keep +0 -0
- data/example/rails/simplepay/app/models/order.rb +2 -0
- data/example/rails/simplepay/app/views/home/index.html.erb +19 -0
- data/example/rails/simplepay/app/views/layouts/application.html.erb +15 -0
- data/example/rails/simplepay/app/views/layouts/mailer.html.erb +13 -0
- data/example/rails/simplepay/app/views/layouts/mailer.text.erb +1 -0
- data/example/rails/simplepay/app/views/pay/notify.html.erb +2 -0
- data/example/rails/simplepay/bin/bundle +3 -0
- data/example/rails/simplepay/bin/rails +9 -0
- data/example/rails/simplepay/bin/rake +9 -0
- data/example/rails/simplepay/bin/setup +34 -0
- data/example/rails/simplepay/bin/spring +16 -0
- data/example/rails/simplepay/bin/update +29 -0
- data/example/rails/simplepay/config.ru +5 -0
- data/example/rails/simplepay/config/application.rb +15 -0
- data/example/rails/simplepay/config/boot.rb +3 -0
- data/example/rails/simplepay/config/cable.yml +9 -0
- data/example/rails/simplepay/config/database.yml +25 -0
- data/example/rails/simplepay/config/environment.rb +5 -0
- data/example/rails/simplepay/config/environments/development.rb +57 -0
- data/example/rails/simplepay/config/environments/production.rb +86 -0
- data/example/rails/simplepay/config/environments/test.rb +42 -0
- data/example/rails/simplepay/config/initializers/application_controller_renderer.rb +6 -0
- data/example/rails/simplepay/config/initializers/assets.rb +11 -0
- data/example/rails/simplepay/config/initializers/backtrace_silencers.rb +7 -0
- data/example/rails/simplepay/config/initializers/cookies_serializer.rb +5 -0
- data/example/rails/simplepay/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/rails/simplepay/config/initializers/inflections.rb +16 -0
- data/example/rails/simplepay/config/initializers/mime_types.rb +4 -0
- data/example/rails/simplepay/config/initializers/new_framework_defaults.rb +24 -0
- data/example/rails/simplepay/config/initializers/session_store.rb +3 -0
- data/example/rails/simplepay/config/initializers/veritrans.rb +46 -0
- data/example/rails/simplepay/config/initializers/wrap_parameters.rb +14 -0
- data/example/rails/simplepay/config/locales/en.yml +23 -0
- data/example/rails/simplepay/config/puma.rb +47 -0
- data/example/rails/simplepay/config/routes.rb +5 -0
- data/example/rails/simplepay/config/secrets.yml +22 -0
- data/example/rails/simplepay/config/spring.rb +6 -0
- data/example/rails/simplepay/config/veritrans.yml +18 -0
- data/example/rails/simplepay/db/development.sqlite3 +0 -0
- data/example/rails/simplepay/db/migrate/20161221090855_create_orders.rb +10 -0
- data/example/rails/simplepay/db/schema.rb +22 -0
- data/example/rails/simplepay/db/seeds.rb +7 -0
- data/example/rails/simplepay/db/test.sqlite3 +0 -0
- data/example/rails/simplepay/lib/assets/.keep +0 -0
- data/example/rails/simplepay/lib/tasks/.keep +0 -0
- data/example/rails/simplepay/public/404.html +67 -0
- data/example/rails/simplepay/public/422.html +67 -0
- data/example/rails/simplepay/public/500.html +66 -0
- data/example/rails/simplepay/public/apple-touch-icon-precomposed.png +0 -0
- data/example/rails/simplepay/public/apple-touch-icon.png +0 -0
- data/example/rails/simplepay/public/favicon.ico +0 -0
- data/example/rails/simplepay/public/robots.txt +5 -0
- data/example/rails/simplepay/vendor/assets/javascripts/.keep +0 -0
- data/example/rails/simplepay/vendor/assets/stylesheets/.keep +0 -0
- data/example/{README.md → sinatra/README.md} +0 -0
- data/example/{config.ru → sinatra/config.ru} +3 -0
- data/example/{index.erb → sinatra/index.erb} +7 -6
- data/example/{localization.erb → sinatra/localization.erb} +6 -5
- data/example/{points.erb → sinatra/points.erb} +6 -5
- data/example/{recurring.erb → sinatra/recurring.erb} +6 -6
- data/example/{response.erb → sinatra/response.erb} +4 -1
- data/example/{sinatra.rb → sinatra/sinatra.rb} +9 -3
- data/example/{style.css → sinatra/style.css} +11 -0
- data/example/{veritrans.yml → sinatra/veritrans.yml} +2 -2
- data/example/{widget.erb → sinatra/widget.erb} +18 -6
- data/lib/generators/templates/assets/credit_card_form.js +6 -0
- data/lib/generators/templates/payments_controller.rb +4 -4
- data/lib/generators/templates/veritrans.yml +5 -5
- data/lib/generators/templates/views/_credit_card_form.erb +2 -2
- data/lib/generators/templates/views/_veritrans_include.erb +1 -1
- data/lib/generators/veritrans/install_generator.rb +1 -1
- data/lib/generators/veritrans/payment_form_generator.rb +1 -1
- data/lib/veritrans.rb +106 -5
- data/lib/veritrans/api.rb +7 -7
- data/lib/veritrans/cli.rb +11 -5
- data/lib/veritrans/client.rb +7 -4
- data/lib/veritrans/config.rb +5 -3
- data/lib/veritrans/events.rb +46 -35
- data/lib/veritrans/result.rb +58 -2
- data/lib/veritrans/testing.rb +156 -0
- data/lib/veritrans/version.rb +1 -1
- data/spec/cli_spec.rb +2 -2
- data/spec/fixtures/approve_failed.yml +1 -1
- data/spec/fixtures/cancel_failed.yml +1 -1
- data/spec/fixtures/cancel_success.yml +2 -2
- data/spec/fixtures/capture_failed.yml +1 -1
- data/spec/fixtures/charge.yml +2 -2
- data/spec/fixtures/charge_direct.yml +1 -1
- data/spec/fixtures/charge_vtweb.yml +2 -2
- data/spec/fixtures/cli_test_1111-not-exists.yml +1 -1
- data/spec/fixtures/cli_test_not_exists.yml +1 -1
- data/spec/fixtures/cli_test_real_txn.yml +1 -1
- data/spec/fixtures/cli_test_unauthorized.yml +1 -1
- data/spec/fixtures/events_test_real_txn.yml +1 -1
- data/spec/fixtures/expire_failed.yml +1 -1
- data/spec/fixtures/expire_success.yml +1 -1
- data/spec/fixtures/midtrans_status.yml +2 -2
- data/spec/fixtures/status_fail.yml +1 -1
- data/spec/fixtures/status_success.yml +2 -2
- data/spec/rails_plugin_spec.rb +37 -20
- data/spec/spec_helper.rb +0 -1
- data/spec/veritrans_client_spec.rb +1 -1
- data/spec/veritrans_config_spec.rb +1 -1
- data/spec/veritrans_events_spec.rb +6 -6
- data/spec/veritrans_testing_spec.rb +184 -0
- data/testing_webhooks.md +2 -2
- data/veritrans.gemspec +1 -1
- metadata +195 -16
- data/lib/veritrans/core_extensions.rb +0 -32
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class HomeController < ApplicationController
|
2
|
+
def index
|
3
|
+
@order = Order.create!(
|
4
|
+
price: (rand.round(6) * 1000).to_i * 1000
|
5
|
+
)
|
6
|
+
|
7
|
+
response = Veritrans.create_widget_token(
|
8
|
+
transaction_details: {
|
9
|
+
order_id: @order.id,
|
10
|
+
gross_amount: @order.price
|
11
|
+
}
|
12
|
+
)
|
13
|
+
|
14
|
+
@token = response.token_id
|
15
|
+
end
|
16
|
+
end
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class='cart'>
|
2
|
+
<%= hidden_field_tag :snap_token, @token %>
|
3
|
+
<div class='popup'>
|
4
|
+
<div class='row header'>
|
5
|
+
<span>Items</span>
|
6
|
+
<span>Amount</span>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class='row items'>
|
10
|
+
<span>2</span>
|
11
|
+
<span><%= @order.price %></span>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class='row checkout'>
|
15
|
+
<span><a href='#'>View Cart ></a></span>
|
16
|
+
<span class='checkout-button'>Checkout</span>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Simplepay</title>
|
5
|
+
<%= csrf_meta_tags %>
|
6
|
+
|
7
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
8
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
|
9
|
+
<script src="https://app.sandbox.midtrans.com/snap/snap.js"></script>
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<%= yield %>
|
14
|
+
</body>
|
15
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
begin
|
3
|
+
load File.expand_path('../spring', __FILE__)
|
4
|
+
rescue LoadError => e
|
5
|
+
raise unless e.message.include?('spring')
|
6
|
+
end
|
7
|
+
APP_PATH = File.expand_path('../config/application', __dir__)
|
8
|
+
require_relative '../config/boot'
|
9
|
+
require 'rails/commands'
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a starting point to setup your application.
|
15
|
+
# Add necessary setup steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
# puts "\n== Copying sample files =="
|
22
|
+
# unless File.exist?('config/database.yml')
|
23
|
+
# cp 'config/database.yml.sample', 'config/database.yml'
|
24
|
+
# end
|
25
|
+
|
26
|
+
puts "\n== Preparing database =="
|
27
|
+
system! 'bin/rails db:setup'
|
28
|
+
|
29
|
+
puts "\n== Removing old logs and tempfiles =="
|
30
|
+
system! 'bin/rails log:clear tmp:clear'
|
31
|
+
|
32
|
+
puts "\n== Restarting application server =="
|
33
|
+
system! 'bin/rails restart'
|
34
|
+
end
|
@@ -0,0 +1,16 @@
|
|
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
|
+
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
|
11
|
+
if spring = lockfile.specs.detect { |spec| spec.name == "spring" }
|
12
|
+
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
13
|
+
gem 'spring', spring.version
|
14
|
+
require 'spring/binstub'
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
include FileUtils
|
5
|
+
|
6
|
+
# path to your application root.
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
8
|
+
|
9
|
+
def system!(*args)
|
10
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
11
|
+
end
|
12
|
+
|
13
|
+
chdir APP_ROOT do
|
14
|
+
# This script is a way to update your development environment automatically.
|
15
|
+
# Add necessary update steps to this file.
|
16
|
+
|
17
|
+
puts '== Installing dependencies =='
|
18
|
+
system! 'gem install bundler --conservative'
|
19
|
+
system('bundle check') || system!('bundle install')
|
20
|
+
|
21
|
+
puts "\n== Updating database =="
|
22
|
+
system! 'bin/rails db:migrate'
|
23
|
+
|
24
|
+
puts "\n== Removing old logs and tempfiles =="
|
25
|
+
system! 'bin/rails log:clear tmp:clear'
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system! 'bin/rails restart'
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative 'boot'
|
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 Simplepay
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,57 @@
|
|
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.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
|
15
|
+
# Enable/disable caching. By default caching is disabled.
|
16
|
+
if Rails.root.join('tmp/caching-dev.txt').exist?
|
17
|
+
config.action_controller.perform_caching = true
|
18
|
+
|
19
|
+
config.cache_store = :memory_store
|
20
|
+
config.public_file_server.headers = {
|
21
|
+
'Cache-Control' => 'public, max-age=172800'
|
22
|
+
}
|
23
|
+
else
|
24
|
+
config.action_controller.perform_caching = false
|
25
|
+
|
26
|
+
config.cache_store = :null_store
|
27
|
+
end
|
28
|
+
|
29
|
+
# Don't care if the mailer can't send.
|
30
|
+
config.action_mailer.raise_delivery_errors = false
|
31
|
+
|
32
|
+
config.action_mailer.perform_caching = false
|
33
|
+
|
34
|
+
# Print deprecation notices to the Rails logger.
|
35
|
+
config.active_support.deprecation = :log
|
36
|
+
|
37
|
+
# Raise an error on page load if there are pending migrations.
|
38
|
+
config.active_record.migration_error = :page_load
|
39
|
+
|
40
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
41
|
+
# This option may cause significant delays in view rendering with a large
|
42
|
+
# number of complex assets.
|
43
|
+
config.assets.debug = true
|
44
|
+
|
45
|
+
# Suppress logger output for asset requests.
|
46
|
+
config.assets.quiet = true
|
47
|
+
|
48
|
+
# Raises error for missing translations
|
49
|
+
# config.action_view.raise_on_missing_translations = true
|
50
|
+
|
51
|
+
# Use an evented file watcher to asynchronously detect changes in source code,
|
52
|
+
# routes, locales, etc. This feature depends on the listen gem.
|
53
|
+
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
54
|
+
|
55
|
+
ENV['MIDTRANS_CLIENT_KEY'] = 'VT-client-IKktHiy3aRYHljsw'.freeze
|
56
|
+
ENV['MIDTRANS_SERVER_KEY'] = 'VT-server-7CVlR3AJ8Dpkez3k_TeGJQZU'.freeze
|
57
|
+
end
|
@@ -0,0 +1,86 @@
|
|
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
|
+
# Disable serving static files from the `/public` folder by default since
|
18
|
+
# Apache or NGINX already handles this.
|
19
|
+
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
20
|
+
|
21
|
+
# Compress JavaScripts and CSS.
|
22
|
+
config.assets.js_compressor = :uglifier
|
23
|
+
# config.assets.css_compressor = :sass
|
24
|
+
|
25
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
26
|
+
config.assets.compile = false
|
27
|
+
|
28
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
29
|
+
|
30
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
31
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
32
|
+
|
33
|
+
# Specifies the header that your server uses for sending files.
|
34
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
35
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
36
|
+
|
37
|
+
# Mount Action Cable outside main process or domain
|
38
|
+
# config.action_cable.mount_path = nil
|
39
|
+
# config.action_cable.url = 'wss://example.com/cable'
|
40
|
+
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
41
|
+
|
42
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
43
|
+
# config.force_ssl = true
|
44
|
+
|
45
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
46
|
+
# when problems arise.
|
47
|
+
config.log_level = :debug
|
48
|
+
|
49
|
+
# Prepend all log lines with the following tags.
|
50
|
+
config.log_tags = [ :request_id ]
|
51
|
+
|
52
|
+
# Use a different cache store in production.
|
53
|
+
# config.cache_store = :mem_cache_store
|
54
|
+
|
55
|
+
# Use a real queuing backend for Active Job (and separate queues per environment)
|
56
|
+
# config.active_job.queue_adapter = :resque
|
57
|
+
# config.active_job.queue_name_prefix = "simplepay_#{Rails.env}"
|
58
|
+
config.action_mailer.perform_caching = false
|
59
|
+
|
60
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
61
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
62
|
+
# config.action_mailer.raise_delivery_errors = false
|
63
|
+
|
64
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
65
|
+
# the I18n.default_locale when a translation cannot be found).
|
66
|
+
config.i18n.fallbacks = true
|
67
|
+
|
68
|
+
# Send deprecation notices to registered listeners.
|
69
|
+
config.active_support.deprecation = :notify
|
70
|
+
|
71
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
72
|
+
config.log_formatter = ::Logger::Formatter.new
|
73
|
+
|
74
|
+
# Use a different logger for distributed setups.
|
75
|
+
# require 'syslog/logger'
|
76
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
77
|
+
|
78
|
+
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
79
|
+
logger = ActiveSupport::Logger.new(STDOUT)
|
80
|
+
logger.formatter = config.log_formatter
|
81
|
+
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Do not dump schema after migrations.
|
85
|
+
config.active_record.dump_schema_after_migration = false
|
86
|
+
end
|