Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Latest Changes for v2021-02-25 (Auth & Capture) #691

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 126 additions & 2 deletions openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15470,6 +15470,132 @@ paths:
validation: %v\", e)\n\t\treturn nil, err\n\t}\n\n\tfmt.Printf(\"Unexpected
Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Created ChargeInvoice
with UUID: %s.\\n\", collection.ChargeInvoice.Uuid)\n"
"/purchases/authorize":
post:
tags:
- purchase
operationId: create_authorize_purchase
summary: Authorize a purchase
description: |-
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.

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.

For additional information regarding shipping fees, please see https://docs.recurly.com/docs/shipping
requestBody:
content:
application/json:
schema:
"$ref": "#/components/schemas/PurchaseCreate"
required: true
responses:
'200':
description: Returns the authorize invoice
content:
application/json:
schema:
"$ref": "#/components/schemas/InvoiceCollection"
'400':
description: Bad request; perhaps missing or invalid parameters.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
'422':
description: authorize purchase cannot be completed for the specified reason.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
default:
description: Unexpected error.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
x-code-samples: []
"/purchases/{transaction_id}/capture":
post:
tags:
- purchase
parameters:
- "$ref": "#/components/parameters/transaction_id"
operationId: create_capture_purchase
summary: Capture a purchase
description: |-
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.


Capture an open Authorization request
responses:
'200':
description: Returns the captured invoice
content:
application/json:
schema:
"$ref": "#/components/schemas/InvoiceCollection"
'400':
description: Bad request; perhaps missing or invalid parameters.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
'422':
description: Capture purchase cannot be completed for the specified reason.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
default:
description: Unexpected error.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
x-code-samples: []
"/purchases/{transaction_id}/cancel/":
parameters:
- "$ref": "#/components/parameters/transaction_id"
post:
summary: Cancel Purchase
description: |
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.

Cancel an open Authorization request
tags:
- purchase
operationId: cancelPurchase
responses:
'200':
description: Returns the cancelled invoice
content:
application/json:
schema:
"$ref": "#/components/schemas/InvoiceCollection"
'400':
description: Bad request; perhaps missing or invalid parameters.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
'422':
description: Cancel purchase cannot be completed for the specified reason.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
default:
description: Unexpected error.
content:
application/json:
schema:
"$ref": "#/components/schemas/Error"
x-code-samples: []
"/export_dates":
get:
tags:
Expand Down Expand Up @@ -25178,8 +25304,6 @@ components:
Optionally supplied string that may be either `net` or `eom` (end-of-month).
When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date.
When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.

This field is only available when the EOM Net Terms feature is enabled.
enum:
- net
- eom
Expand Down
74 changes: 74 additions & 0 deletions recurly/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4834,6 +4834,80 @@ def create_pending_purchase(self, body, **options):
)
return self._make_request("POST", path, body, **options)

def create_authorize_purchase(self, body, **options):
"""Authorize a purchase

Parameters
----------

body : dict
The request body. It should follow the schema of PurchaseCreate.

Keyword Arguments
-----------------

headers : dict
Extra HTTP headers to send with the request.

Returns
-------

InvoiceCollection
Returns the authorize invoice
"""
path = self._interpolate_path(
"/purchases/authorize",
)
return self._make_request("POST", path, body, **options)

def create_capture_purchase(self, transaction_id, **options):
"""Capture a purchase

Parameters
----------

transaction_id : str
Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.

Keyword Arguments
-----------------

headers : dict
Extra HTTP headers to send with the request.

Returns
-------

InvoiceCollection
Returns the captured invoice
"""
path = self._interpolate_path("/purchases/%s/capture", transaction_id)
return self._make_request("POST", path, None, **options)

def cancelPurchase(self, transaction_id, **options):
"""Cancel Purchase

Parameters
----------

transaction_id : str
Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.

Keyword Arguments
-----------------

headers : dict
Extra HTTP headers to send with the request.

Returns
-------

InvoiceCollection
Returns the cancelled invoice
"""
path = self._interpolate_path("/purchases/%s/cancel/", transaction_id)
return self._make_request("POST", path, None, **options)

def get_export_dates(self, **options):
"""List the dates that have an available export to download.

Expand Down
4 changes: 0 additions & 4 deletions recurly/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1479,8 +1479,6 @@ class Invoice(Resource):
Optionally supplied string that may be either `net` or `eom` (end-of-month).
When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date.
When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.

This field is only available when the EOM Net Terms feature is enabled.
number : str
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.
object : str
Expand Down Expand Up @@ -1987,8 +1985,6 @@ class Subscription(Resource):
Optionally supplied string that may be either `net` or `eom` (end-of-month).
When `net`, an invoice becomes past due the specified number of `Net Terms` days from the current date.
When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.

This field is only available when the EOM Net Terms feature is enabled.
object : str
Object type
paused_at : datetime
Expand Down
Loading