Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/controllers/welcome_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class WelcomeController < ApplicationController

def index

end

end
27 changes: 27 additions & 0 deletions app/views/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Welcome to Acme API.

The URI for posting a payment is '/api/v1/subscriptions'

We've provided a sample POST request body for an idea on how to format your JSON POST Request


Sample POST Request body

{
"customer": {
"first_name": "Jim",
"last_name": "Jones",
"address": "2120 Wimbeldon Court",
"city": "Modesto",
"state": "CA",
"zip": 95355
},
"amount": "4900",
"card_number": "42424242424242420",
"cvv": "123",
"expiration_month": "01",
"expiration_year": "2024",
"zip_code": "11754",
"plan_id": 2

}
14 changes: 14 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Acme API</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>

<%= yield %>

</body>
</html>
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root :to => 'home#index'
root :to => 'welcome#index'
namespace :api do
namespace :v1 do
resources :subscriptions, only: [:create, :show]
Expand Down