click_gerencianet 0.0.2 copy "click_gerencianet: ^0.0.2" to clipboard
click_gerencianet: ^0.0.2 copied to clipboard

unlistedoutdated

Com este package é possivel criar pix e consultar se o mesmo foi pago no gerencianet

example/click_gerencianet_example.dart

import 'package:click_gerencianet/click_gerencianet.dart';
import 'package:click_gerencianet/src/gerencianet/models/configuration_model.dart';

Future<void> main() async {
  var gn = GerencianetRestClient(
    config: ConfigurationModel(
        chavePix: 'sua chave pix',
        clientId: 'Client_Id',
        clientSecret: 'Client_Secret',
        pathCertificadoCRT: 'C:\\certificates\\prod\\pix.crt.pem',
        pathCertificadoKEY: 'C:\\certificates\\prod\\pix.key.pem',
        certificadoPassword: "1234",
        pixRecebedor: 'SUSELEI',
        cidade: 'PARATI'),
  );

  print(await gn.gerarPixCopiaCola(descricao1: 'pagamento teste', valor: 100, txId: '123123123'));

  //print('Consultando se o pix txId 436002981 foi pago...');
  //final pix = await gn.checkPayment(
  //    txId: '436002981', start: DateTime.now().firstDayOfMonth(), end: DateTime.now().lastSecondOfDay);
  //
  // if (pix == null) {
  //   print('o pagamento não foi encontrado');
  // } else {
  //   print(pix.toString());
  // }

  // // Inicia a função de espera pelo pagamento em segundo plano
  // print('verificando se o pix caiu...');
  // final waitForPaymentFuture = gn.waitForPayment(txId: '436002981');

  // // Espera por 30 segundos antes de abortar a função
  // print('aguardando 30 segundos...');
  // await Future.delayed(Duration(seconds: 30));
  // print('abortando...');
  // gn.abortWaitPayment();

  // // Espera a função de espera pelo pagamento concluir sua execução
  // print('esperando retorno:');
  // final pix = await waitForPaymentFuture;

  // if (pix == null) {
  //   print('pagamento não efetuado');
  // } else {
  //   print(pix.toString());
  // }

  //print('testando...: ${await gn.auth().get('/v2/pix?inicio=2023-04-10T00:00:00Z&fim=2023-04-14T23:59:59Z')}');
}
0
likes
0
points
172
downloads

Publisher

verified publisherclicksi.com.br

Weekly Downloads

Com este package é possivel criar pix e consultar se o mesmo foi pago no gerencianet

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

click_extensions, click_functions_helper, collection, dio, dio_http2_adapter, image, path, qr_image

More

Packages that depend on click_gerencianet