java
@Log4j2
@Service
@AllArgsConstructor(onConstructor = @__(@Autowired))
public class PixService {
Gerencianet gerencianet;
public void createTransaction(double amount, String key) {
val body = new JSONObject();
body.put("calendario", new JSONObject().put("expiracao", "3600"));
body.put("valor", new JSONObject().put("original", amount));
body.put("chave", key);
try {
JSONObject response = gerencianet.call("https://api-pix.gerencianet.com.br/v2/cob", new HashMap<>(), body);
System.out.println(response);
} catch (Throwable throwable) {
log.error("Falha ao criar transação.", throwable);
}
}
}
@Log4j2
@Service
@AllArgsConstructor(onConstructor = @__(@Autowired))
public class PixService {
Gerencianet gerencianet;
public void createTransaction(double amount, String key) {
val body = new JSONObject();
body.put("calendario", new JSONObject().put("expiracao", "3600"));
body.put("valor", new JSONObject().put("original", amount));
body.put("chave", key);
try {
JSONObject response = gerencianet.call("https://api-pix.gerencianet.com.br/v2/cob", new HashMap<>(), body);
System.out.println(response);
} catch (Throwable throwable) {
log.error("Falha ao criar transação.", throwable);
}
}
}
alguém poderia me ajudar? está dando um erro cuja mensagem é
nonexistent endpoint