farmdawgnation / streifen

Flexible API bindings for Stripe implemented in Scala.
Apache License 2.0
1 stars 1 forks source link

`Subscription.get` has too many required params #9

Open riveramj opened 7 years ago

riveramj commented 7 years ago

Was getting a subscription w/just a subscriptionId as noted here https://stripe.com/docs/api#retrieve_subscription but I had to give the userId as well to get streifen to play nice.

Error:

[error] /Users/MJR/dev/myPetDefense/src/main/scala/com/mypetdefense/service/ParentService.scala:182: not enough arguments for method get: (parentId: String, id: String)(implicit exec: me.frmr.stripe.StripeExecutor, implicit mf: Manifest[me.frmr.stripe.Subscription])dispatch.Future[net.liftweb.common.Box[me.frmr.stripe.Subscription]]. [error] Unspecified value parameter id. [error] Await.result(StripeSubscription.get(subscriptionId), new DurationInt(10).seconds)

solution:

def getStripeSubscription(stripeCustomerId: String, subscriptionId: String): Box[StripeSubscription] = { Try( Await.result(StripeSubscription.get(stripeCustomerId, subscriptionId), new DurationInt(10).seconds)

I think it should just be subscriptionId unless I'm missing something.

farmdawgnation commented 7 years ago

Subscriptions weren't always first class objects. It looks like in the latest API, they are.

So yeah, that needs to change. :)