Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Metadata on subscriptions #99

Open
pascallieverse opened this issue Oct 24, 2019 · 4 comments
Open

Metadata on subscriptions #99

pascallieverse opened this issue Oct 24, 2019 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@pascallieverse
Copy link
Contributor

It would be nice to have metadata for each subscription so you could save a variable as domain name for example. Currently I am using the name of the subscription as Foreign key to add additional metadata, it would be better to just add some metadata to the subscription itself.

Maybe it can be implemented the same way the cashier stripe package adds additional data to a subscription:

$user->newSubscription('main', 'premium')->create(['option' => $value, 'another_option' => $anotherValue]);

$value = $subscription->metadata->option;
@sandervanhooft
Copy link
Contributor

Hi @pascallieverse ,

I agree that it's interesting but it would cause a breaking change. I'll label it for cashier-mollie v2.

@sandervanhooft sandervanhooft added the enhancement New feature or request label Oct 25, 2019
@sandervanhooft sandervanhooft added this to the v2 milestone Oct 25, 2019
@adamskyle
Copy link

@sandervanhooft

Is there any way we can achieve something like this right now? I'm working on a case where I want a User (the Billable Model) to be able to create multiple UserPlan models for itself. The UserPlan model can contain extra metadata.

I want to attach the Subscription to the UserPlan model after the subscription is created / checkout, however where can I pass the UserPlan id to the subscription creation process?

If I'm able to get this to work, the UserPlan model could be a good place for us to store additional metadata for now.

@sandervanhooft
Copy link
Contributor

sandervanhooft commented Feb 20, 2020

@kyle51north Consider storing the relation elsewhere for now. Perhaps a pivot table?

@sandervanhooft
Copy link
Contributor

@kyle51north also, you can define an event listener to fire after the subscription is started.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants