Created
May 28, 2018 20:00
-
-
Save kennyhorna/b909a74828fc8ac1edb93302a9e5a50e to your computer and use it in GitHub Desktop.
Método en Android para generar token de tarjeta CULQI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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