From 096bb8e6e5095f08ec1fa97b53bc207b3c0b3cb4 Mon Sep 17 00:00:00 2001 From: Ravi Khadiwala Date: Mon, 5 Aug 2024 16:18:09 -0500 Subject: [PATCH] Remove deprecated SubscriptionController methods --- .../controllers/SubscriptionController.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java index 55633c7d5..cb876c36c 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java @@ -418,23 +418,6 @@ public class SubscriptionController { }; } - @POST - @Path("/{subscriberId}/default_payment_method/{paymentMethodId}") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @Deprecated // use /{subscriberId}/default_payment_method/{processor}/{paymentMethodId} - public CompletableFuture setDefaultPaymentMethod( - @ReadOnly @Auth Optional authenticatedAccount, - @PathParam("subscriberId") String subscriberId, - @PathParam("paymentMethodId") @NotEmpty String paymentMethodId) { - RequestData requestData = RequestData.process(authenticatedAccount, subscriberId, clock); - return subscriptionManager.get(requestData.subscriberUser, requestData.hmac) - .thenApply(this::requireRecordFromGetResult) - .thenCompose(record -> stripeManager.setDefaultPaymentMethodForCustomer( - record.getProcessorCustomer().orElseThrow().customerId(), paymentMethodId, record.subscriptionId)) - .thenApply(customer -> Response.ok().build()); - } - @POST @Path("/{subscriberId}/default_payment_method/{processor}/{paymentMethodToken}") @Consumes(MediaType.APPLICATION_JSON) @@ -636,28 +619,6 @@ public class SubscriptionController { } } - @GET - @Path("/boost/badges") - @Produces(MediaType.APPLICATION_JSON) - @Deprecated // use /configuration - public CompletableFuture getBoostBadges(@Context ContainerRequestContext containerRequestContext) { - return CompletableFuture.supplyAsync(() -> { - long boostLevel = oneTimeDonationConfiguration.boost().level(); - String boostBadge = oneTimeDonationConfiguration.boost().badge(); - long giftLevel = oneTimeDonationConfiguration.gift().level(); - String giftBadge = oneTimeDonationConfiguration.gift().badge(); - List acceptableLanguages = getAcceptableLanguagesForRequest(containerRequestContext); - GetBoostBadgesResponse getBoostBadgesResponse = new GetBoostBadgesResponse(Map.of( - boostLevel, new GetBoostBadgesResponse.Level( - new PurchasableBadge(badgeTranslator.translate(acceptableLanguages, boostBadge), - oneTimeDonationConfiguration.boost().expiration())), - giftLevel, new GetBoostBadgesResponse.Level( - new PurchasableBadge(badgeTranslator.translate(acceptableLanguages, giftBadge), - oneTimeDonationConfiguration.gift().expiration())))); - return Response.ok(getBoostBadgesResponse).build(); - }); - } - public static class CreateBoostRequest { @NotEmpty