From 7c142c7215f3d40bd1dfe6418150699341030b16 Mon Sep 17 00:00:00 2001 From: rrader2890 Date: Sat, 17 Oct 2026 15:03:12 -0400 Subject: [PATCH] Fix PaymentProviders constant resolution and stripe connect not-found response - Fully qualify ::PaymentProviders::Stripe::Payments::AuthorizeService in Api::V1::SubscriptionsController so it does not resolve against the Api::V1::PaymentProviders namespace. - Return the standard not-found error from the stripe connect endpoint when billing_entity_code does not match a billing entity. --- .../api/v1/payment_providers/stripe_connect_controller.rb | 3 +++ app/controllers/api/v1/subscriptions_controller.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/payment_providers/stripe_connect_controller.rb b/app/controllers/api/v1/payment_providers/stripe_connect_controller.rb index 13c98fa00139..9620cd923e39 100644 --- a/app/controllers/api/v1/payment_providers/stripe_connect_controller.rb +++ b/app/controllers/api/v1/payment_providers/stripe_connect_controller.rb @@ -31,6 +31,9 @@ def create else render_error_response(result) end + rescue BaseService::NotFoundFailure => e + # Raised by the service when billing_entity_code does not resolve. + not_found_error(resource: e.resource) end private diff --git a/app/controllers/api/v1/subscriptions_controller.rb b/app/controllers/api/v1/subscriptions_controller.rb index dc1b5fc9eddd..30fddb5152f8 100644 --- a/app/controllers/api/v1/subscriptions_controller.rb +++ b/app/controllers/api/v1/subscriptions_controller.rb @@ -52,7 +52,7 @@ def create customer.default_payment_method end - result = PaymentProviders::Stripe::Payments::AuthorizeService.call( + result = ::PaymentProviders::Stripe::Payments::AuthorizeService.call( amount: params[:authorization].fetch(:amount_cents), currency: params[:authorization].fetch(:amount_currency), provider_customer: customer.provider_customer,