Skip to content

Commit

Permalink
Merge pull request #171 from recurly/gs-support_new_coupon_duration_a…
Browse files Browse the repository at this point in the history
…ttributes

adding support for new coupon duration attributes
  • Loading branch information
bhelx committed Jul 31, 2015
2 parents 34f630d + a7d8bc3 commit b361a2f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# Recurly PHP Client Library CHANGELOG

## Unreleased

* Added `duration`, `temporal_unit`, & `temporal_amount` to `Coupon` [#171](https://github.com/recurly/recurly-client-php/pull/171)


## Version 2.4.4 (July 2nd, 2015)

* Added `gateway_error_code` to `Recurly_Transaction` [#163](https://github.com/recurly/recurly-client-php/pull/163)
Expand Down
3 changes: 3 additions & 0 deletions Tests/fixtures/coupons/show-200-2.xml
Expand Up @@ -17,6 +17,9 @@ Content-Type: application/xml; charset=utf-8
<max_redemptions nil="nil"></max_redemptions>
<applies_to_all_plans type="boolean">true</applies_to_all_plans>
<created_at type="datetime">2011-04-10T07:00:00Z</created_at>
<duration>forever</duration>
<temporal_unit></temporal_unit>
<temporal_amount type="integer"></temporal_amount>
<plan_codes type="array">
<plan_code>plan_one</plan_code>
<plan_code>plan_two</plan_code>
Expand Down
3 changes: 3 additions & 0 deletions Tests/fixtures/coupons/show-200-expired.xml
Expand Up @@ -16,6 +16,9 @@ Content-Type: application/xml; charset=utf-8
<max_redemptions nil="nil"></max_redemptions>
<applies_to_all_plans type="boolean">true</applies_to_all_plans>
<created_at type="datetime">2013-10-16T22:30:12Z</created_at>
<duration>forever</duration>
<temporal_unit></temporal_unit>
<temporal_amount type="integer"></temporal_amount>
<plan_codes type="array">
</plan_codes>
</coupon>
3 changes: 3 additions & 0 deletions Tests/fixtures/coupons/show-200.xml
Expand Up @@ -19,6 +19,9 @@ Content-Type: application/xml; charset=utf-8
<max_redemptions type="integer">100</max_redemptions>
<applies_to_all_plans type="boolean">true</applies_to_all_plans>
<created_at type="datetime">2011-04-30T08:00:00Z</created_at>
<duration>forever</duration>
<temporal_unit></temporal_unit>
<temporal_amount type="integer"></temporal_amount>
<plan_codes type="array">
</plan_codes>
<a name="redeem" href="https://api.recurly.com/v2/coupons/special/redeem" method="post"/>
Expand Down
1 change: 1 addition & 0 deletions lib/recurly/coupon.php
Expand Up @@ -15,6 +15,7 @@ public static function init()
{
Recurly_Coupon::$_writeableAttributes = array(
'coupon_code','name','discount_type','redeem_by_date','single_use','applies_for_months',
'duration', 'temporal_unit', 'temporal_amount',
'max_redemptions','applies_to_all_plans','discount_percent','discount_in_cents','plan_codes',
'hosted_description','invoice_description'
);
Expand Down

0 comments on commit b361a2f

Please sign in to comment.