Get configuration from server

This commit is contained in:
adam.harbas@a-net.ba
2016-01-06 08:40:27 +01:00
parent 2b51dfcdec
commit ecd4d79ff2
2 changed files with 23 additions and 6 deletions

View File

@@ -55,7 +55,7 @@ post '/cart/delivery_destination', &update_delivery_destination
def report_to_trello(cart)
Thread.new do
Thread.new do
@cart = cart
board = Trello::Board.find(RibicaConfig.TRELLO_BOARD_NAME)
list = board.lists.first
@@ -69,9 +69,9 @@ def report_to_trello(cart)
end
def send_order_email(cart)
Thread.new do
Thread.new do
client = SendGrid::Client.new(
api_user: RibicaConfig.SENDGRID_API_USER,
api_user: RibicaConfig.SENDGRID_API_USER,
api_key: RibicaConfig.SENDGRID_API_KEY
)
@@ -101,3 +101,12 @@ post '/cart/confirmation' do
send_order_email(cart)
"OK".to_json
end
get '/cart/configuration' do
configuration = {}
configuration['bam_to_euro_rate'] = Helper::get_bam_to_euro_conversion_rate
configuration['root_address'] = RibicaConfig::ROOT_ADDRESS
configuration.to_json
end