Skip to content

Commit 1ec06fa

Browse files
[PM 21889] 500 Response on POST billing/restart-subscription (#5851)
* Resolve the 500 errors on restart subscription * Rename the variable name
1 parent 18d1464 commit 1ec06fa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Api/Billing/Controllers/OrganizationBillingController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,12 @@ public async Task<IResult> RestartSubscriptionAsync([FromRoute] Guid organizatio
302302
Debug.Assert(org is not null, "This organization has already been found via this same ID, this should be fine.");
303303
var paymentSource = new TokenizedPaymentSource(organizationSignup.PaymentMethodType.Value, organizationSignup.PaymentToken);
304304
var taxInformation = TaxInformation.From(organizationSignup.TaxInfo);
305-
await organizationBillingService.UpdatePaymentMethod(org, paymentSource, taxInformation);
306305
await organizationBillingService.Finalize(sale);
306+
var updatedOrg = await organizationRepository.GetByIdAsync(organizationId);
307+
if (updatedOrg != null)
308+
{
309+
await organizationBillingService.UpdatePaymentMethod(updatedOrg, paymentSource, taxInformation);
310+
}
307311

308312
return TypedResults.Ok();
309313
}

0 commit comments

Comments
 (0)