public async Task UpdateCommercialEstablishmentTest()
        {
            var paymentSchemes = new List <string>
            {
                "VCC"
            };
            var cnpj        = "54762153000103";
            var bankAccount = new BankAccount
            {
                Branch         = "1144",
                Account        = "13341",
                AccountDigit   = "X5",
                AccountType    = BankAccountType.CC,
                Ispb           = "12345678",
                DocumentType   = DocumentType.CNPJ,
                DocumentNumber = cnpj
            };
            var cmEstab = new CommercialEstablishmentUpdateInput
            {
                PaymentSchemes = (paymentSchemes),
                BankAccount    = (bankAccount),
                Enabled        = (true)
            };
            var cmEstabReq = new CommercialEstablishmentUpdateRequest
            {
                CommercialEstablishment = (cmEstab)
            };

            var result = await _cEstablishmentService.UpdateCommercialEstablishments(cnpj, cmEstabReq);

            Print(result);
        }
예제 #2
0
        public async Task <BaseResponse> UpdateCommercialEstablishments(string docNumber, CommercialEstablishmentUpdateRequest cEstablishmentReq)
        {
            var request = new RestRequest($"{Options.BaseUrl}/{_path}/{docNumber}", DataFormat.Json)
            {
                Method = Method.GET
            };

            request.AddJsonBody(cEstablishmentReq);

            return(await GetPipeline <BaseResponse>().Execute(new Commands.RequestCommand <BaseResponse>()
            {
                Model = cEstablishmentReq,
                RestRequest = request,
                Profile = _baseProfile
            }).MapResponse());
        }