class Family::Admissions::Payjunction::TransactionsController < Family::Admissions::Controller
  def create
    response = transaction_service
    if response[:success]
      render_success :ok, json: response
    else
      render_error :unprocessable_entity, errors: response[:error]
    end
  end

  private
    def transaction_service
      Payjunction::TransactionService.call(current_school, current_family, params)
    end
end
