Skip to content

Commit 55e0726

Browse files
authored
Merge branch 'recurly:v3-v2021-02-25' into syed/v3-v2021-02-25/guzzle
2 parents f33fe4a + bfc6e06 commit 55e0726

File tree

13 files changed

+1664
-15
lines changed

13 files changed

+1664
-15
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 4.29.0
2+
current_version = 4.34.0
33
parse = (?P<major>\d+)
44
\.(?P<minor>\d+)
55
\.(?P<patch>\d+)

CHANGELOG.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
# Changelog
22

3+
## [4.34.0](https://github.com/recurly/recurly-client-php/tree/4.34.0) (2023-05-03)
4+
5+
[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.33.0...4.34.0)
6+
7+
8+
**Merged Pull Requests**
9+
10+
- Generated Latest Changes for v2021-02-25 [#761](https://github.com/recurly/recurly-client-php/pull/761) ([recurly-integrations](https://github.com/recurly-integrations))
11+
12+
13+
14+
## [4.33.0](https://github.com/recurly/recurly-client-php/tree/4.33.0) (2023-04-26)
15+
16+
[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.32.0...4.33.0)
17+
18+
19+
**Merged Pull Requests**
20+
21+
- Generated Latest Changes for v2021-02-25 (used_tax_service on Invoice) [#759](https://github.com/recurly/recurly-client-php/pull/759) ([recurly-integrations](https://github.com/recurly-integrations))
22+
23+
24+
25+
## [4.32.0](https://github.com/recurly/recurly-client-php/tree/4.32.0) (2023-04-13)
26+
27+
[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.31.0...4.32.0)
28+
29+
30+
**Merged Pull Requests**
31+
32+
- Generated Latest Changes for v2021-02-25 (External Accounts) [#756](https://github.com/recurly/recurly-client-php/pull/756) ([recurly-integrations](https://github.com/recurly-integrations))
33+
34+
35+
36+
## [4.31.0](https://github.com/recurly/recurly-client-php/tree/4.31.0) (2023-04-05)
37+
38+
[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.30.0...4.31.0)
39+
40+
41+
**Merged Pull Requests**
42+
43+
- Generated Latest Changes for v2021-02-25 [#753](https://github.com/recurly/recurly-client-php/pull/753) ([recurly-integrations](https://github.com/recurly-integrations))
44+
45+
46+
47+
## [4.30.0](https://github.com/recurly/recurly-client-php/tree/4.30.0) (2023-03-29)
48+
49+
[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.29.0...4.30.0)
50+
51+
52+
**Merged Pull Requests**
53+
54+
- Generated Latest Changes for v2021-02-25 (External Invoices) [#751](https://github.com/recurly/recurly-client-php/pull/751) ([recurly-integrations](https://github.com/recurly-integrations))
55+
56+
57+
358
## [4.29.0](https://github.com/recurly/recurly-client-php/tree/4.29.0) (2023-02-22)
459

560
[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.28.0...4.29.0)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "recurly/recurly-client",
3-
"version": "4.29.0",
3+
"version": "4.34.0",
44
"type": "library",
55
"description": "The PHP client library for the Recurly API",
66
"keywords": ["recurly", "payments", "pay"],

lib/recurly/client.php

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,109 @@ public function listAccountCreditPayments(string $account_id, array $options = [
536536
return new \Recurly\Pager($this, $path, $options);
537537
}
538538

539+
/**
540+
* List external accounts for an account
541+
*
542+
* @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`.
543+
* @param array $options Associative array of optional parameters
544+
*
545+
* @return \Recurly\Pager A list of external accounts on an account.
546+
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_account
547+
*/
548+
public function listAccountExternalAccount(string $account_id, array $options = []): \Recurly\Pager
549+
{
550+
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts", ['account_id' => $account_id]);
551+
return new \Recurly\Pager($this, $path, $options);
552+
}
553+
554+
/**
555+
* Create an external account
556+
*
557+
* @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`.
558+
* @param array $body The body of the request.
559+
* @param array $options Associative array of optional parameters
560+
*
561+
* @return \Recurly\Resources\ExternalAccount A representation of the created external_account.
562+
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_account_external_account
563+
*/
564+
public function createAccountExternalAccount(string $account_id, array $body, array $options = []): \Recurly\Resources\ExternalAccount
565+
{
566+
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts", ['account_id' => $account_id]);
567+
return $this->makeRequest('POST', $path, $body, $options);
568+
}
569+
570+
/**
571+
* Get an external account for an account
572+
*
573+
* @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`.
574+
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
575+
* @param array $options Associative array of optional parameters
576+
*
577+
* @return \Recurly\Resources\ExternalAccount A external account on an account.
578+
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_account_external_account
579+
*/
580+
public function getAccountExternalAccount(string $account_id, string $external_account_id, array $options = []): \Recurly\Resources\ExternalAccount
581+
{
582+
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
583+
return $this->makeRequest('GET', $path, [], $options);
584+
}
585+
586+
/**
587+
* Update an external account
588+
*
589+
* @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`.
590+
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
591+
* @param array $body The body of the request.
592+
* @param array $options Associative array of optional parameters
593+
*
594+
* @return \Recurly\Resources\ExternalAccount A representation of the updated external_account.
595+
* @link https://developers.recurly.com/api/v2021-02-25#operation/update_account_external_account
596+
*/
597+
public function updateAccountExternalAccount(string $account_id, string $external_account_id, array $body, array $options = []): \Recurly\Resources\ExternalAccount
598+
{
599+
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
600+
return $this->makeRequest('PUT', $path, $body, $options);
601+
}
602+
603+
/**
604+
* Delete an external account for an account
605+
*
606+
* @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`.
607+
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
608+
* @param array $options Associative array of optional parameters
609+
*
610+
* @return \Recurly\Resources\ExternalAccount Successful Delete
611+
* @link https://developers.recurly.com/api/v2021-02-25#operation/delete_account_external_account
612+
*/
613+
public function deleteAccountExternalAccount(string $account_id, string $external_account_id, array $options = []): \Recurly\Resources\ExternalAccount
614+
{
615+
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
616+
return $this->makeRequest('DELETE', $path, [], $options);
617+
}
618+
619+
/**
620+
* List the external invoices on an account
621+
*
622+
* @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`.
623+
* @param array $options Associative array of optional parameters
624+
*
625+
* Supported optional query string parameters:
626+
*
627+
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
628+
* order. In descending order updated records will move behind the cursor and could
629+
* prevent some records from being returned.
630+
* - $options['params']['limit'] (int): Limit number of records 1-200.
631+
* - $options['params']['order'] (string): Sort order.
632+
*
633+
* @return \Recurly\Pager A list of the the external_invoices on an account.
634+
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_invoices
635+
*/
636+
public function listAccountExternalInvoices(string $account_id, array $options = []): \Recurly\Pager
637+
{
638+
$path = $this->interpolatePath("/accounts/{account_id}/external_invoices", ['account_id' => $account_id]);
639+
return new \Recurly\Pager($this, $path, $options);
640+
}
641+
539642
/**
540643
* List an account's invoices
541644
*
@@ -1567,6 +1670,29 @@ public function getExternalSubscription(string $external_subscription_id, array
15671670
return $this->makeRequest('GET', $path, [], $options);
15681671
}
15691672

1673+
/**
1674+
* List the external invoices on an external subscription
1675+
*
1676+
* @param string $external_subscription_id External subscription id
1677+
* @param array $options Associative array of optional parameters
1678+
*
1679+
* Supported optional query string parameters:
1680+
*
1681+
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
1682+
* order. In descending order updated records will move behind the cursor and could
1683+
* prevent some records from being returned.
1684+
* - $options['params']['limit'] (int): Limit number of records 1-200.
1685+
* - $options['params']['order'] (string): Sort order.
1686+
*
1687+
* @return \Recurly\Pager A list of the the external_invoices on a site.
1688+
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscription_external_invoices
1689+
*/
1690+
public function listExternalSubscriptionExternalInvoices(string $external_subscription_id, array $options = []): \Recurly\Pager
1691+
{
1692+
$path = $this->interpolatePath("/external_subscriptions/{external_subscription_id}/external_invoices", ['external_subscription_id' => $external_subscription_id]);
1693+
return new \Recurly\Pager($this, $path, $options);
1694+
}
1695+
15701696
/**
15711697
* List a site's invoices
15721698
*
@@ -3046,6 +3172,43 @@ public function getInvoiceTemplate(string $invoice_template_id, array $options =
30463172
return $this->makeRequest('GET', $path, [], $options);
30473173
}
30483174

3175+
/**
3176+
* List the external invoices on a site
3177+
*
3178+
* @param array $options Associative array of optional parameters
3179+
*
3180+
* Supported optional query string parameters:
3181+
*
3182+
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
3183+
* order. In descending order updated records will move behind the cursor and could
3184+
* prevent some records from being returned.
3185+
* - $options['params']['limit'] (int): Limit number of records 1-200.
3186+
* - $options['params']['order'] (string): Sort order.
3187+
*
3188+
* @return \Recurly\Pager A list of the the external_invoices on a site.
3189+
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_external_invoices
3190+
*/
3191+
public function listExternalInvoices(array $options = []): \Recurly\Pager
3192+
{
3193+
$path = $this->interpolatePath("/external_invoices", []);
3194+
return new \Recurly\Pager($this, $path, $options);
3195+
}
3196+
3197+
/**
3198+
* Fetch an external invoice
3199+
*
3200+
* @param string $external_invoice_id External invoice ID, e.g. `e28zov4fw0v2`.
3201+
* @param array $options Associative array of optional parameters
3202+
*
3203+
* @return \Recurly\Resources\ExternalInvoice Returns the external invoice
3204+
* @link https://developers.recurly.com/api/v2021-02-25#operation/show_external_invoice
3205+
*/
3206+
public function showExternalInvoice(string $external_invoice_id, array $options = []): \Recurly\Resources\ExternalInvoice
3207+
{
3208+
$path = $this->interpolatePath("/external_invoices/{external_invoice_id}", ['external_invoice_id' => $external_invoice_id]);
3209+
return $this->makeRequest('GET', $path, [], $options);
3210+
}
3211+
30493212
/**
30503213
* List entitlements granted to an account
30513214
*

lib/recurly/resources/account.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Account extends RecurlyResource
2424
private $_dunning_campaign_id;
2525
private $_email;
2626
private $_exemption_certificate;
27+
private $_external_accounts;
2728
private $_first_name;
2829
private $_has_active_subscription;
2930
private $_has_canceled_subscription;
@@ -48,6 +49,7 @@ class Account extends RecurlyResource
4849

4950
protected static $array_hints = [
5051
'setCustomFields' => '\Recurly\Resources\CustomField',
52+
'setExternalAccounts' => '\Recurly\Resources\ExternalAccount',
5153
'setShippingAddresses' => '\Recurly\Resources\ShippingAddress',
5254
];
5355

@@ -328,6 +330,29 @@ public function setExemptionCertificate(string $exemption_certificate): void
328330
$this->_exemption_certificate = $exemption_certificate;
329331
}
330332

333+
/**
334+
* Getter method for the external_accounts attribute.
335+
* The external accounts belonging to this account
336+
*
337+
* @return array
338+
*/
339+
public function getExternalAccounts(): array
340+
{
341+
return $this->_external_accounts ?? [] ;
342+
}
343+
344+
/**
345+
* Setter method for the external_accounts attribute.
346+
*
347+
* @param array $external_accounts
348+
*
349+
* @return void
350+
*/
351+
public function setExternalAccounts(array $external_accounts): void
352+
{
353+
$this->_external_accounts = $external_accounts;
354+
}
355+
331356
/**
332357
* Getter method for the first_name attribute.
333358
*

0 commit comments

Comments
 (0)