Exemple #1
0
        public async Task CobGetByTxId()
        {
            var cobRequest = new CobRequestService();
            var cb         = await cobRequest.GetByTxId("39088ca5f6a94069b541d1b7347a918a");

            Assert.IsFalse(string.IsNullOrEmpty(cb?.Txid));
        }
Exemple #2
0
        public async Task CobGetByPeriod()
        {
            var cobRequest = new CobRequestService();
            var cb         = await cobRequest.GetByPeriod(DateTime.Today);

            Assert.IsTrue(cb.Parametros.Paginacao != null);
        }
Exemple #3
0
        public async Task QrCodeGetDynamic()
        {
            var cobRequest = new CobRequestService();

            var cob = await cobRequest.GetByTxId("496b0fd872ba49a0ad5b55572debdabf");

            var payload = cob.ToPayload(new Merchant("Alexandre Lima", "Presidente Prudente"));

            var stringToQrCode = payload.GenerateStringToQrCode();

            Assert.IsFalse(string.IsNullOrEmpty(stringToQrCode));
        }
Exemple #4
0
        public async Task CobCreate()
        {
            var cob = new CobRequest(_chave: "1b0e2743-0769-4f21-b0b7-9cfddb2a5a2b")
            {
                Calendario = new Calendario
                {
                    Expiracao = 3600
                },
                Devedor = new Devedor
                {
                    Cpf  = "12345678909",
                    Nome = "Francisco da Silva",
                },
                Valor = new Valor
                {
                    Original = "1.00"
                },
                SolicitacaoPagador = "Serviço realizado.",
                InfoAdicionais     = new System.Collections.Generic.List <InfoAdicional>
                {
                    new InfoAdicional
                    {
                        Nome  = "Campo 1",
                        Valor = "Informação Adicional1 do PSP-Recebedor"
                    },
                    new InfoAdicional
                    {
                        Nome  = "Campo 2",
                        Valor = "Informação Adicional2 do PSP-Recebedor"
                    }
                }
            };

            var cobRequest = new CobRequestService();

            var cb = await cobRequest.Create(System.Guid.NewGuid().ToString("N"), cob);

            Assert.IsFalse(string.IsNullOrEmpty(cb?.Txid));
        }