Skip to content

Commit 7781524

Browse files
authored
Merge pull request #665 from recurly/v3-v2021-02-25-7117510228
Generated Latest Changes for v2021-02-25 (External Payment Phases)
2 parents 38c9860 + 8c1c8f5 commit 7781524

File tree

3 files changed

+298
-4
lines changed

3 files changed

+298
-4
lines changed

openapi/api.yaml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ x-tagGroups:
207207
- external_products
208208
- external_accounts
209209
- external_product_references
210+
- external_payment_phases
210211
- name: Products and Promotions
211212
tags:
212213
- item
@@ -366,6 +367,11 @@ tags:
366367
x-displayName: External Product Reference
367368
description: Associates an external product to a corresponding resource on an external
368369
platform like the Apple App Store or Google Play Store.
370+
- name: external_payment_phases
371+
x-displayName: External Payment Phase
372+
description: Details of payments in the lifecycle of a subscription from an external
373+
resource that is not managed by the Recurly platform, e.g. App Store or Google
374+
Play Store.
369375
- name: gift_cards
370376
x-displayName: Gift Cards
371377
description: Add gift card purchases to your checkout and allow gift card recipients
@@ -15918,6 +15924,69 @@ paths:
1591815924
schema:
1591915925
"$ref": "#/components/schemas/Error"
1592015926
x-code-samples: []
15927+
"/external_subscriptions/{external_subscription_id}/external_payment_phases":
15928+
parameters:
15929+
- "$ref": "#/components/parameters/external_subscription_id"
15930+
get:
15931+
tags:
15932+
- external_subscriptions
15933+
operationId: list_external_subscription_external_payment_phases
15934+
summary: List the external payment phases on an external subscription
15935+
description: See the [Pagination Guide](/developers/guides/pagination.html)
15936+
to learn how to use pagination in the API and Client Libraries.
15937+
parameters:
15938+
- "$ref": "#/components/parameters/sort_dates"
15939+
- "$ref": "#/components/parameters/limit"
15940+
- "$ref": "#/components/parameters/order"
15941+
responses:
15942+
'200':
15943+
description: A list of the the external_payment_phases on a site.
15944+
content:
15945+
application/json:
15946+
schema:
15947+
"$ref": "#/components/schemas/ExternalPaymentPhaseList"
15948+
'404':
15949+
description: Incorrect site.
15950+
content:
15951+
application/json:
15952+
schema:
15953+
"$ref": "#/components/schemas/Error"
15954+
default:
15955+
description: Unexpected error.
15956+
content:
15957+
application/json:
15958+
schema:
15959+
"$ref": "#/components/schemas/Error"
15960+
x-code-samples: []
15961+
"/external_subscriptions/{external_subscription_id}/external_payment_phases/{external_payment_phase_id}":
15962+
parameters:
15963+
- "$ref": "#/components/parameters/external_subscription_id"
15964+
- "$ref": "#/components/parameters/external_payment_phase_id"
15965+
get:
15966+
tags:
15967+
- external_payment_phases
15968+
operationId: get_external_subscription_external_payment_phase
15969+
summary: Fetch an external payment_phase
15970+
responses:
15971+
'200':
15972+
description: Details for an external payment_phase.
15973+
content:
15974+
application/json:
15975+
schema:
15976+
"$ref": "#/components/schemas/ExternalPaymentPhase"
15977+
'404':
15978+
description: Incorrect site or external subscription ID.
15979+
content:
15980+
application/json:
15981+
schema:
15982+
"$ref": "#/components/schemas/Error"
15983+
default:
15984+
description: Unexpected error.
15985+
content:
15986+
application/json:
15987+
schema:
15988+
"$ref": "#/components/schemas/Error"
15989+
x-code-samples: []
1592115990
"/accounts/{account_id}/entitlements":
1592215991
parameters:
1592315992
- "$ref": "#/components/parameters/account_id"
@@ -16355,6 +16424,13 @@ components:
1635516424
required: true
1635616425
schema:
1635716426
type: string
16427+
external_payment_phase_id:
16428+
name: external_payment_phase_id
16429+
in: path
16430+
description: External payment phase ID, e.g. `a34ypb2ef9w1`.
16431+
required: true
16432+
schema:
16433+
type: string
1635816434
invoice_template_id:
1635916435
name: invoice_template_id
1636016436
in: path
@@ -21633,6 +21709,7 @@ components:
2163321709
type: number
2163421710
format: float
2163521711
title: Estimated tax
21712+
description: Only for merchants using Recurly's In-The-Box taxes.
2163621713
tax_info:
2163721714
"$ref": "#/components/schemas/TaxInfo"
2163821715
total:
@@ -22464,6 +22541,12 @@ components:
2246422541
default: 0
2246522542
net_terms_type:
2246622543
"$ref": "#/components/schemas/NetTermsTypeEnum"
22544+
gateway_code:
22545+
type: string
22546+
title: Gateway Code
22547+
description: If present, this subscription's transactions will use the payment
22548+
gateway with this code.
22549+
maxLength: 13
2246722550
transaction_type:
2246822551
description: An optional type designation for the payment gateway transaction
2246922552
created by this request. Supports 'moto' value, which is the acronym for
@@ -22805,6 +22888,7 @@ components:
2280522888
TaxInfo:
2280622889
type: object
2280722890
title: Tax info
22891+
description: Only for merchants using Recurly's In-The-Box taxes.
2280822892
properties:
2280922893
type:
2281022894
type: string
@@ -23646,6 +23730,90 @@ components:
2364623730
type: string
2364723731
format: date-time
2364823732
description: Time the object was last updated
23733+
ExternalPaymentPhase:
23734+
type: object
23735+
description: Details of payments in the lifecycle of a subscription from an
23736+
external resource that is not managed by the Recurly platform, e.g. App Store
23737+
or Google Play Store.
23738+
properties:
23739+
id:
23740+
type: string
23741+
title: External payment phase ID
23742+
description: System-generated unique identifier for an external payment
23743+
phase ID, e.g. `e28zov4fw0v2`.
23744+
object:
23745+
type: string
23746+
title: Object type
23747+
external_subscription:
23748+
"$ref": "#/components/schemas/ExternalSubscription"
23749+
started_at:
23750+
type: string
23751+
format: date-time
23752+
title: Started At
23753+
ends_at:
23754+
type: string
23755+
format: date-time
23756+
title: Ends At
23757+
starting_billing_period_index:
23758+
type: integer
23759+
title: Starting Billing Period Index
23760+
ending_billing_period_index:
23761+
type: integer
23762+
title: Ending Billing Period Index
23763+
offer_type:
23764+
type: string
23765+
title: Offer Type
23766+
description: Type of discount offer given, e.g. "FREE_TRIAL"
23767+
offer_name:
23768+
type: string
23769+
title: Offer Name
23770+
description: Name of the discount offer given, e.g. "introductory"
23771+
period_count:
23772+
type: integer
23773+
title: Period Count
23774+
description: Number of billing periods
23775+
period_length:
23776+
type: string
23777+
title: Period Length
23778+
description: Billing cycle length
23779+
amount:
23780+
type: string
23781+
format: decimal
23782+
title: Amount
23783+
minimum: 0
23784+
description: Allows up to 9 decimal places
23785+
currency:
23786+
type: string
23787+
title: Currency
23788+
description: 3-letter ISO 4217 currency code.
23789+
maxLength: 3
23790+
created_at:
23791+
type: string
23792+
format: date-time
23793+
title: Created at
23794+
description: When the external subscription was created in Recurly.
23795+
updated_at:
23796+
type: string
23797+
format: date-time
23798+
title: Updated at
23799+
description: When the external subscription was updated in Recurly.
23800+
ExternalPaymentPhaseList:
23801+
type: object
23802+
properties:
23803+
object:
23804+
type: string
23805+
title: Object type
23806+
description: Will always be List.
23807+
has_more:
23808+
type: boolean
23809+
description: Indicates there are more results on subsequent pages.
23810+
next:
23811+
type: string
23812+
description: Path to subsequent page of results.
23813+
data:
23814+
type: array
23815+
items:
23816+
"$ref": "#/components/schemas/ExternalPaymentPhase"
2364923817
ExternalProduct:
2365023818
type: object
2365123819
description: Product from an external resource such as Apple App Store or Google

