public IndexModule(IPbApiClient pbApiClient, IEntryPoint entryPoint, IConnectToBilling billingConnector)
        {
            Get["/"] = parameters =>
            {
                var token = Context.AuthorizationHeaderToken();
                var metaData = pbApiClient.Get<ApiMetaData>(token, "getUserMetaData");

                return Response.AsJson(metaData);
            };

            Post["/action/{action}"] = parameters =>
            {
                var token = Context.AuthorizationHeaderToken();
                var packageResponse = pbApiClient.Get<Package>(token, "package/" + parameters.action);

                var package = Mapper.DynamicMap<IPackage>(packageResponse);
                var vehicle = this.Bind<Vechicle>();
                var request = new LicensePlateNumberRequest(package, new User(), new Context(), vehicle, new AggregationInformation());
                var responses = entryPoint.GetResponsesFromLace(request);

                var packageIdentifier = new PackageIdentifier(packageResponse.Id, new VersionIdentifier(1));
                var requestIdentifier = new RequestIdentifier(Guid.NewGuid(), SystemIdentifier.CreateApi());
                var userIdentifier = new UserIdentifier(((IEntity)Context.CurrentUser).Id);
                var transactionContext = new TransactionContext(Guid.NewGuid(), userIdentifier, requestIdentifier);
                var createTransaction = new CreateTransaction(packageIdentifier, transactionContext);
                billingConnector.CreateTransaction(createTransaction);

                return Response.AsJson(responses.First().Response);
            };
        }
        public BillingConnectorResponse CreateTransaction(CreateTransaction transaction)
        {
            log.InfoFormat("Creating a transaction via the billing API at {0} with segment {1}", configuration.Url,
                urlBuilder.CreateTransactionSegment());

            var postRequest = new RestRequest(urlBuilder.CreateTransactionSegment())
            {
                RequestFormat = DataFormat.Json,
                
            };
            postRequest.AddHeader("Content-Type", "application/json");
            postRequest.AddBody(transaction);

            var response = PostApi(urlBuilder.CreateTransactionSegment(), postRequest);

            log.InfoFormat("Creating a transaction via the billing API at {0} completed. The response was {1}", configuration.Url, response);

            return response;
        }
 public BillingConnectorResponse CreateTransaction(CreateTransaction transaction)
 {
     throw new System.NotImplementedException();
 }