Open Closed

Question: recurring payment for customers instead of tenants #8025


User avatar
0
jaylin created

ABP Framework version: v8.2.2

UI Type: Angular

Database System: EF Core (SQL Server)

Tiered (for MVC) or Auth Server Separated (for Angular): yes

Exception message and full stack trace:

Steps to reproduce the issue:

My last question (https://abp.io/support/questions/7847/Stripe-Payment--Subscription-Questions) was regarding recurring payment against tenant, I managed to add EditionId and TenantId into the ExtraPropertyDictionary to link to the built-in Stripe Webhook to trigger Tenant-Edition recurring subscription.

public virtual async Task OnPost(Guid planId, Guid editionId)
{
// PaymentRequestProductDto can't edit ExtraProperties
var paymentRequest = await PaymentRequestAppService.CreateAsync(
new CustomPaymentRequestCreateDto(new ExtraPropertyDictionary() {
{ "EditionId", editionId },
{ "TenantId", CurrentTenant.Id }
})
{
Products =
{
new PaymentRequestProductCreateDto
{
PaymentType = PaymentType.Subscription,
Name = "Standard",
Code = $"{CurrentTenant.Id}\_{planId}",
Count = 1,
PlanId = planId
}
}
});

 return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id);

}

Question: I am building a B2C platform that all users belongs to the same pre-defined tenant, how to handle the recurring subscriptions for each individual users? Do I need to include the UserId to the extra property and extend the built-in Stripe webhook? Then store the subscription expiry date for each individual user?

Any suggestions or working examples will be appreciated!


No answer yet!
Made with ❤️ on ABP v9.0.0-preview Updated on October 03, 2024, 12:03