recurly/client.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5048,6 +5048,77 @@ def show_external_invoice(self, external_invoice_id, **options):
50485048
path = self._interpolate_path("/external_invoices/%s", external_invoice_id)
50495049
return self._make_request("GET", path, None, **options)
50505050

5051+
def list_external_subscription_external_payment_phases(
5052+
self, external_subscription_id, **options
5053+
):
5054+
"""List the external payment phases on an external subscription
5055+
5056+
Parameters
5057+
----------
5058+
5059+
external_subscription_id : str
5060+
External subscription id
5061+
5062+
Keyword Arguments
5063+
-----------------
5064+
5065+
headers : dict
5066+
Extra HTTP headers to send with the request.
5067+
params : dict
5068+
Query Parameters.
5069+
params.sort : str
5070+
Sort field. You *really* only want to sort by `updated_at` in ascending
5071+
order. In descending order updated records will move behind the cursor and could
5072+
prevent some records from being returned.
5073+
params.limit : int
5074+
Limit number of records 1-200.
5075+
params.order : str
5076+
Sort order.
5077+
5078+
Returns
5079+
-------
5080+
5081+
Pager
5082+
A list of the the external_payment_phases on a site.
5083+
"""
5084+
path = self._interpolate_path(
5085+
"/external_subscriptions/%s/external_payment_phases",
5086+
external_subscription_id,
5087+
)
5088+
return Pager(self, path, **options)
5089+
5090+
def get_external_subscription_external_payment_phase(
5091+
self, external_subscription_id, external_payment_phase_id, **options
5092+
):
5093+
"""Fetch an external payment_phase
5094+
5095+
Parameters
5096+
----------
5097+
5098+
external_subscription_id : str
5099+
External subscription id
5100+
external_payment_phase_id : str
5101+
External payment phase ID, e.g. `a34ypb2ef9w1`.
5102+
5103+
Keyword Arguments
5104+
-----------------
5105+
5106+
headers : dict
5107+
Extra HTTP headers to send with the request.
5108+
5109+
Returns
5110+
-------
5111+
5112+
ExternalPaymentPhase
5113+
Details for an external payment_phase.
5114+
"""
5115+
path = self._interpolate_path(
5116+
"/external_subscriptions/%s/external_payment_phases/%s",
5117+
external_subscription_id,
5118+
external_payment_phase_id,
5119+
)
5120+
return self._make_request("GET", path, None, **options)
5121+
50515122
def list_entitlements(self, account_id, **options):
50525123
"""List entitlements granted to an account
50535124

recurly/resources.py

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ class Invoice(Resource):
14491449
tax : float
14501450
The total tax on this invoice.
14511451
tax_info : TaxInfo
1452-
Tax info
1452+
Only for merchants using Recurly's In-The-Box taxes.
14531453
terms_and_conditions : str
14541454
This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions.
14551455
total : float
@@ -1716,7 +1716,7 @@ class LineItem(Resource):
17161716
tax_inclusive : bool
17171717
Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
17181718
tax_info : TaxInfo
1719-
Tax info
1719+
Only for merchants using Recurly's In-The-Box taxes.
17201720
taxable : bool
17211721
`true` if the line item is taxable, `false` if it is not.
17221722
type : str
@@ -1961,11 +1961,11 @@ class Subscription(Resource):
19611961
subtotal : float
19621962
Estimated total, before tax.
19631963
tax : float
1964-
Estimated tax
1964+
Only for merchants using Recurly's In-The-Box taxes.
19651965
tax_inclusive : bool
19661966
Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to utilize this flag.
19671967
tax_info : TaxInfo
1968-
Tax info
1968+
Only for merchants using Recurly's In-The-Box taxes.
19691969
terms_and_conditions : str
19701970
Terms and conditions
19711971
total : float
@@ -3383,6 +3383,61 @@ class InvoiceTemplate(Resource):
33833383
}
33843384

33853385

3386+
class ExternalPaymentPhase(Resource):
3387+
"""
3388+
Attributes
3389+
----------
3390+
amount : str
3391+
Allows up to 9 decimal places
3392+
created_at : datetime
3393+
When the external subscription was created in Recurly.
3394+
currency : str
3395+
3-letter ISO 4217 currency code.
3396+
ending_billing_period_index : int
3397+
Ending Billing Period Index
3398+
ends_at : datetime
3399+
Ends At
3400+
external_subscription : ExternalSubscription
3401+
Subscription from an external resource such as Apple App Store or Google Play Store.
3402+
id : str
3403+
System-generated unique identifier for an external payment phase ID, e.g. `e28zov4fw0v2`.
3404+
object : str
3405+
Object type
3406+
offer_name : str
3407+
Name of the discount offer given, e.g. "introductory"
3408+
offer_type : str
3409+
Type of discount offer given, e.g. "FREE_TRIAL"
3410+
period_count : int
3411+
Number of billing periods
3412+
period_length : str
3413+
Billing cycle length
3414+
started_at : datetime
3415+
Started At
3416+
starting_billing_period_index : int
3417+
Starting Billing Period Index
3418+
updated_at : datetime
3419+
When the external subscription was updated in Recurly.
3420+
"""
3421+
3422+
schema = {
3423+
"amount": str,
3424+
"created_at": datetime,
3425+
"currency": str,
3426+
"ending_billing_period_index": int,
3427+
"ends_at": datetime,
3428+
"external_subscription": "ExternalSubscription",
3429+
"id": str,
3430+
"object": str,
3431+
"offer_name": str,
3432+
"offer_type": str,
3433+
"period_count": int,
3434+
"period_length": str,
3435+
"started_at": datetime,
3436+
"starting_billing_period_index": int,
3437+
"updated_at": datetime,
3438+
}
3439+
3440+
33863441
class Entitlements(Resource):
33873442
"""
33883443
Attributes

0 commit comments

Comments
 (0)