payolapayments / payola

Drop-in Rails engine for accepting payments with Stripe
http://www.payola.io
Other
818 stars 154 forks source link

Subscription plan_id and owner_id assume integer ids #333

Closed stuartsan closed 6 years ago

stuartsan commented 6 years ago

I ran into an error because the plan and owner models I've defined use UUIDs as primary keys, but the payola subscription model wants them to be integers. So something like this would happen: with my subscription plan id 123abc, on the payola subscription model it would end up being saved as just plan_id: 123, and then when trying to process the subscription I ran into undefined method 'amount' for nil:NilClass.

It might be helpful to note this assumption around integer primary keys in the subscriptions wiki.

A question: given that the migrations for payola live inside the gem would it be janky for me to write a migration in my app to modify the payola subscriptions table plan_id and owner_id to be UUIDs?