Send user an email after Stripe completes payment for boosts.

This commit is contained in:
Alex Hart
2021-11-15 13:48:19 -04:00
committed by GitHub
parent b0f43535c6
commit 882bdcc726
8 changed files with 33 additions and 11 deletions

View File

@@ -17,6 +17,7 @@ import org.signal.core.util.money.FiatMoney
import org.signal.donations.GooglePayApi
import org.signal.donations.GooglePayPaymentSource
import org.signal.donations.StripeApi
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.database.DatabaseFactory
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
import org.thoughtcrime.securesms.jobmanager.JobTracker
@@ -103,7 +104,7 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
fun continuePayment(price: FiatMoney, paymentData: PaymentData): Completable {
Log.d(TAG, "Creating payment intent...", true)
return stripeApi.createPaymentIntent(price)
return stripeApi.createPaymentIntent(price, application.getString(R.string.Boost__thank_you_for_your_donation))
.onErrorResumeNext { Single.error(DonationExceptions.SetupFailed(it)) }
.flatMapCompletable { result ->
Log.d(TAG, "Created payment intent.", true)
@@ -280,7 +281,7 @@ class DonationPaymentRepository(activity: Activity) : StripeApi.PaymentIntentFet
override fun fetchPaymentIntent(price: FiatMoney, description: String?): Single<StripeApi.PaymentIntent> {
return ApplicationDependencies
.getDonationsService()
.createDonationIntentWithAmount(price.minimumUnitPrecisionString, price.currency.currencyCode)
.createDonationIntentWithAmount(price.minimumUnitPrecisionString, price.currency.currencyCode, description)
.flatMap(ServiceResponse<SubscriptionClientSecret>::flattenResult)
.map {
StripeApi.PaymentIntent(it.id, it.clientSecret)

View File

@@ -4022,6 +4022,8 @@
<string name="NetworkFailure__network_error_check_your_connection_and_try_again">Network error. Check your connection and try again.</string>
<string name="NetworkFailure__retry">Retry</string>
<string name="Boost__thank_you_for_your_donation" translatable="false">Thank you for your donation. Your contribution helps fuel the mission of developing open source privacy technology that protects free expression and enables secure global communication for millions around the world. Signal Technology Foundation is a tax-exempt nonprofit organization in the United States under section 501c3 of the Internal Revenue Code. Our Federal Tax ID is 82-4506840. No goods or services were provided in exchange for this donation. Please retain this receipt for your tax records.</string>
<!-- EOF -->
</resources>