Replace plan_uid

I am creating a subscription based payment gateway extension using sample from the stripe subscription extension. There is a logic to fetch plan and then create plan if plan doesn't exist.

My problem now is the payment gateway doesn't permit you to specify to plan_id when using the create plan api. The plan_id is automatically generated at the gateway.

So the only way the fetch and create plan logic will work is if you can save the gateway generated plan_id to database so it can be used to fetch the previously created plan the next time the function runs.

Is it a bad idea to want to do this?
 
Well, you can create your plans at the payment gateway and then see what ids they have, then edit the price plans from mailwizz using phpmyadmin and set the same ids.
 
I am creating a subscription based payment gateway extension using sample from the stripe subscription extension. There is a logic to fetch plan and then create plan if plan doesn't exist.

My problem now is the payment gateway doesn't permit you to specify to plan_id when using the create plan api. The plan_id is automatically generated at the gateway.

So the only way the fetch and create plan logic will work is if you can save the gateway generated plan_id to database so it can be used to fetch the previously created plan the next time the function runs.

Is it a bad idea to want to do this?
If you are trying to create a user experience that allows to create the plans before the gateway is brought in, then the stripe limitations might be overcome by creating an intermediate table where user created plan IDs and stripe created plan IDs could be matched up.
 
If you are trying to create a user experience that allows to create the plans before the gateway is brought in, then the stripe limitations might be overcome by creating an intermediate table where user created plan IDs and stripe created plan IDs could be matched up.
Exactly the implementation i decided to go with.
 
Back
Top