Skip to content

Commit 53c55eb

Browse files
author
Recurly Integrations
authored
Generated Latest Changes for v2021-02-25
1 parent fe35690 commit 53c55eb

6 files changed

Lines changed: 324 additions & 2 deletions

File tree

lib/recurly/client.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,38 @@ public function removeCouponRedemption(string $account_id, array $options = []):
543543
return $this->makeRequest('DELETE', $path, [], $options);
544544
}
545545

546+
/**
547+
* Show the coupon redemption
548+
*
549+
* @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
550+
* @param string $coupon_redemption_id Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
551+
* @param array $options Associative array of optional parameters
552+
*
553+
* @return \Recurly\Resources\CouponRedemption A coupon redemption.
554+
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_coupon_redemption
555+
*/
556+
public function getCouponRedemption(string $account_id, string $coupon_redemption_id, array $options = []): \Recurly\Resources\CouponRedemption
557+
{
558+
$path = $this->interpolatePath("/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}", ['account_id' => $account_id, 'coupon_redemption_id' => $coupon_redemption_id]);
559+
return $this->makeRequest('GET', $path, [], $options);
560+
}
561+
562+
/**
563+
* Delete the coupon redemption
564+
*
565+
* @param string $account_id Account ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-bob`.
566+
* @param string $coupon_redemption_id Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
567+
* @param array $options Associative array of optional parameters
568+
*
569+
* @return \Recurly\Resources\CouponRedemption Coupon redemption deleted.
570+
* @link https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption_by_id
571+
*/
572+
public function removeCouponRedemptionById(string $account_id, string $coupon_redemption_id, array $options = []): \Recurly\Resources\CouponRedemption
573+
{
574+
$path = $this->interpolatePath("/accounts/{account_id}/coupon_redemptions/{coupon_redemption_id}", ['account_id' => $account_id, 'coupon_redemption_id' => $coupon_redemption_id]);
575+
return $this->makeRequest('DELETE', $path, [], $options);
576+
}
577+
546578
/**
547579
* List an account's credit payments
548580
*
@@ -3196,6 +3228,38 @@ public function listSubscriptionCouponRedemptions(string $subscription_id, array
31963228
return new \Recurly\Pager($this, $path, $options);
31973229
}
31983230

3231+
/**
3232+
* Show the coupon redemption for a subscription
3233+
*
3234+
* @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
3235+
* @param string $coupon_redemption_id Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
3236+
* @param array $options Associative array of optional parameters
3237+
*
3238+
* @return \Recurly\Resources\CouponRedemption The coupon redemption on a subscription.
3239+
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_coupon_redemption
3240+
*/
3241+
public function getSubscriptionCouponRedemption(string $subscription_id, string $coupon_redemption_id, array $options = []): \Recurly\Resources\CouponRedemption
3242+
{
3243+
$path = $this->interpolatePath("/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}", ['subscription_id' => $subscription_id, 'coupon_redemption_id' => $coupon_redemption_id]);
3244+
return $this->makeRequest('GET', $path, [], $options);
3245+
}
3246+
3247+
/**
3248+
* Delete the coupon redemption from a subscription
3249+
*
3250+
* @param string $subscription_id Subscription ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
3251+
* @param string $coupon_redemption_id Coupon Redemption ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
3252+
* @param array $options Associative array of optional parameters
3253+
*
3254+
* @return \Recurly\Resources\CouponRedemption Coupon redemption deleted.
3255+
* @link https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_coupon_redemption
3256+
*/
3257+
public function removeSubscriptionCouponRedemption(string $subscription_id, string $coupon_redemption_id, array $options = []): \Recurly\Resources\CouponRedemption
3258+
{
3259+
$path = $this->interpolatePath("/subscriptions/{subscription_id}/coupon_redemptions/{coupon_redemption_id}", ['subscription_id' => $subscription_id, 'coupon_redemption_id' => $coupon_redemption_id]);
3260+
return $this->makeRequest('DELETE', $path, [], $options);
3261+
}
3262+
31993263
/**
32003264
* List a subscription add-on's usage records
32013265
*

lib/recurly/resources/coupon_redemption.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class CouponRedemption extends RecurlyResource
2323
private $_state;
2424
private $_subscription_id;
2525
private $_updated_at;
26+
private $_uuid;
2627

2728
protected static $array_hints = [
2829
];
@@ -280,4 +281,27 @@ public function setUpdatedAt(string $updated_at): void
280281
{
281282
$this->_updated_at = $updated_at;
282283
}
284+
285+
/**
286+
* Getter method for the uuid attribute.
287+
* The UUID is useful for matching data with the CSV exports and building URLs into Recurly's UI.
288+
*
289+
* @return ?string
290+
*/
291+
public function getUuid(): ?string
292+
{
293+
return $this->_uuid;
294+
}
295+
296+
/**
297+
* Setter method for the uuid attribute.
298+
*
299+
* @param string $uuid
300+
*
301+
* @return void
302+
*/
303+
public function setUuid(string $uuid): void
304+
{
305+
$this->_uuid = $uuid;
306+
}
283307
}

