Skip to content

Commit

Permalink
Merge pull request #243 from recurly/correct-coupon-listing
Browse files Browse the repository at this point in the history
Coupon lists require a parent object
  • Loading branch information
bhelx authored Jul 1, 2016
2 parents c5892ee + f86c24e commit 88f948b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions lib/recurly/redemption_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

class Recurly_CouponRedemptionList extends Recurly_Pager
{
public static function get($params = null, $client = null) {
$uri = self::_uriWithParams(Recurly_Client::PATH_COUPON_REDEMPTIONS, $params);
public static function getForAccount($accountCode, $params = null, $client = null) {
$uri = self::_uriWithParams(Recurly_Client::PATH_ACCOUNTS . '/' . rawurlencode($accountCode) . Recurly_Client::PATH_COUPON_REDEMPTIONS, $params);
return new self($uri, $client);
}

public static function getForInvoice($invoiceNumber, $params = null, $client = null) {
$uri = self::_uriWithParams(Recurly_Client::PATH_INVOICES . '/' . rawurlencode($invoiceNumber) . Recurly_Client::PATH_COUPON_REDEMPTIONS, $params);
return new self($uri, $client);
}

public static function getForSubscription($subscriptionUuid, $params = null, $client = null) {
$uri = self::_uriWithParams(Recurly_Client::PATH_SUBSCRIPTIONS . '/' . rawurlencode($subscriptionUuid) . Recurly_Client::PATH_COUPON_REDEMPTIONS, $params);
return new self($uri, $client);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/recurly/unique_coupon_code_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
class Recurly_UniqueCouponCodeList extends Recurly_Pager
{

public static function get($params = null, $client = null) {
$uri = self::_uriWithParams(Recurly_Client::PATH_UNIQUE_COUPONS, $params);
public static function get($couponCode, $params = null, $client = null) {
$uri = self::_uriWithParams(Recurly_Client::PATH_COUPONS . '/' . rawurlencode($couponCode) . Recurly_Client::PATH_UNIQUE_COUPONS, $params);
return new self($uri, $client);
}

Expand Down

0 comments on commit 88f948b

Please sign in to comment.