kopia lustrzana https://github.com/ryukoposting/Signal-Android
Increase logging in Boost codepath.
rodzic
5d6b3a8a75
commit
55aff18b1f
|
@ -91,9 +91,9 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
|
||||||
return stripeApi.createPaymentIntent(price)
|
return stripeApi.createPaymentIntent(price)
|
||||||
.flatMapCompletable { result ->
|
.flatMapCompletable { result ->
|
||||||
when (result) {
|
when (result) {
|
||||||
is StripeApi.CreatePaymentIntentResult.AmountIsTooSmall -> Completable.error(Exception("Amount is too small"))
|
is StripeApi.CreatePaymentIntentResult.AmountIsTooSmall -> Completable.error(Exception("Boost amount is too small"))
|
||||||
is StripeApi.CreatePaymentIntentResult.AmountIsTooLarge -> Completable.error(Exception("Amount is too large"))
|
is StripeApi.CreatePaymentIntentResult.AmountIsTooLarge -> Completable.error(Exception("Boost amount is too large"))
|
||||||
is StripeApi.CreatePaymentIntentResult.CurrencyIsNotSupported -> Completable.error(Exception("Currency is not supported"))
|
is StripeApi.CreatePaymentIntentResult.CurrencyIsNotSupported -> Completable.error(Exception("Boost currency is not supported"))
|
||||||
is StripeApi.CreatePaymentIntentResult.Success -> confirmPayment(paymentData, result.paymentIntent)
|
is StripeApi.CreatePaymentIntentResult.Success -> confirmPayment(paymentData, result.paymentIntent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,15 +147,15 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
|
||||||
if (countDownLatch.await(10, TimeUnit.SECONDS)) {
|
if (countDownLatch.await(10, TimeUnit.SECONDS)) {
|
||||||
when (finalJobState) {
|
when (finalJobState) {
|
||||||
JobTracker.JobState.SUCCESS -> {
|
JobTracker.JobState.SUCCESS -> {
|
||||||
Log.d(TAG, "Request response job chain succeeded.", true)
|
Log.d(TAG, "Boost request response job chain succeeded.", true)
|
||||||
it.onComplete()
|
it.onComplete()
|
||||||
}
|
}
|
||||||
JobTracker.JobState.FAILURE -> {
|
JobTracker.JobState.FAILURE -> {
|
||||||
Log.d(TAG, "Request response job chain failed permanently.", true)
|
Log.d(TAG, "Boost request response job chain failed permanently.", true)
|
||||||
it.onError(DonationExceptions.RedemptionFailed)
|
it.onError(DonationExceptions.RedemptionFailed)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Log.d(TAG, "Request response job chain ignored due to in-progress jobs.", true)
|
Log.d(TAG, "Boost request response job chain ignored due to in-progress jobs.", true)
|
||||||
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,24 +215,24 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
|
||||||
if (countDownLatch.await(10, TimeUnit.SECONDS)) {
|
if (countDownLatch.await(10, TimeUnit.SECONDS)) {
|
||||||
when (finalJobState) {
|
when (finalJobState) {
|
||||||
JobTracker.JobState.SUCCESS -> {
|
JobTracker.JobState.SUCCESS -> {
|
||||||
Log.d(TAG, "Request response job chain succeeded.", true)
|
Log.d(TAG, "Subscription request response job chain succeeded.", true)
|
||||||
it.onComplete()
|
it.onComplete()
|
||||||
}
|
}
|
||||||
JobTracker.JobState.FAILURE -> {
|
JobTracker.JobState.FAILURE -> {
|
||||||
Log.d(TAG, "Request response job chain failed permanently.", true)
|
Log.d(TAG, "Subscription request response job chain failed permanently.", true)
|
||||||
it.onError(DonationExceptions.RedemptionFailed)
|
it.onError(DonationExceptions.RedemptionFailed)
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
Log.d(TAG, "Request response job chain ignored due to in-progress jobs.", true)
|
Log.d(TAG, "Subscription request response job chain ignored due to in-progress jobs.", true)
|
||||||
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "Request response job timed out.", true)
|
Log.d(TAG, "Subscription request response job timed out.", true)
|
||||||
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
||||||
}
|
}
|
||||||
} catch (e: InterruptedException) {
|
} catch (e: InterruptedException) {
|
||||||
Log.w(TAG, "Request response interrupted.", e, true)
|
Log.w(TAG, "Subscription request response interrupted.", e, true)
|
||||||
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
it.onError(DonationExceptions.TimedOutWaitingForTokenRedemption)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue