Control: life cycle operation
Last updated
Was this helpful?
Was this helpful?
// relevant only in case SCHEME is VISA, for MASTERCARD put empty string
let tokenRequestorId = "40010030273" // Apple Pay for Visa
let scheme = "SCHEME" // VISA, MASTERCARD, AMEX
let authorizationCode = "<JWT>" // provide JWT value related to particular card, retrieved from issuer backend
let tokenId = pass.secureElementPass?.deviceAccountIdentifier // it can also be retrieved from: `Token.id`
TPCSDK.updateTokenState(tokenId: tokenId,
tokenRequestorId: tokenRequestorId,
schemeString: scheme,
authorizationCode: authorizationCode,
action: .Activate) { success, error in
if let error = error {
// handle TPC Error
} else if success {
// todo: refresh UI to indicate state of the card digitization
}
}// relevant only in case SCHEME is VISA, for MASTERCARD put empty string
String tokenRequestorId = "40010075001"; // for Google Pay or "40010043095" for Samsung Pay
String tokenId = "tokenId";
String scheme = "SCHEME"; // VISA, MASTERCARD
String authorizationCode = "<JWT>"; // provide JWT value related to particular card, retrieved from issuer backend
TPCManager.getInstance().getTSHProxy().updateTokenState(tokenId,
tokenRequestorId,
scheme,
authorizationCode,
TokenAction.ACTIVATE,
new TPCSDKListener<Boolean>() {
@Override
public void onStart() {
// on start
}
@Override
public void onSuccess(TPCResult<Boolean> result) {
Log.i(TAG, "Token State Updated");
Boolean status = result.getResult();
// TODO: refresh UI for new status
}
@Override
public void onError(TPCSDKException exception) {
Log.e("TAG", "updateTokenState request Error = " + exception.getMessage());
}
});