Skip to content

Commit

Permalink
Merge branch 'recurly:v3-v2021-02-25' into syed/v3-v2021-02-25/guzzle
Browse files Browse the repository at this point in the history
  • Loading branch information
saas786 authored May 12, 2023
2 parents f33fe4a + bfc6e06 commit 55e0726
Show file tree
Hide file tree
Showing 13 changed files with 1,664 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.29.0
current_version = 4.34.0
parse = (?P<major>\d+)
\.(?P<minor>\d+)
\.(?P<patch>\d+)
Expand Down
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# Changelog

## [4.34.0](https://github.com/recurly/recurly-client-php/tree/4.34.0) (2023-05-03)

[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.33.0...4.34.0)


**Merged Pull Requests**

- Generated Latest Changes for v2021-02-25 [#761](https://github.com/recurly/recurly-client-php/pull/761) ([recurly-integrations](https://github.com/recurly-integrations))



## [4.33.0](https://github.com/recurly/recurly-client-php/tree/4.33.0) (2023-04-26)

[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.32.0...4.33.0)


**Merged Pull Requests**

- 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))



## [4.32.0](https://github.com/recurly/recurly-client-php/tree/4.32.0) (2023-04-13)

[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.31.0...4.32.0)


**Merged Pull Requests**

- 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))



## [4.31.0](https://github.com/recurly/recurly-client-php/tree/4.31.0) (2023-04-05)

[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.30.0...4.31.0)


**Merged Pull Requests**

- Generated Latest Changes for v2021-02-25 [#753](https://github.com/recurly/recurly-client-php/pull/753) ([recurly-integrations](https://github.com/recurly-integrations))



## [4.30.0](https://github.com/recurly/recurly-client-php/tree/4.30.0) (2023-03-29)

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


**Merged Pull Requests**

- 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))



## [4.29.0](https://github.com/recurly/recurly-client-php/tree/4.29.0) (2023-02-22)

