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

@@ -78,8 +78,8 @@ public class DonationsService {
* @param currencyCode The currency code for the amount
* @return A ServiceResponse containing a DonationIntentResult with details given to us by the payment gateway.
*/
public Single<ServiceResponse<SubscriptionClientSecret>> createDonationIntentWithAmount(String amount, String currencyCode) {
return createServiceResponse(() -> new Pair<>(pushServiceSocket.createBoostPaymentMethod(currencyCode, Long.parseLong(amount)), 200));
public Single<ServiceResponse<SubscriptionClientSecret>> createDonationIntentWithAmount(String amount, String currencyCode, String description) {
return createServiceResponse(() -> new Pair<>(pushServiceSocket.createBoostPaymentMethod(currencyCode, Long.parseLong(amount), description), 200));
}
/**

View File

@@ -9,8 +9,12 @@ class DonationIntentPayload {
@JsonProperty
private String currency;
public DonationIntentPayload(long amount, String currency) {
this.amount = amount;
this.currency = currency;
@JsonProperty
private String description;
public DonationIntentPayload(long amount, String currency, String description) {
this.amount = amount;
this.currency = currency;
this.description = description;
}
}

View File

@@ -876,8 +876,8 @@ public class PushServiceSocket {
makeServiceRequest(DONATION_REDEEM_RECEIPT, "POST", payload);
}
public SubscriptionClientSecret createBoostPaymentMethod(String currencyCode, long amount) throws IOException {
String payload = JsonUtil.toJson(new DonationIntentPayload(amount, currencyCode));
public SubscriptionClientSecret createBoostPaymentMethod(String currencyCode, long amount, String description) throws IOException {
String payload = JsonUtil.toJson(new DonationIntentPayload(amount, currencyCode, description));
String result = makeServiceRequestWithoutAuthentication(CREATE_BOOST_PAYMENT_INTENT, "POST", payload);
return JsonUtil.fromJsonResponse(result, SubscriptionClientSecret.class);
}