Skip to content

Commit 6929bbe

Browse files
Merge pull request #844 from recurly/v3-v2021-02-25-16452920292
Generated Latest Changes for v2021-02-25
2 parents 4d39b9b + cc0580d commit 6929bbe

File tree

11 files changed

+884
-580
lines changed

11 files changed

+884
-580
lines changed

lib/recurly/base_client.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,18 @@ abstract class BaseClient
2626
* Constructor
2727
*
2828
* @param string $api_key The API key to use when making requests
29-
* @param ?LoggerInterface $logger Logger
30-
* @param string $options initialize options
31-
*
32-
* In addition to the options managed by BaseClient, it accepts the following options:
33-
* - "region" to define the Data Center connection - defaults to "us";
29+
* @param ?LoggerInterface $logger Logger
30+
* @param string $options initialize options
31+
* In addition to the
32+
* options managed by
33+
* BaseClient, it
34+
* accepts the
35+
* following options:
36+
* - "region" to
37+
* define the Data
38+
* Center connection
39+
* - defaults to
40+
* "us";
3441
*/
3542
public function __construct(string $api_key, ?LoggerInterface $logger = null, array $options = [])
3643
{

lib/recurly/client.php

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ public function listInvoices(array $options = []): \Recurly\Pager
20462046
/**
20472047
* Fetch an invoice
20482048
*
2049-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2049+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
20502050
* @param array $options Associative array of optional parameters
20512051
*
20522052
* @return \Recurly\Resources\Invoice An invoice.
@@ -2061,7 +2061,7 @@ public function getInvoice(string $invoice_id, array $options = []): \Recurly\Re
20612061
/**
20622062
* Update an invoice
20632063
*
2064-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2064+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
20652065
* @param array $body The body of the request.
20662066
* @param array $options Associative array of optional parameters
20672067
*
@@ -2077,7 +2077,7 @@ public function updateInvoice(string $invoice_id, array $body, array $options =
20772077
/**
20782078
* Fetch an invoice as a PDF
20792079
*
2080-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2080+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
20812081
* @param array $options Associative array of optional parameters
20822082
*
20832083
* @return \Recurly\Resources\BinaryFile An invoice as a PDF.
@@ -2092,7 +2092,7 @@ public function getInvoicePdf(string $invoice_id, array $options = []): \Recurly
20922092
/**
20932093
* Apply available credit to a pending or past due charge invoice
20942094
*
2095-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2095+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
20962096
* @param array $options Associative array of optional parameters
20972097
*
20982098
* @return \Recurly\Resources\Invoice The updated invoice.
@@ -2107,7 +2107,7 @@ public function applyCreditBalance(string $invoice_id, array $options = []): \Re
21072107
/**
21082108
* Collect a pending or past due, automatic invoice
21092109
*
2110-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2110+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
21112111
* @param array $body The body of the request.
21122112
* @param array $options Associative array of optional parameters
21132113
*
@@ -2123,7 +2123,7 @@ public function collectInvoice(string $invoice_id, array $body = [], array $opti
21232123
/**
21242124
* Mark an open invoice as failed
21252125
*
2126-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2126+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
21272127
* @param array $options Associative array of optional parameters
21282128
*
21292129
* @return \Recurly\Resources\Invoice The updated invoice.
@@ -2138,7 +2138,7 @@ public function markInvoiceFailed(string $invoice_id, array $options = []): \Rec
21382138
/**
21392139
* Mark an open invoice as successful
21402140
*
2141-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2141+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
21422142
* @param array $options Associative array of optional parameters
21432143
*
21442144
* @return \Recurly\Resources\Invoice The updated invoice.
@@ -2153,7 +2153,7 @@ public function markInvoiceSuccessful(string $invoice_id, array $options = []):
21532153
/**
21542154
* Reopen a closed, manual invoice
21552155
*
2156-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2156+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
21572157
* @param array $options Associative array of optional parameters
21582158
*
21592159
* @return \Recurly\Resources\Invoice The updated invoice.
@@ -2168,7 +2168,7 @@ public function reopenInvoice(string $invoice_id, array $options = []): \Recurly
21682168
/**
21692169
* Void a credit invoice.
21702170
*
2171-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2171+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
21722172
* @param array $options Associative array of optional parameters
21732173
*
21742174
* @return \Recurly\Resources\Invoice The updated invoice.
@@ -2183,7 +2183,7 @@ public function voidInvoice(string $invoice_id, array $options = []): \Recurly\R
21832183
/**
21842184
* Record an external payment for a manual invoices.
21852185
*
2186-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2186+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
21872187
* @param array $body The body of the request.
21882188
* @param array $options Associative array of optional parameters
21892189
*
@@ -2199,7 +2199,7 @@ public function recordExternalTransaction(string $invoice_id, array $body, array
21992199
/**
22002200
* List an invoice's line items
22012201
*
2202-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2202+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
22032203
* @param array $options Associative array of optional parameters
22042204
*
22052205
* Supported optional query string parameters:
@@ -2240,7 +2240,7 @@ public function listInvoiceLineItems(string $invoice_id, array $options = []): \
22402240
/**
22412241
* List the coupon redemptions applied to an invoice
22422242
*
2243-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2243+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
22442244
* @param array $options Associative array of optional parameters
22452245
*
22462246
* Supported optional query string parameters:
@@ -2276,7 +2276,7 @@ public function listInvoiceCouponRedemptions(string $invoice_id, array $options
22762276
/**
22772277
* List an invoice's related credit or charge invoices
22782278
*
2279-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2279+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
22802280
* @param array $options Associative array of optional parameters
22812281
*
22822282
* @return \Recurly\Pager A list of the credit or charge invoices associated with the invoice.
@@ -2291,7 +2291,7 @@ public function listRelatedInvoices(string $invoice_id, array $options = []): \R
22912291
/**
22922292
* Refund an invoice
22932293
*
2294-
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`.
2294+
* @param string $invoice_id Invoice ID or number. For ID no prefix is used e.g. `e28zov4fw0v2`. For number use prefix `number-`, e.g. `number-1000`. For number with prefix or country code, use `number-` and `prefix`, e.g. `number-TEST-FR1001`
22952295
* @param array $body The body of the request.
22962296
* @param array $options Associative array of optional parameters
22972297
*
@@ -2577,6 +2577,51 @@ public function removePlanAddOn(string $plan_id, string $add_on_id, array $optio
25772577
return $this->makeRequest('DELETE', $path, [], $options);
25782578
}
25792579

2580+
/**
2581+
* List a site's price segments
2582+
*
2583+
* @param array $options Associative array of optional parameters
2584+
*
2585+
* Supported optional query string parameters:
2586+
*
2587+
* - $options['params']['ids'] (array): Filter results by their IDs. Up to 200 IDs can be passed at once using
2588+
* commas as separators, e.g. `ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6`.
2589+
*
2590+
* **Important notes:**
2591+
*
2592+
* * The `ids` parameter cannot be used with any other ordering or filtering
2593+
* parameters (`limit`, `order`, `sort`, `begin_time`, `end_time`, etc)
2594+
* * Invalid or unknown IDs will be ignored, so you should check that the
2595+
* results correspond to your request.
2596+
* * Records are returned in an arbitrary order. Since results are all
2597+
* returned at once you can sort the records yourself.
2598+
* - $options['params']['limit'] (int): Limit number of records 1-200.
2599+
* - $options['params']['order'] (string): Sort order.
2600+
*
2601+
* @return \Recurly\Pager A list of price segments.
2602+
* @link https://developers.recurly.com/api/v2021-02-25#operation/list_price_segments
2603+
*/
2604+
public function listPriceSegments(array $options = []): \Recurly\Pager
2605+
{
2606+
$path = $this->interpolatePath("/price_segments", []);
2607+
return new \Recurly\Pager($this, $path, $options);
2608+
}
2609+
2610+
/**
2611+
* Fetch a price segment
2612+
*
2613+
* @param string $price_segment_id The price segment ID or code. For ID no prefix is used e.g. `e28zov4fw0v2`. For code use prefix `code-`, e.g. `code-gold`.
2614+
* @param array $options Associative array of optional parameters
2615+
*
2616+
* @return \Recurly\Resources\PriceSegment A price segment.
2617+
* @link https://developers.recurly.com/api/v2021-02-25#operation/get_price_segment
2618+
*/
2619+
public function getPriceSegment(string $price_segment_id, array $options = []): \Recurly\Resources\PriceSegment
2620+
{
2621+
$path = $this->interpolatePath("/price_segments/{price_segment_id}", ['price_segment_id' => $price_segment_id]);
2622+
return $this->makeRequest('GET', $path, [], $options);
2623+
}
2624+
25802625
/**
25812626
* List a site's add-ons
25822627
*

lib/recurly/recurly_resource.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ public static function fromEmpty(\Recurly\Response $response): \Recurly\EmptyRes
7373
/**
7474
* Converts a Recurly response object into a \Recurly\RecurlyResource.
7575
*
76-
* @param \Recurly\Response $response The Recurly HTTP Response
77-
* @param ?object $json (optional) JSON payload to use instead of
78-
* the $response's. Primarily used for errors
76+
* @param \Recurly\Response $response The Recurly HTTP Response
77+
* @param ?object $json (optional) JSON payload to use instead of
78+
* the $response's. Primarily used for
79+
* errors
7980
*
8081
* @return \Recurly\RecurlyResource An instance of a Recurly Resource
8182
*/

0 commit comments

Comments
 (0)