Replenish payment keys
Last updated
Was this helpful?
Was this helpful?
private void replenishment(String cardIdToReplenish, boolean isForced) {
/**
* Visa may require device authentication during replenishment.
* The issuer application may need to check whether it is in the
* background or foreground.
*/
DeviceAuthenticationCallback cvmCallback = new DeviceAuthenticationCallback() {
@Override
public void onSuccess() {
// User authentication succeeded.
}
@Override
public void onFailed() {
// User authentication failed. The issuer application may ask the
// end user to retry.
}
@Override
public void onHelp(int fpCode, @NonNull CharSequence fpDetail) {
// For biometric only.
// The issuer application may show the fpDetail message to the
// end user.
}
@Override
public void onError(int fpErrorCode) {
// For biometric only.
// An error occurred during biometric authentication, for example
// if the wrong finger is used too many times and the sensor locks.
// Depending on fpErrorCode, the issuer application should guide
// the end user.
}
};
if (cardIdToReplenish != null) {
D1PayWallet d1PayWallet = d1Task.getD1PayWallet();
d1PayWallet.replenish(cardIdToReplenish, isForced, cvmCallback,
new D1Task.Callback<Void>() {
@Override
public void onSuccess(Void ignored) {
// Replenishment completed.
}
@Override
public void onError(@NonNull D1Exception exception) {
// Refer to the D1 SDK error management section.
}
});
}
}