[Full Changelog](https://github.com/recurly/recurly-client-php/compare/4.28.0...4.29.0)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recurly/recurly-client",
"version": "4.29.0",
"version": "4.34.0",
"type": "library",
"description": "The PHP client library for the Recurly API",
"keywords": ["recurly", "payments", "pay"],
Expand Down
163 changes: 163 additions & 0 deletions lib/recurly/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,109 @@ public function listAccountCreditPayments(string $account_id, array $options = [
return new \Recurly\Pager($this, $path, $options);
}

/**
* List external accounts for an account
*
* @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`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Pager A list of external accounts on an account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_account
*/
public function listAccountExternalAccount(string $account_id, array $options = []): \Recurly\Pager
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts", ['account_id' => $account_id]);
return new \Recurly\Pager($this, $path, $options);
}

/**
* Create an external account
*
* @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`.
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount A representation of the created external_account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_account_external_account
*/
public function createAccountExternalAccount(string $account_id, array $body, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts", ['account_id' => $account_id]);
return $this->makeRequest('POST', $path, $body, $options);
}

/**
* Get an external account for an account
*
* @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`.
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount A external account on an account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_account_external_account
*/
public function getAccountExternalAccount(string $account_id, string $external_account_id, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
return $this->makeRequest('GET', $path, [], $options);
}

/**
* Update an external account
*
* @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`.
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount A representation of the updated external_account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/update_account_external_account
*/
public function updateAccountExternalAccount(string $account_id, string $external_account_id, array $body, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
return $this->makeRequest('PUT', $path, $body, $options);
}

/**
* Delete an external account for an account
*
* @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`.
* @param string $external_account_id External account ID, e.g. `s28zov4fw0cb`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalAccount Successful Delete
* @link https://developers.recurly.com/api/v2021-02-25#operation/delete_account_external_account
*/
public function deleteAccountExternalAccount(string $account_id, string $external_account_id, array $options = []): \Recurly\Resources\ExternalAccount
{
$path = $this->interpolatePath("/accounts/{account_id}/external_accounts/{external_account_id}", ['account_id' => $account_id, 'external_account_id' => $external_account_id]);
return $this->makeRequest('DELETE', $path, [], $options);
}

/**
* List the external invoices on an account
*
* @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`.
* @param array $options Associative array of optional parameters
*
* Supported optional query string parameters:
*
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
* - $options['params']['limit'] (int): Limit number of records 1-200.
* - $options['params']['order'] (string): Sort order.
*
* @return \Recurly\Pager A list of the the external_invoices on an account.
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_account_external_invoices
*/
public function listAccountExternalInvoices(string $account_id, array $options = []): \Recurly\Pager
{
$path = $this->interpolatePath("/accounts/{account_id}/external_invoices", ['account_id' => $account_id]);
return new \Recurly\Pager($this, $path, $options);
}

/**
* List an account's invoices
*
Expand Down Expand Up @@ -1567,6 +1670,29 @@ public function getExternalSubscription(string $external_subscription_id, array
return $this->makeRequest('GET', $path, [], $options);
}

/**
* List the external invoices on an external subscription
*
* @param string $external_subscription_id External subscription id
* @param array $options Associative array of optional parameters
*
* Supported optional query string parameters:
*
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
* - $options['params']['limit'] (int): Limit number of records 1-200.
* - $options['params']['order'] (string): Sort order.
*
* @return \Recurly\Pager A list of the the external_invoices on a site.
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscription_external_invoices
*/
public function listExternalSubscriptionExternalInvoices(string $external_subscription_id, array $options = []): \Recurly\Pager
{
$path = $this->interpolatePath("/external_subscriptions/{external_subscription_id}/external_invoices", ['external_subscription_id' => $external_subscription_id]);
return new \Recurly\Pager($this, $path, $options);
}

/**
* List a site's invoices
*
Expand Down Expand Up @@ -3046,6 +3172,43 @@ public function getInvoiceTemplate(string $invoice_template_id, array $options =
return $this->makeRequest('GET', $path, [], $options);
}

/**
* List the external invoices on a site
*
* @param array $options Associative array of optional parameters
*
* Supported optional query string parameters:
*
* - $options['params']['sort'] (string): Sort field. You *really* only want to sort by `updated_at` in ascending
* order. In descending order updated records will move behind the cursor and could
* prevent some records from being returned.
* - $options['params']['limit'] (int): Limit number of records 1-200.
* - $options['params']['order'] (string): Sort order.
*
* @return \Recurly\Pager A list of the the external_invoices on a site.
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_external_invoices
*/
public function listExternalInvoices(array $options = []): \Recurly\Pager
{
$path = $this->interpolatePath("/external_invoices", []);
return new \Recurly\Pager($this, $path, $options);
}

/**
* Fetch an external invoice
*
* @param string $external_invoice_id External invoice ID, e.g. `e28zov4fw0v2`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\ExternalInvoice Returns the external invoice
* @link https://developers.recurly.com/api/v2021-02-25#operation/show_external_invoice
*/
public function showExternalInvoice(string $external_invoice_id, array $options = []): \Recurly\Resources\ExternalInvoice
{
$path = $this->interpolatePath("/external_invoices/{external_invoice_id}", ['external_invoice_id' => $external_invoice_id]);
return $this->makeRequest('GET', $path, [], $options);
}

/**
* List entitlements granted to an account
*
Expand Down
25 changes: 25 additions & 0 deletions lib/recurly/resources/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Account extends RecurlyResource
private $_dunning_campaign_id;
private $_email;
private $_exemption_certificate;
private $_external_accounts;
private $_first_name;
private $_has_active_subscription;
private $_has_canceled_subscription;
Expand All @@ -48,6 +49,7 @@ class Account extends RecurlyResource

protected static $array_hints = [
'setCustomFields' => '\Recurly\Resources\CustomField',
'setExternalAccounts' => '\Recurly\Resources\ExternalAccount',
'setShippingAddresses' => '\Recurly\Resources\ShippingAddress',
];

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

/**
* Getter method for the external_accounts attribute.
* The external accounts belonging to this account
*
* @return array
*/
public function getExternalAccounts(): array
{
return $this->_external_accounts ?? [] ;
}

/**
* Setter method for the external_accounts attribute.
*
* @param array $external_accounts
*
* @return void
*/
public function setExternalAccounts(array $external_accounts): void
{
$this->_external_accounts = $external_accounts;
}

/**
* Getter method for the first_name attribute.
*
Expand Down
Loading

0 comments on commit 55e0726

Please sign in to comment.