Skip to content

Commit d8c19ff

Browse files
Merge pull request #691 from recurly/v3-v2021-02-25-8899612454
Generated Latest Changes for v2021-02-25 (Auth & Capture)
2 parents 7294ca7 + 6c8c271 commit d8c19ff

File tree

3 files changed

+200
-6
lines changed

3 files changed

+200
-6
lines changed

openapi/api.yaml

Lines changed: 126 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15470,6 +15470,132 @@ paths:
1547015470
validation: %v\", e)\n\t\treturn nil, err\n\t}\n\n\tfmt.Printf(\"Unexpected
1547115471
Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Created ChargeInvoice
1547215472
with UUID: %s.\\n\", collection.ChargeInvoice.Uuid)\n"
15473+
"/purchases/authorize":
15474+
post:
15475+
tags:
15476+
- purchase
15477+
operationId: create_authorize_purchase
15478+
summary: Authorize a purchase
15479+
description: |-
15480+
A purchase is a hybrid checkout containing at least one or more subscriptions or one-time charges (adjustments) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction. A purchase is only a request data type and is not persistent in Recurly and an invoice collection will be the returned type.
15481+
15482+
The authorize endpoint will create a pending purchase that can be activated at a later time once payment has been completed on an external source.
15483+
15484+
For additional information regarding shipping fees, please see https://docs.recurly.com/docs/shipping
15485+
requestBody:
15486+
content:
15487+
application/json:
15488+
schema:
15489+
"$ref": "#/components/schemas/PurchaseCreate"
15490+
required: true
15491+
responses:
15492+
'200':
15493+
description: Returns the authorize invoice
15494+
content:
15495+
application/json:
15496+
schema:
15497+
"$ref": "#/components/schemas/InvoiceCollection"
15498+
'400':
15499+
description: Bad request; perhaps missing or invalid parameters.
15500+
content:
15501+
application/json:
15502+
schema:
15503+
"$ref": "#/components/schemas/Error"
15504+
'422':
15505+
description: authorize purchase cannot be completed for the specified reason.
15506+
content:
15507+
application/json:
15508+
schema:
15509+
"$ref": "#/components/schemas/Error"
15510+
default:
15511+
description: Unexpected error.
15512+
content:
15513+
application/json:
15514+
schema:
15515+
"$ref": "#/components/schemas/Error"
15516+
x-code-samples: []
15517+
"/purchases/{transaction_id}/capture":
15518+
post:
15519+
tags:
15520+
- purchase
15521+
parameters:
15522+
- "$ref": "#/components/parameters/transaction_id"
15523+
operationId: create_capture_purchase
15524+
summary: Capture a purchase
15525+
description: |-
15526+
A purchase is a hybrid checkout containing at least one or more
15527+
subscriptions or one-time charges (adjustments) and supports both coupon
15528+
and gift card redemptions. All items purchased will be on one invoice
15529+
and paid for with one transaction. A purchase is only a request data
15530+
type and is not persistent in Recurly and an invoice collection will be
15531+
the returned type.
15532+
15533+
15534+
Capture an open Authorization request
15535+
responses:
15536+
'200':
15537+
description: Returns the captured invoice
15538+
content:
15539+
application/json:
15540+
schema:
15541+
"$ref": "#/components/schemas/InvoiceCollection"
15542+
'400':
15543+
description: Bad request; perhaps missing or invalid parameters.
15544+
content:
15545+
application/json:
15546+
schema:
15547+
"$ref": "#/components/schemas/Error"
15548+
'422':
15549+
description: Capture purchase cannot be completed for the specified reason.
15550+
content:
15551+
application/json:
15552+
schema:
15553+
"$ref": "#/components/schemas/Error"
15554+
default:
15555+
description: Unexpected error.
15556+
content:
15557+
application/json:
15558+
schema:
15559+
"$ref": "#/components/schemas/Error"
15560+
x-code-samples: []
15561+
"/purchases/{transaction_id}/cancel/":
15562+
parameters:
15563+
- "$ref": "#/components/parameters/transaction_id"
15564+
post:
15565+
summary: Cancel Purchase
15566+
description: |
15567+
A purchase is a hybrid checkout containing at least one or more subscriptions or one-time charges (adjustments) and supports both coupon and gift card redemptions. All items purchased will be on one invoice and paid for with one transaction. A purchase is only a request data type and is not persistent in Recurly and an invoice collection will be the returned type.
15568+
15569+
Cancel an open Authorization request
15570+
tags:
15571+
- purchase
15572+
operationId: cancelPurchase
15573+
responses:
15574+
'200':
15575+
description: Returns the cancelled invoice
15576+
content:
15577+
application/json:
15578+
schema:
15579+
"$ref": "#/components/schemas/InvoiceCollection"
15580+
'400':
15581+
description: Bad request; perhaps missing or invalid parameters.
15582+
content:
15583+
application/json:
15584+
schema:
15585+
"$ref": "#/components/schemas/Error"
15586+
'422':
15587+
description: Cancel purchase cannot be completed for the specified reason.
15588+
content:
15589+
application/json:
15590+
schema:
15591+
"$ref": "#/components/schemas/Error"
15592+
default:
15593+
description: Unexpected error.
15594+
content:
15595+
application/json:
15596+
schema:
15597+
"$ref": "#/components/schemas/Error"
15598+
x-code-samples: []
1547315599
"/export_dates":
1547415600
get:
1547515601
tags:
@@ -25178,8 +25304,6 @@ components:
2517825304
Optionally supplied string that may be either `net` or `eom` (end-of-month).
2517925305
When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date.
2518025306
When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.
25181-
25182-
This field is only available when the EOM Net Terms feature is enabled.
2518325307
enum:
2518425308
- net
2518525309
- eom

