mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-27 04:04:43 +01:00
Send user an email after Stripe completes payment for boosts.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user