stripe plan product WIP

stripe-api-version
Thibault Duplessis 2020-10-17 10:33:29 +02:00
parent 794524ec97
commit fd2571a06d
1 changed files with 7 additions and 2 deletions

View File

@ -36,7 +36,9 @@ object Cents {
case class StripeSubscriptions(data: List[StripeSubscription])
case class StripePlan(id: String, name: String, amount: Cents) {
case class StripeProduct(id: String, name: String)
case class StripePlan(id: String, product: StripeProduct, amount: Cents) {
def cents = amount
def usd = cents.usd
}
@ -46,7 +48,10 @@ object StripePlan {
case Freq.Monthly =>
StripePlan(
id = s"monthly_${cents.value}",
name = s"Monthly ${cents.usd}",
product = StripeProduct(
id = s"monthly_${cents.value}",
name = s"Monthly ${cents.usd}"
),
amount = cents
)
case Freq.Onetime =>