recurly/client.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4834,6 +4834,80 @@ def create_pending_purchase(self, body, **options):
48344834
)
48354835
return self._make_request("POST", path, body, **options)
48364836

4837+
def create_authorize_purchase(self, body, **options):
4838+
"""Authorize a purchase
4839+
4840+
Parameters
4841+
----------
4842+
4843+
body : dict
4844+
The request body. It should follow the schema of PurchaseCreate.
4845+
4846+
Keyword Arguments
4847+
-----------------
4848+
4849+
headers : dict
4850+
Extra HTTP headers to send with the request.
4851+
4852+
Returns
4853+
-------
4854+
4855+
InvoiceCollection
4856+
Returns the authorize invoice
4857+
"""
4858+
path = self._interpolate_path(
4859+
"/purchases/authorize",
4860+
)
4861+
return self._make_request("POST", path, body, **options)
4862+
4863+
def create_capture_purchase(self, transaction_id, **options):
4864+
"""Capture a purchase
4865+
4866+
Parameters
4867+
----------
4868+
4869+
transaction_id : str
4870+
Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4871+
4872+
Keyword Arguments
4873+
-----------------
4874+
4875+
headers : dict
4876+
Extra HTTP headers to send with the request.
4877+
4878+
Returns
4879+
-------
4880+
4881+
InvoiceCollection
4882+
Returns the captured invoice
4883+
"""
4884+
path = self._interpolate_path("/purchases/%s/capture", transaction_id)
4885+
return self._make_request("POST", path, None, **options)
4886+
4887+
def cancelPurchase(self, transaction_id, **options):
4888+
"""Cancel Purchase
4889+
4890+
Parameters
4891+
----------
4892+
4893+
transaction_id : str
4894+
Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
4895+
4896+
Keyword Arguments
4897+
-----------------
4898+
4899+
headers : dict
4900+
Extra HTTP headers to send with the request.
4901+
4902+
Returns
4903+
-------
4904+
4905+
InvoiceCollection
4906+
Returns the cancelled invoice
4907+
"""
4908+
path = self._interpolate_path("/purchases/%s/cancel/", transaction_id)
4909+
return self._make_request("POST", path, None, **options)
4910+
48374911
def get_export_dates(self, **options):
48384912
"""List the dates that have an available export to download.
48394913

recurly/resources.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,8 +1479,6 @@ class Invoice(Resource):
14791479
Optionally supplied string that may be either `net` or `eom` (end-of-month).
14801480
When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date.
14811481
When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.
1482-
1483-
This field is only available when the EOM Net Terms feature is enabled.
14841482
number : str
14851483
If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.
14861484
object : str
@@ -1987,8 +1985,6 @@ class Subscription(Resource):
19871985
Optionally supplied string that may be either `net` or `eom` (end-of-month).
19881986
When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date.
19891987
When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.
1990-
1991-
This field is only available when the EOM Net Terms feature is enabled.
19921988
object : str
19931989
Object type
19941990
paused_at : datetime

0 commit comments

Comments
 (0)