Hi, I am attempting to setup self-service registration and subscription for customers. I am having an issue where when I try to go to the payment screen, it throws an error saying “Invalid URL”, and when I go to Stripe, it shows a relative URL that I cannot seem to adjust.
For context, here is my register page model OnPostAsync:
public async Task<IActionResult> OnPostAsync()
{
if (!ModelState.IsValid)
{
await OnGetAsync(); // reload editions
return Page();
}
// Confirm we are NOT in tenant context
if (_currentTenant.Id != null)
{
throw new Exception("Cannot register a tenant while already in a tenant context.");
//return Forbid(); // Registration should only be done as host
}
StartSubscriptionResultDto resultDto = await _multiTenancyAppService.RegisterAndSubscribeAsync(new SaasTenantCreateDto
{
Name = Input.TenantName,
AdminEmailAddress = Input.Email,
AdminPassword = Input.Password,
EditionId = Input.EditionId,
ActivationState = Volo.Saas.TenantActivationState.Passive
});
return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + resultDto.PaymentRequestId);
}
And here is my RegisterAndSubscribeAsync method:
public async Task<StartSubscriptionResultDto> RegisterAndSubscribeAsync(SaasTenantCreateDto input)
{
if (input.EditionId == null || input.EditionId == Guid.Empty)
{
throw new UserFriendlyException("Please select a valid edition.");
}
// 1) Create tenant via domain layer (no host permission needed)
var tenant = await _tenantManager.CreateAsync(input.Name, editionId: input.EditionId);
tenant.SetActivationState(input.ActivationState); // keep passive until payment succeeds
await _tenantRepository.InsertAsync(tenant, autoSave: true);
// 2) Publish TenantCreatedEto to seed admin user (same as TenantAppService does)
await _eventBus.PublishAsync(new TenantCreatedEto
{
Id = tenant.Id,
Name = tenant.Name,
Properties =
{
{"AdminEmail", input.AdminEmailAddress},
{"AdminPassword", input.AdminPassword}
}
});
// 3) Start subscription (creates PaymentRequest with TenantId/EditionId extra props)
PaymentRequestWithDetailsDto paymentRequest = await _subscriptionAppService.CreateSubscriptionAsync(input.EditionId ?? Guid.Empty, tenant.Id);
return new StartSubscriptionResultDto
{
TenantId = tenant.Id,
PaymentRequestId = paymentRequest.Id,
};
}
I have tried to set the callbackurl, prepaymenturl, and postpaymenturl in appsettings, but that doesn’t seem to do anything (stripe keys redacted for security):
"PaymentWebOptions": {
"RootUrl": "https://armadasoftware.io",
"CallBackUrl": "https://armadasoftware.io/Payment/Stripe/PostPayment",
"PaymentGatewayWebConfigurationDictionary": {
"Stripe": {
"PrePaymentUrl": "https://armadasoftware.io/Payment/Stripe/PrePayment",
"PostPaymentUrl": "https://armadasoftware.io/Payment/Stripe/PostPayment"
}
}
},
"Payment": {
"Stripe": {
"PublishableKey": "",
"SecretKey": "",
"WebhookSecret": ""
}
},
When I get this error, I go to Stripe Webhook logs, and I find this:
So it is saying the URL is invalid, and the success URL is a relative URL, which seems problematic, but I cannot seem to find a configuration or anything in the documentation that allows me to set a success URL such that it overrides this. I tried setting the success url in the stripe section of appsettings, but that didn’t work either. Please advise me on how to set this so it overrides whatever default URL is being sent to Stripe here.