Tokenisation - AEVI-AppFlow/pos-android-sdk GitHub Wiki

Request that a token is generated. The source of the token and method used to generate it is typically application specific. For the most case the source of the token is a payment card.

If you require additional data for your use case / scenario, please contact AEVI to discuss.

See Handling Card Tokens for general information about tokens.

Create Request

Request tokenisationRequest = new Request("tokenisation");

// If the request has an amount associated with it
tokenisationRequest.addAdditionalData("amount", new Amount(amountValue, currency));

Create Response

// If your app requires an amount to process the request,
Amount tokenisationAmount = tokenisationRequest.getRequestData().getValue("amount", Amount.class)
...
Response tokenisationResponse = new Response(tokenisationRequest, <outcome>, "Outcome message");
// If a token was successfully generated
Token token = new Token(tokenValue, tokenSource);
tokenisationResponse.addAdditionalData("token", token);

Parse Response

if (tokenisationResponse.wasSuccessful()) {
    Token token = tokenisationResponse.getResponseData().getValue("token", Token.class);
    String tokenValue = token.getValue();
}
⚠️ **GitHub.com Fallback** ⚠️