Credentials credentials = new Credentials();
HashMap options = new HashMap();
options.put("client_id", credentials.getClientId());
options.put("client_secret", credentials.getClientSecret());
options.put("certificate", credentials.getCertificate());
options.put("sandbox", credentials.isSandbox());
HashMap params = new HashMap();
params.put("idEnvio", "12453567890123456789");
Map body = new HashMap();
body.put("valor", "99.99");
Map pagador = new HashMap();
pagador.put("chave", "Insira_aqui_sua_chave");
body.put("pagador", pagador);
Map favorecido = new HashMap();
favorecido.put("chave", "joã
[email protected]");
body.put("favorecido", favorecido);
try {
EfiPay efi= new EfiPay(options);
Map response = efi.call("pixSend", params, body);
System.out.println(response);
}catch (EfiPayException e){
System.out.println(e.getError());
System.out.println(e.getErrorDescription());
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}