createSale method

Future<Sale?> createSale(
  1. Sale sale
)

Criando uma transação de compra

Implementation

Future<Sale?> createSale(Sale sale) async {
  try {
    Response response = await dio.post("${environment!.apiUrl}/1/sales/",
        data: sale.toJson());

    return Sale.fromJson(response.data);
  } on DioError catch (e) {
    _getErrorDio(e);
  } on CieloException catch (e) {
    _getErrorCieloException(e);
  }

  return null;
}