{"record":{"id":"c58a3da1bf08ca3c","repo":"signalapp/Signal-Server","slug":"operation-cannot-be-performed-with-the-processor","errorCode":null,"errorMessage":"Operation cannot be performed with the ${processor} payment provider","messagePattern":"Operation cannot be performed with the (.+?) payment provider","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"error","filePath":"service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java","lineNumber":355,"sourceCode":"    final SubscriberCredentials subscriberCredentials =\n        SubscriberCredentials.process(authenticatedAccount, subscriberId, clock);\n    final Locale locale = getPayPalLocale(HeaderUtils.getAcceptableLanguagesForRequest(containerRequestContext));\n\n    final BraintreeManager.PayPalBillingAgreementApprovalDetails billingAgreementApprovalDetails = subscriptionManager.addPaymentMethodToCustomer(\n            subscriberCredentials,\n            braintreeManager,\n            getClientPlatform(userAgentString),\n            (mgr, _) -> mgr.createPayPalBillingAgreement(request.returnUrl, request.cancelUrl, locale.toLanguageTag()));\n              return new CreatePayPalBillingAgreementResponse(\n        billingAgreementApprovalDetails.approvalUrl(),\n        billingAgreementApprovalDetails.billingAgreementToken());\n  }\n\n  private CustomerAwareSubscriptionPaymentProcessor getCustomerAwareProcessor(PaymentProvider processor) {\n    return switch (processor) {\n      case STRIPE -> stripeManager;\n      case BRAINTREE -> braintreeManager;\n      case GOOGLE_PLAY_BILLING, APPLE_APP_STORE -> throw new BadRequestException(\"Operation cannot be performed with the \" + processor + \" payment provider\");\n    };\n  }\n\n  @POST\n  @Path(\"/{subscriberId}/default_payment_method/{processor}/{paymentMethodToken}\")\n  @Consumes(MediaType.APPLICATION_JSON)\n  @Produces(MediaType.APPLICATION_JSON)\n  @ManagedAsync\n  public Response setDefaultPaymentMethodWithProcessor(\n      @Auth Optional<AuthenticatedDevice> authenticatedAccount,\n      @PathParam(\"subscriberId\") String subscriberId,\n      @PathParam(\"processor\") PaymentProvider processor,\n      @PathParam(\"paymentMethodToken\") @NotEmpty String paymentMethodToken) throws SubscriptionException, IOException {\n    SubscriberCredentials subscriberCredentials =\n        SubscriberCredentials.process(authenticatedAccount, subscriberId, clock);\n\n    final CustomerAwareSubscriptionPaymentProcessor manager = getCustomerAwareProcessor(processor);\n","sourceCodeStart":337,"sourceCodeEnd":373,"githubUrl":"https://github.com/signalapp/Signal-Server/blob/100ab61c82627582c867d19e1c0561ba2781e927/service/src/main/java/org/whispersystems/textsecuregcm/controllers/SubscriptionController.java#L337-L373","documentation":"getCustomerAwareProcessor throws BadRequestException \"Operation cannot be performed with the <processor> payment provider\" when an operation that requires a customer-aware processor is invoked with GOOGLE_PLAY_BILLING or APPLE_APP_STORE, which have no direct customer/processor API in this service.","triggerScenarios":"Any subscriber operation that routes through getCustomerAwareProcessor (e.g. default payment method, subscription level changes via processor path) with processor=GOOGLE_PLAY_BILLING or APPLE_APP_STORE in the URL.","commonSituations":"Clients constructing processor-segmented URLs for app-store subscriptions; automation iterating all PaymentProvider values against customer endpoints.","solutions":["Use STRIPE or BRAINTREE as the processor for customer-aware operations","Manage app-store subscriptions through the store's own APIs / the app-store-specific endpoints","Validate the processor path parameter client-side before calling"],"exampleFix":"// before\nPUT /v1/subscription/{subscriberId}/default_payment_method/GOOGLE_PLAY_BILLING/{token}\n// after\nPUT /v1/subscription/{subscriberId}/default_payment_method/STRIPE/{token}","handlingStrategy":"validation","validationCode":"const CUSTOMER_AWARE = ['STRIPE','BRAINTREE'];\nif (!CUSTOMER_AWARE.includes(processor)) throw new Error(`${processor} has no customer-aware operations`);","typeGuard":"const isCustomerAware = (p) => p === 'STRIPE' || p === 'BRAINTREE';","tryCatchPattern":null,"preventionTips":["Only use STRIPE/BRAINTREE in processor path segments","Handle app-store subscriptions through their store-specific flows"],"tags":["http-400","bad-request","payments","unsupported-provider"],"backgroundTag":"unsupported-operation","analyzedSha":"100ab61c82627582c867d19e1c0561ba2781e927","analyzedAt":"2026-09-09T13:29:47.883Z","contentChangedAt":"2026-09-09T13:29:47.883Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}