lib/recurly/resources/credit_application_policy.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,40 @@
1212
// phpcs:disable
1313
class CreditApplicationPolicy extends RecurlyResource
1414
{
15+
private $_allowed_origins;
1516
private $_mode;
1617

1718
protected static $array_hints = [
19+
'setAllowedOrigins' => 'string',
1820
];
1921

2022

23+
/**
24+
* Getter method for the allowed_origins attribute.
25+
* Optional array of credit invoice origin types to allow when mode is `all`.
26+
If not specified when mode is `all`, credits from all origins are applied.
27+
Only valid when mode is `all`.
28+
29+
*
30+
* @return array
31+
*/
32+
public function getAllowedOrigins(): array
33+
{
34+
return $this->_allowed_origins ?? [] ;
35+
}
36+
37+
/**
38+
* Setter method for the allowed_origins attribute.
39+
*
40+
* @param array $allowed_origins
41+
*
42+
* @return void
43+
*/
44+
public function setAllowedOrigins(array $allowed_origins): void
45+
{
46+
$this->_allowed_origins = $allowed_origins;
47+
}
48+
2149
/**
2250
* Getter method for the mode attribute.
2351
* Determines which credit invoices are applied to invoices:

lib/recurly/resources/invoice_collection.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ class InvoiceCollection extends RecurlyResource
1515
private $_charge_invoice;
1616
private $_credit_invoices;
1717
private $_object;
18+
private $_verification_transactions;
1819

1920
protected static $array_hints = [
2021
'setCreditInvoices' => '\Recurly\Resources\Invoice',
22+
'setVerificationTransactions' => '\Recurly\Resources\Transaction',
2123
];
2224

2325

@@ -89,4 +91,27 @@ public function setObject(string $object): void
8991
{
9092
$this->_object = $object;
9193
}
94+
95+
/**
96+
* Getter method for the verification_transactions attribute.
97+
* Verification transactions (used for free trial payment method validation)
98+
*
99+
* @return array
100+
*/
101+
public function getVerificationTransactions(): array
102+
{
103+
return $this->_verification_transactions ?? [] ;
104+
}
105+
106+
/**
107+
* Setter method for the verification_transactions attribute.
108+
*
109+
* @param array $verification_transactions
110+
*
111+
* @return void
112+
*/
113+
public function setVerificationTransactions(array $verification_transactions): void
114+
{
115+
$this->_verification_transactions = $verification_transactions;
116+
}
92117
}

lib/recurly/resources/subscription.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ public function setCreatedAt(string $created_at): void
425425
/**
426426
* Getter method for the credit_application_policy attribute.
427427
* Controls whether credit invoices are automatically applied to new invoices.
428-
The `mode` field determines the application behavior.
428+
The `mode` field determines the application behavior. When mode is `all`,
429+
the optional `allowed_origins` array can restrict which credit invoice origins
430+
are applied.
429431
430432
*
431433
* @return ?\Recurly\Resources\CreditApplicationPolicy

0 commit comments

Comments
 (0)