Closed joshferrara closed 9 years ago
+1 on this. We're getting the same problem with our environment, and have confirmed the stock API works great.
Josh, I don't see a patch in your fork. Have you got something implemented that you're willing to share? :)
@14to9 I haven't yet, I was mostly waiting to hear from someone at Chargify to see if I was missing something. But if you're having the issue as well I think that's all the confirmation I need to patch it myself :) I'll let you know when I get something worked out.
That sounds great, Josh. Thanks. If you get stalled out on it, pls just shout out and we'll fork-and-hack on this end :)
On Jun 6, 2012, at 12:25 PM, Josh Ferrara wrote:
@14to9 I haven't yet, I was mostly waiting to hear from someone at Chargify to see if I was missing something. But if you're having the issue as well I think that's all the confirmation I need to patch it myself :) I'll let you know when I get something worked out.
Reply to this email directly or view it on GitHub: https://github.com/chargify/chargify_api_ares/issues/46#issuecomment-6155425
I was wondering about the reason too. I was able to hack the new API endpoint using
coupon = Chargify::Coupon.find(:first, :params => {:code => "MYCODE"})
I think the hint to the reason is in http://docs.chargify.com/api-coupons#api-coupon-find
Coupon's attribute -- "product_family_id. The ID of the product family to which the coupon belongs. The coupon can be applied only to products in this product family."
However, I find that the find by code is easier to use.
It seems that the gem uses this endpoint
http://DOMAIN.chargify.com/coupons/lookup.xml?code=COUPON&product_family_id=FAMILY_ID
when using the gem functionChargify::Coupon.find_by_product_family_id_and_code
.I'm not sure if this is a legacy API endpoint, as the current Chargify docs list an endpoint such as
http://DOMAIN.chargify.com/coupons/find.xml?code=COUPON
to use instead.My two main points of curiosity are this:
lookup
method returns a404: Not found
when I lookup a secondary coupon code, whereas thefind
method returns the valid coupon details.lookup
method requires aproduct_family_id
while thefind
method only requires thecoupon_code
.I wanted to see if there was a reason for this before I submit a pull request. Thanks!