diff --git a/lib/recurly/client.php b/lib/recurly/client.php index 7bb94571..fdff23d2 100644 --- a/lib/recurly/client.php +++ b/lib/recurly/client.php @@ -3324,6 +3324,45 @@ public function showExternalInvoice(string $external_invoice_id, array $options return $this->makeRequest('GET', $path, [], $options); } + /** + * List the external payment phases 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_payment_phases on a site. + * @link https://developers.recurly.com/api/v2021-02-25#operation/list_external_subscription_external_payment_phases + */ + public function listExternalSubscriptionExternalPaymentPhases(string $external_subscription_id, array $options = []): \Recurly\Pager + { + $path = $this->interpolatePath("/external_subscriptions/{external_subscription_id}/external_payment_phases", ['external_subscription_id' => $external_subscription_id]); + return new \Recurly\Pager($this, $path, $options); + } + + /** + * Fetch an external payment_phase + * + * @param string $external_subscription_id External subscription id + * @param string $external_payment_phase_id External payment phase ID, e.g. `a34ypb2ef9w1`. + * @param array $options Associative array of optional parameters + * + * @return \Recurly\Resources\ExternalPaymentPhase Details for an external payment_phase. + * @link https://developers.recurly.com/api/v2021-02-25#operation/get_external_subscription_external_payment_phase + */ + public function getExternalSubscriptionExternalPaymentPhase(string $external_subscription_id, string $external_payment_phase_id, array $options = []): \Recurly\Resources\ExternalPaymentPhase + { + $path = $this->interpolatePath("/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}", ['external_subscription_id' => $external_subscription_id, 'external_payment_phase_id' => $external_payment_phase_id]); + return $this->makeRequest('GET', $path, [], $options); + } + /** * List entitlements granted to an account * diff --git a/lib/recurly/resources/external_payment_phase.php b/lib/recurly/resources/external_payment_phase.php new file mode 100644 index 00000000..94100450 --- /dev/null +++ b/lib/recurly/resources/external_payment_phase.php @@ -0,0 +1,379 @@ +_amount; + } + + /** + * Setter method for the amount attribute. + * + * @param string $amount + * + * @return void + */ + public function setAmount(string $amount): void + { + $this->_amount = $amount; + } + + /** + * Getter method for the created_at attribute. + * When the external subscription was created in Recurly. + * + * @return ?string + */ + public function getCreatedAt(): ?string + { + return $this->_created_at; + } + + /** + * Setter method for the created_at attribute. + * + * @param string $created_at + * + * @return void + */ + public function setCreatedAt(string $created_at): void + { + $this->_created_at = $created_at; + } + + /** + * Getter method for the currency attribute. + * 3-letter ISO 4217 currency code. + * + * @return ?string + */ + public function getCurrency(): ?string + { + return $this->_currency; + } + + /** + * Setter method for the currency attribute. + * + * @param string $currency + * + * @return void + */ + public function setCurrency(string $currency): void + { + $this->_currency = $currency; + } + + /** + * Getter method for the ending_billing_period_index attribute. + * Ending Billing Period Index + * + * @return ?int + */ + public function getEndingBillingPeriodIndex(): ?int + { + return $this->_ending_billing_period_index; + } + + /** + * Setter method for the ending_billing_period_index attribute. + * + * @param int $ending_billing_period_index + * + * @return void + */ + public function setEndingBillingPeriodIndex(int $ending_billing_period_index): void + { + $this->_ending_billing_period_index = $ending_billing_period_index; + } + + /** + * Getter method for the ends_at attribute. + * Ends At + * + * @return ?string + */ + public function getEndsAt(): ?string + { + return $this->_ends_at; + } + + /** + * Setter method for the ends_at attribute. + * + * @param string $ends_at + * + * @return void + */ + public function setEndsAt(string $ends_at): void + { + $this->_ends_at = $ends_at; + } + + /** + * Getter method for the external_subscription attribute. + * Subscription from an external resource such as Apple App Store or Google Play Store. + * + * @return ?\Recurly\Resources\ExternalSubscription + */ + public function getExternalSubscription(): ?\Recurly\Resources\ExternalSubscription + { + return $this->_external_subscription; + } + + /** + * Setter method for the external_subscription attribute. + * + * @param \Recurly\Resources\ExternalSubscription $external_subscription + * + * @return void + */ + public function setExternalSubscription(\Recurly\Resources\ExternalSubscription $external_subscription): void + { + $this->_external_subscription = $external_subscription; + } + + /** + * Getter method for the id attribute. + * System-generated unique identifier for an external payment phase ID, e.g. `e28zov4fw0v2`. + * + * @return ?string + */ + public function getId(): ?string + { + return $this->_id; + } + + /** + * Setter method for the id attribute. + * + * @param string $id + * + * @return void + */ + public function setId(string $id): void + { + $this->_id = $id; + } + + /** + * Getter method for the object attribute. + * Object type + * + * @return ?string + */ + public function getObject(): ?string + { + return $this->_object; + } + + /** + * Setter method for the object attribute. + * + * @param string $object + * + * @return void + */ + public function setObject(string $object): void + { + $this->_object = $object; + } + + /** + * Getter method for the offer_name attribute. + * Name of the discount offer given, e.g. "introductory" + * + * @return ?string + */ + public function getOfferName(): ?string + { + return $this->_offer_name; + } + + /** + * Setter method for the offer_name attribute. + * + * @param string $offer_name + * + * @return void + */ + public function setOfferName(string $offer_name): void + { + $this->_offer_name = $offer_name; + } + + /** + * Getter method for the offer_type attribute. + * Type of discount offer given, e.g. "FREE_TRIAL" + * + * @return ?string + */ + public function getOfferType(): ?string + { + return $this->_offer_type; + } + + /** + * Setter method for the offer_type attribute. + * + * @param string $offer_type + * + * @return void + */ + public function setOfferType(string $offer_type): void + { + $this->_offer_type = $offer_type; + } + + /** + * Getter method for the period_count attribute. + * Number of billing periods + * + * @return ?int + */ + public function getPeriodCount(): ?int + { + return $this->_period_count; + } + + /** + * Setter method for the period_count attribute. + * + * @param int $period_count + * + * @return void + */ + public function setPeriodCount(int $period_count): void + { + $this->_period_count = $period_count; + } + + /** + * Getter method for the period_length attribute. + * Billing cycle length + * + * @return ?string + */ + public function getPeriodLength(): ?string + { + return $this->_period_length; + } + + /** + * Setter method for the period_length attribute. + * + * @param string $period_length + * + * @return void + */ + public function setPeriodLength(string $period_length): void + { + $this->_period_length = $period_length; + } + + /** + * Getter method for the started_at attribute. + * Started At + * + * @return ?string + */ + public function getStartedAt(): ?string + { + return $this->_started_at; + } + + /** + * Setter method for the started_at attribute. + * + * @param string $started_at + * + * @return void + */ + public function setStartedAt(string $started_at): void + { + $this->_started_at = $started_at; + } + + /** + * Getter method for the starting_billing_period_index attribute. + * Starting Billing Period Index + * + * @return ?int + */ + public function getStartingBillingPeriodIndex(): ?int + { + return $this->_starting_billing_period_index; + } + + /** + * Setter method for the starting_billing_period_index attribute. + * + * @param int $starting_billing_period_index + * + * @return void + */ + public function setStartingBillingPeriodIndex(int $starting_billing_period_index): void + { + $this->_starting_billing_period_index = $starting_billing_period_index; + } + + /** + * Getter method for the updated_at attribute. + * When the external subscription was updated in Recurly. + * + * @return ?string + */ + public function getUpdatedAt(): ?string + { + return $this->_updated_at; + } + + /** + * Setter method for the updated_at attribute. + * + * @param string $updated_at + * + * @return void + */ + public function setUpdatedAt(string $updated_at): void + { + $this->_updated_at = $updated_at; + } +} \ No newline at end of file diff --git a/lib/recurly/resources/invoice.php b/lib/recurly/resources/invoice.php index 28b03287..df083cb9 100644 --- a/lib/recurly/resources/invoice.php +++ b/lib/recurly/resources/invoice.php @@ -842,7 +842,7 @@ public function setTax(float $tax): void /** * Getter method for the tax_info attribute. - * Tax info + * Only for merchants using Recurly's In-The-Box taxes. * * @return ?\Recurly\Resources\TaxInfo */ diff --git a/lib/recurly/resources/line_item.php b/lib/recurly/resources/line_item.php index c0887e91..1e86f217 100644 --- a/lib/recurly/resources/line_item.php +++ b/lib/recurly/resources/line_item.php @@ -1136,7 +1136,7 @@ public function setTaxInclusive(bool $tax_inclusive): void /** * Getter method for the tax_info attribute. - * Tax info + * Only for merchants using Recurly's In-The-Box taxes. * * @return ?\Recurly\Resources\TaxInfo */ diff --git a/lib/recurly/resources/subscription.php b/lib/recurly/resources/subscription.php index e203593a..4460f1ff 100644 --- a/lib/recurly/resources/subscription.php +++ b/lib/recurly/resources/subscription.php @@ -1059,7 +1059,7 @@ public function setSubtotal(float $subtotal): void /** * Getter method for the tax attribute. - * Estimated tax + * Only for merchants using Recurly's In-The-Box taxes. * * @return ?float */ @@ -1105,7 +1105,7 @@ public function setTaxInclusive(bool $tax_inclusive): void /** * Getter method for the tax_info attribute. - * Tax info + * Only for merchants using Recurly's In-The-Box taxes. * * @return ?\Recurly\Resources\TaxInfo */ diff --git a/openapi/api.yaml b/openapi/api.yaml index fe2608a2..c9e015a8 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -207,6 +207,7 @@ x-tagGroups: - external_products - external_accounts - external_product_references + - external_payment_phases - name: Products and Promotions tags: - item @@ -366,6 +367,11 @@ tags: x-displayName: External Product Reference description: Associates an external product to a corresponding resource on an external platform like the Apple App Store or Google Play Store. +- name: external_payment_phases + x-displayName: External Payment Phase + description: Details of payments in the lifecycle of a subscription from an external + resource that is not managed by the Recurly platform, e.g. App Store or Google + Play Store. - name: gift_cards x-displayName: Gift Cards description: Add gift card purchases to your checkout and allow gift card recipients @@ -15918,6 +15924,69 @@ paths: schema: "$ref": "#/components/schemas/Error" x-code-samples: [] + "/external_subscriptions/{external_subscription_id}/external_payment_phases": + parameters: + - "$ref": "#/components/parameters/external_subscription_id" + get: + tags: + - external_subscriptions + operationId: list_external_subscription_external_payment_phases + summary: List the external payment phases on an external subscription + description: See the [Pagination Guide](/developers/guides/pagination.html) + to learn how to use pagination in the API and Client Libraries. + parameters: + - "$ref": "#/components/parameters/sort_dates" + - "$ref": "#/components/parameters/limit" + - "$ref": "#/components/parameters/order" + responses: + '200': + description: A list of the the external_payment_phases on a site. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalPaymentPhaseList" + '404': + description: Incorrect site. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] + "/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}": + parameters: + - "$ref": "#/components/parameters/external_subscription_id" + - "$ref": "#/components/parameters/external_payment_phase_id" + get: + tags: + - external_payment_phases + operationId: get_external_subscription_external_payment_phase + summary: Fetch an external payment_phase + responses: + '200': + description: Details for an external payment_phase. + content: + application/json: + schema: + "$ref": "#/components/schemas/ExternalPaymentPhase" + '404': + description: Incorrect site or external subscription ID. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/accounts/{account_id}/entitlements": parameters: - "$ref": "#/components/parameters/account_id" @@ -16355,6 +16424,13 @@ components: required: true schema: type: string + external_payment_phase_id: + name: external_payment_phase_id + in: path + description: External payment phase ID, e.g. `a34ypb2ef9w1`. + required: true + schema: + type: string invoice_template_id: name: invoice_template_id in: path @@ -21633,6 +21709,7 @@ components: type: number format: float title: Estimated tax + description: Only for merchants using Recurly's In-The-Box taxes. tax_info: "$ref": "#/components/schemas/TaxInfo" total: @@ -22464,6 +22541,12 @@ components: default: 0 net_terms_type: "$ref": "#/components/schemas/NetTermsTypeEnum" + gateway_code: + type: string + title: Gateway Code + description: If present, this subscription's transactions will use the payment + gateway with this code. + maxLength: 13 transaction_type: description: An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for @@ -22805,6 +22888,7 @@ components: TaxInfo: type: object title: Tax info + description: Only for merchants using Recurly's In-The-Box taxes. properties: type: type: string @@ -23646,6 +23730,90 @@ components: type: string format: date-time description: Time the object was last updated + ExternalPaymentPhase: + type: object + description: Details of payments in the lifecycle of a subscription from an + external resource that is not managed by the Recurly platform, e.g. App Store + or Google Play Store. + properties: + id: + type: string + title: External payment phase ID + description: System-generated unique identifier for an external payment + phase ID, e.g. `e28zov4fw0v2`. + object: + type: string + title: Object type + external_subscription: + "$ref": "#/components/schemas/ExternalSubscription" + started_at: + type: string + format: date-time + title: Started At + ends_at: + type: string + format: date-time + title: Ends At + starting_billing_period_index: + type: integer + title: Starting Billing Period Index + ending_billing_period_index: + type: integer + title: Ending Billing Period Index + offer_type: + type: string + title: Offer Type + description: Type of discount offer given, e.g. "FREE_TRIAL" + offer_name: + type: string + title: Offer Name + description: Name of the discount offer given, e.g. "introductory" + period_count: + type: integer + title: Period Count + description: Number of billing periods + period_length: + type: string + title: Period Length + description: Billing cycle length + amount: + type: string + format: decimal + title: Amount + minimum: 0 + description: Allows up to 9 decimal places + currency: + type: string + title: Currency + description: 3-letter ISO 4217 currency code. + maxLength: 3 + created_at: + type: string + format: date-time + title: Created at + description: When the external subscription was created in Recurly. + updated_at: + type: string + format: date-time + title: Updated at + description: When the external subscription was updated in Recurly. + ExternalPaymentPhaseList: + type: object + properties: + object: + type: string + title: Object type + description: Will always be List. + has_more: + type: boolean + description: Indicates there are more results on subsequent pages. + next: + type: string + description: Path to subsequent page of results. + data: + type: array + items: + "$ref": "#/components/schemas/ExternalPaymentPhase" ExternalProduct: type: object description: Product from an external resource such as Apple App Store or Google