Starts in:
0 DAY
20 HRS
35 MIN
3 SEC
Starts in:
0 D
20 H
35 M
3 S
Open Closed

Error when add a second gateway plan to my Plan #4279


User avatar
0
christophe.baille created
  • ABP Framework version: v6.0.0
  • UI type:Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Our SAAS solution is using Stripe to make payment. We are using the subscriptionway, so we can charge our clients on regular bases (monthly in my case). Everything have been implemented using Stripe API and all is running well. I do not use ABP integration as it doesn't (didn't?) support "Stripe subscription"

I now want to add a "first-time extra charge" for our client, this amount will be taken only once (unlike subscription). It is simple to do with Stripe as I simply need to add this new priceId in options when creating my subscription on Stripe. But, for that, I now need to have 2 Gateway plans (price) per plan, one that will be charged once (the new one), then a second one as a "subscription" (which is already fine for now).

My issue here is that I got an error when trying to save this second "Gateway plan".

I see on the logs Microsoft.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_PayGatewayPlans'. Cannot insert duplicate key in object 'dbo.PayGatewayPlans'. The duplicate key value is (a58f425e-7eff-9cd4-f217-3a015f7298c6, stripe)

I see that it doesn't allow having the same PlanId/Gateway.

As I do not use your integration, I do not mind selecting another gateway than "Stripe", but for now I do not have any other option

Is there any way to add another gateway to this list? Without installing packages for another payment platform of course

Otherwise is there any other way to bypass this key violation?

I am stuck because of this limitation and can not implement the new feature that I need very soon

Thanks


5 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Currently, it's not possible because of the design of the module. But you can remove the first one and add latest one and manage the first one manually.

    We'll think on this scenario and consider to change the design of Gateway Plans.

  • User Avatar
    0
    christophe.baille created

    Thanks for your reply,

    I do not understand this:

    But you can remove the first one and add latest one and manage the first one manually.

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Thanks for your reply,

    I do not understand this:

    But you can remove the first one and add latest one and manage the first one manually.

    As I understand you already have that line in the database and can't add a second registry for the same gateway. I mean just add only one that you want to be managed by ABP Payment module, and manage rest of them manually without adding to db

  • User Avatar
    0
    christophe.baille created

    Yes, but I would need both in my database for my workflow: one gateway/price for a payment when the user register, and another one for the scheduled payment for the subscription

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Multiple gateways aren't supported by Payment module right now. I'm creating an issue for it into our backlog & we'll develop a feature that allows saving more than one gateway at the same time

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06