Open jeffolmstead opened 6 years ago
By default, the Subscription simply continues on with the pricing as it was fixed in time at the Order, it does not recalculate pricing along the way.
This is very important: Here we need to resist an attempt to DRY and load the corresponding pricing details on the fly, because changes to those shouldn't affect ongoing subscriptions.
For issuing the subscription, it should be noted that depending on the payment provider's capabilities, there can be two approaches:
If possible, the first approach would be better, since that's what surely works with all cards (including MFA with 3DS2). I'm not even sure that the second approach is in line with regulations.
Also, we'd need to allow users to change their subscription: e.g. change between monthly and yearly payments, and subscription tiers.
Another benefit from relying on the provider to handler subscription, is other apps can also hook in the event. For example, OC App, sends a request to create a customer then create a subscription, other app can act on the subscription request.
Here we need to resist an attempt to DRY and load the corresponding pricing details on the fly, because changes to those shouldn't affect ongoing subscriptions.
Never resist an attempt to DRY. :) The Order's line items already have baked-in prices for the same reason, so you can always use the first order as reference if necessary.
A better term would have been "normalization of the data" that we should resist :). But great then!
It came to my mind that if the automatic payment from the payment provider's side fails or the subscription is removed from their end, we should still generate a "pending" order and send a mail to the customer. Same in case of payment providers without subscription support. This ties into #345 because right now you can only pay during checkout.
Subscription products / payments allow a product to be sold over time and should have ability to continue indefinitely, have a defined end date, or allow for canceling.
The subscription framework should be agnostic to the selected payment gateway while also recognizing only some payment gateways allow tokenization. There may be an interface that payment providers would implement to validate they support a tokenization payment model.
General architecture would be Subscription Plans and Subscription Products.
Subscription Plans
Subscription Product
By default, the Subscription simply continues on with the pricing as it was fixed in time at the Order, it does not recalculate pricing along the way.
Jira issue