From 1004640331d48403b134838248c039169ca5f2a5 Mon Sep 17 00:00:00 2001 From: Timothy Joo Date: Fri, 7 Sep 2018 16:08:16 -0500 Subject: [PATCH] Swap out puts error messages for render json responsej --- app/controllers/api/v1/subscriptions_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/subscriptions_controller.rb b/app/controllers/api/v1/subscriptions_controller.rb index ad08f6b..31f1ba6 100644 --- a/app/controllers/api/v1/subscriptions_controller.rb +++ b/app/controllers/api/v1/subscriptions_controller.rb @@ -10,9 +10,10 @@ def check_error(object) FakepayService.check_amount_with_plan(params) formatted = FakepayService.parse_json(object) if formatted[:success] == false - puts "Your transaction failed due to error code: #{formatted[:error_code]}. Please check the error code description" + render json: {"Your transaction failed due to error code: #{formatted[:error_code]}. Please check the error code description"} + # puts "Your transaction failed due to error code: #{formatted[:error_code]}. Please check the error code description" elsif formatted[:success] == true - puts "Your transaction was successfully posted!" + render json: {"Your transaction was successfully posted!"} Customer.store_token(formatted, params, customer_params) else puts formatted