mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Flesh out monthly iDEAL donation flow.
This commit is contained in:
@@ -132,6 +132,12 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
|
||||
* completing a 3DS prompt or iDEAL prompt.
|
||||
*/
|
||||
private const val PENDING_3DS_DATA = "pending.3ds.data"
|
||||
|
||||
/**
|
||||
* Data about a monthly donation that required external verification and said verification was successful.
|
||||
* Needed to show donation pending sheet after returning to Signal.
|
||||
*/
|
||||
private const val VERIFIED_IDEAL_SUBSCRIPTION_3DS_DATA = "donation.verified_ideal_subscription_3ds_data"
|
||||
}
|
||||
|
||||
override fun onFirstEverAppLaunch() = Unit
|
||||
@@ -584,6 +590,27 @@ internal class DonationsValues internal constructor(store: KeyValueStore) : Sign
|
||||
}
|
||||
}
|
||||
|
||||
fun consumeVerifiedSubscription3DSData(): Stripe3DSData? {
|
||||
synchronized(this) {
|
||||
val data = getBlob(VERIFIED_IDEAL_SUBSCRIPTION_3DS_DATA, null)?.let {
|
||||
Stripe3DSData.fromProtoBytes(it, -1)
|
||||
}
|
||||
|
||||
setVerifiedSubscription3DSData(null)
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
fun setVerifiedSubscription3DSData(stripe3DSData: Stripe3DSData?) {
|
||||
synchronized(this) {
|
||||
if (stripe3DSData != null) {
|
||||
putBlob(VERIFIED_IDEAL_SUBSCRIPTION_3DS_DATA, stripe3DSData.toProtoBytes())
|
||||
} else {
|
||||
remove(VERIFIED_IDEAL_SUBSCRIPTION_3DS_DATA)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun generateRequestCredential(): ReceiptCredentialRequestContext {
|
||||
Log.d(TAG, "Generating request credentials context for token redemption...", true)
|
||||
val secureRandom = SecureRandom()
|
||||
|
||||
Reference in New Issue
Block a user