Skip to content

Instantly share code, notes, and snippets.

@kennyhorna
Created May 28, 2018 20:00
Show Gist options
  • Save kennyhorna/b909a74828fc8ac1edb93302a9e5a50e to your computer and use it in GitHub Desktop.
Save kennyhorna/b909a74828fc8ac1edb93302a9e5a50e to your computer and use it in GitHub Desktop.
Método en Android para generar token de tarjeta CULQI
Card card = new Card(“411111111111111”, “123”, 9, 2020, “[email protected]”); // LOS DATOS DE LA TARJETA, SE TIENE QUE PONER EL EMAIL
Token token = new Token("{CODIGO COMERCIO}"); // ACÁ VA LA LLAVE PÚBLICA DE CULQI,
token.createToken(getApplicationContext(), card, new TokenCallback() {
@Override
public void onSuccess(JSONObject token) {
// get Token
token.get("id").toString() // ESTE TOKEN ES EL QUE TIENES QUE ENVIAR AL API (COMO "token_id")
}
@Override
public void onError(Exception error) {
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment