Search in sources :

Example 1 with PaymentsAvailability

use of org.thoughtcrime.securesms.keyvalue.PaymentsAvailability in project Signal-Android by signalapp.

the class PaymentsHomeViewModel method getPaymentsState.

private static PaymentsHomeState.PaymentsState getPaymentsState() {
    PaymentsValues paymentsValues = SignalStore.paymentsValues();
    PaymentsAvailability paymentsAvailability = paymentsValues.getPaymentsAvailability();
    if (paymentsAvailability.canRegister()) {
        return PaymentsHomeState.PaymentsState.NOT_ACTIVATED;
    } else if (paymentsAvailability.isEnabled()) {
        return PaymentsHomeState.PaymentsState.ACTIVATED;
    } else {
        return PaymentsHomeState.PaymentsState.ACTIVATE_NOT_ALLOWED;
    }
}
Also used : PaymentsValues(org.thoughtcrime.securesms.keyvalue.PaymentsValues) PaymentsAvailability(org.thoughtcrime.securesms.keyvalue.PaymentsAvailability)

Example 2 with PaymentsAvailability

use of org.thoughtcrime.securesms.keyvalue.PaymentsAvailability in project Signal-Android by WhisperSystems.

the class PaymentsHomeViewModel method getPaymentsState.

private static PaymentsHomeState.PaymentsState getPaymentsState() {
    PaymentsValues paymentsValues = SignalStore.paymentsValues();
    PaymentsAvailability paymentsAvailability = paymentsValues.getPaymentsAvailability();
    if (paymentsAvailability.canRegister()) {
        return PaymentsHomeState.PaymentsState.NOT_ACTIVATED;
    } else if (paymentsAvailability.isEnabled()) {
        return PaymentsHomeState.PaymentsState.ACTIVATED;
    } else {
        return PaymentsHomeState.PaymentsState.ACTIVATE_NOT_ALLOWED;
    }
}
Also used : PaymentsValues(org.thoughtcrime.securesms.keyvalue.PaymentsValues) PaymentsAvailability(org.thoughtcrime.securesms.keyvalue.PaymentsAvailability)

Aggregations

PaymentsAvailability (org.thoughtcrime.securesms.keyvalue.PaymentsAvailability)2 PaymentsValues (org.thoughtcrime.securesms.keyvalue.PaymentsValues)2