mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-03 15:11:42 +01:00
Fix paypal one-time donation handling.
This commit is contained in:
committed by
Cody Henthorne
parent
8c7556427a
commit
6295041341
@@ -1154,7 +1154,6 @@ public class PushServiceSocket {
|
||||
|
||||
public PayPalConfirmPaymentIntentResponse confirmPayPalOneTimePaymentIntent(String currency, String amount, long level, String payerId, String paymentId, String paymentToken) throws IOException {
|
||||
String payload = JsonUtil.toJson(new PayPalConfirmOneTimePaymentIntentPayload(amount, currency, level, payerId, paymentId, paymentToken));
|
||||
Log.d(TAG, payload);
|
||||
String result = makeServiceRequestWithoutAuthentication(CONFIRM_PAYPAL_ONE_TIME_PAYMENT_INTENT, "POST", payload, NO_HEADERS, new DonationResponseHandler());
|
||||
return JsonUtil.fromJsonResponse(result, PayPalConfirmPaymentIntentResponse.class);
|
||||
}
|
||||
@@ -2664,6 +2663,10 @@ public class PushServiceSocket {
|
||||
private static class DonationResponseHandler implements ResponseCodeHandler {
|
||||
@Override
|
||||
public void handle(int responseCode, ResponseBody body) throws NonSuccessfulResponseCodeException, PushNetworkException {
|
||||
if (responseCode < 400) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (responseCode == 440) {
|
||||
try {
|
||||
throw JsonUtil.fromJson(body.string(), DonationProcessorError.class);
|
||||
|
||||
Reference in New Issue
Block a user