From b6292e2723e94fc1c6d310722ec313bbfc759b03 Mon Sep 17 00:00:00 2001 From: Steve Pettitt Date: Sun, 18 Sep 2016 10:26:31 +0100 Subject: [PATCH] Add some logic to check for a connected Stripe Account in form --- .../admin/enterprises/form/_stripe_connect.html.haml | 11 ++++++----- config/routes.rb | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/admin/enterprises/form/_stripe_connect.html.haml b/app/views/admin/enterprises/form/_stripe_connect.html.haml index 2ced1eeff3..acc36ff87d 100644 --- a/app/views/admin/enterprises/form/_stripe_connect.html.haml +++ b/app/views/admin/enterprises/form/_stripe_connect.html.haml @@ -1,6 +1,7 @@ --# if @enterprise.has_stripe_connection? - -# Display Stripe account details --# else - -%a.stripe-connect{href: 'stripe_connect'} +- if stripe_account = @enterprise.stripe_account + = t :stripe_account_connected + = stripe_account.inspect + .span (Link to disconnect Stripe Acct) +- else + %a.stripe-connect{href: 'stripe_connect'} .span= t :connect_with_stripe diff --git a/config/routes.rb b/config/routes.rb index 404214f2f2..1e6f681f8b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,6 +72,7 @@ Openfoodnetwork::Application.routes.draw do post :search get :check_permalink end + member do get :shop @@ -102,6 +103,7 @@ Openfoodnetwork::Application.routes.draw do get "/stripe_connect", to: "enterprises#stripe_connect" + member do get :welcome put :register