mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Add blocked regions from global config for donations payments.
This commit is contained in:
@@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.components.settings.app.subscription
|
||||
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||
import org.thoughtcrime.securesms.util.LocaleFeatureFlags
|
||||
import org.thoughtcrime.securesms.util.PlayServicesUtil
|
||||
|
||||
/**
|
||||
@@ -17,14 +18,14 @@ object InAppDonations {
|
||||
* - Able to use PayPal and is in a region where it is able to be accepted.
|
||||
*/
|
||||
fun hasAtLeastOnePaymentMethodAvailable(): Boolean {
|
||||
return isCreditCardAvailable() || isPayPalAvailable() || isPlayServicesAvailable()
|
||||
return isCreditCardAvailable() || isPayPalAvailable() || isGooglePayAvailable()
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user is in a region that supports credit cards, based off local phone number.
|
||||
*/
|
||||
fun isCreditCardAvailable(): Boolean {
|
||||
return FeatureFlags.creditCardPayments()
|
||||
return FeatureFlags.creditCardPayments() && !LocaleFeatureFlags.isCreditCardDisabled()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,6 +35,13 @@ object InAppDonations {
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the user is in a region that supports GooglePay, based off local phone number.
|
||||
*/
|
||||
private fun isGooglePayAvailable(): Boolean {
|
||||
return isPlayServicesAvailable() && !LocaleFeatureFlags.isGooglePayDisabled()
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether Play Services is available. This will *not* tell you whether a user has Google Pay set up, but is
|
||||
* enough information to determine whether we can display Google Pay as an option.
|
||||
|
||||
Reference in New Issue
Block a user