zf-fr/zfr-stripe — pull request #12 by bakura10 (2014-09-07 12:26:02+00:00)
Title: [WIP] Prepare v2

ping @DominikTo

This is a rewrite of ZfrStripe (well, mainly a new strategy for avoiding to have to copy-paste a new descriptor each time). I need to check carefully with Stripe team (see here: https://groups.google.com/a/lists.stripe.com/forum/#!topic/api-discuss/0if8hO4PnmE) but from my experiments, new endpoints are actually available even for older versions of Stripe. This means that as of today (v1 of ZfrStripe), someone using an older descriptor cannot use new endpoints using ZfrStripe, but actually could, so this is limiting.

Starting from today, I won't create a new descriptor file for each new version, but actually keep it versioned using a version number (starting from v1.0). The only time where I need to release a new descriptor is when an endpoint actually CHANGES or is removed. For instance, in january Stripe allowed multiple subscriptions per customer. The subscription endpoint changed from "customers/cus_abc/subscription" (prior to January) to "customers/cus_abc/subscriptions". Only in this case, the old endpoint is not available for new versions, so this is definitely a breaking change that requires a new descriptor.

In all other cases (new endpoints, changes in response...) this is not needed to release a new descriptor.

Starting from v2, I also removed the old way of iterating resources. This means that v2 is only compatible with Stripe API versions newer than 2014-03-28. Furthermore, I've raised the minimum dependency to PHP 5.4, and I've introduced a few missing endpoints.

Hopefully this will make this much easier for me to maintain!

I will try to test this in my app, but I'd be glad if you could try it to make sure it works, before I tag!