From 636692f9921bd695d726695d2d46c91f5a6e56f3 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 11 Apr 2014 10:03:19 +0200 Subject: move engines into engines directory Also renamed help to support so it's harder to confuse it with documentation --- billing/lib/braintree_test_app.rb | 36 ---------------------------------- billing/lib/leap_web_billing.rb | 4 ---- billing/lib/leap_web_billing/engine.rb | 10 ---------- 3 files changed, 50 deletions(-) delete mode 100644 billing/lib/braintree_test_app.rb delete mode 100644 billing/lib/leap_web_billing.rb delete mode 100644 billing/lib/leap_web_billing/engine.rb (limited to 'billing/lib') diff --git a/billing/lib/braintree_test_app.rb b/billing/lib/braintree_test_app.rb deleted file mode 100644 index 41c327d..0000000 --- a/billing/lib/braintree_test_app.rb +++ /dev/null @@ -1,36 +0,0 @@ -# RackTest assumes all requests to be local. -# Braintree requests need to go out to a different server though. -# So we use a middleware to catch these and send them out again. - -class BraintreeTestApp - def initialize(app) - @app = app - end - - def call(env) - @env = env - config = Braintree::Configuration.instantiate - if request.path =~ /\/merchants\/#{config.merchant_id}\/transparent_redirect_requests$/ - #proxy post to braintree - uri = URI.parse(config.protocol + "://" + config.server + ":" + - config.port.to_s + request.path) - http = Net::HTTP.new(uri.host, uri.port) - res = http.post(uri.path, request.body.read) - - if res.code == "303" - header_hash = res.header.to_hash - header_hash["location"].first.gsub!("http://localhost:3000/", "http://www.example.com/") - [303, {"location" => header_hash["location"].first}, ""] - else - raise "unexpected response from Braintree: expected a 303" - end - else - @app.call(env) - end - end - - def request - @request = Rack::Request.new(@env) - end -end - diff --git a/billing/lib/leap_web_billing.rb b/billing/lib/leap_web_billing.rb deleted file mode 100644 index 288d846..0000000 --- a/billing/lib/leap_web_billing.rb +++ /dev/null @@ -1,4 +0,0 @@ -require "leap_web_billing/engine" - -module LeapWebBilling -end diff --git a/billing/lib/leap_web_billing/engine.rb b/billing/lib/leap_web_billing/engine.rb deleted file mode 100644 index ab574f2..0000000 --- a/billing/lib/leap_web_billing/engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# thou shall require all your dependencies in an engine. -#require "braintree-rails" -require "braintree" -#require "carmen-rails" - -module LeapWebBilling - class Engine < ::Rails::Engine - - end -end -- cgit v1.2.3