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) #900

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
42 changes: 42 additions & 0 deletions lib/recurly/client/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4277,6 +4277,48 @@ def create_pending_purchase(body:, **options)
post(path, body, Requests::PurchaseCreate, **options)
end

# Authorize a purchase
#
# {https://developers.recurly.com/api/v2021-02-25#operation/create_authorize_purchase create_authorize_purchase api documentation}
#
# @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate}
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::InvoiceCollection] Returns the authorize invoice
#
def create_authorize_purchase(body:, **options)
path = "/purchases/authorize"
post(path, body, Requests::PurchaseCreate, **options)
end

# Capture a purchase
#
# {https://developers.recurly.com/api/v2021-02-25#operation/create_capture_purchase create_capture_purchase api documentation}
#
# @param transaction_id [String] Transaction ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::InvoiceCollection] Returns the captured invoice
#
def create_capture_purchase(transaction_id:, **options)
path = interpolate_path("/purchases/{transaction_id}/capture", transaction_id: transaction_id)
post(path, **options)
end

# Cancel Purchase
#
# {https://developers.recurly.com/api/v2021-02-25#operation/cancelPurchase cancelPurchase api documentation}
#
# @param transaction_id [String] Transaction ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+.
# @param params [Hash] Optional query string parameters:
#
# @return [Resources::InvoiceCollection] Returns the cancelled invoice
#
def cancelPurchase(transaction_id:, **options)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this should be in snake case, i.e. cancel_purchase vs cancelPurchase as is now.

path = interpolate_path("/purchases/{transaction_id}/cancel/", transaction_id: transaction_id)
post(path, **options)
end

# List the dates that have an available export to download.
#
# {https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates get_export_dates api documentation}
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/invoice_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class InvoiceCreate < Request
define_attribute :net_terms, Integer

# @!attribute net_terms_type
# @return [String] 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.
# @return [String] 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.
define_attribute :net_terms_type, String

# @!attribute po_number
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/purchase_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class PurchaseCreate < Request
define_attribute :net_terms, Integer

# @!attribute net_terms_type
# @return [String] 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.
# @return [String] 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.
define_attribute :net_terms_type, String

# @!attribute po_number
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/subscription_change_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SubscriptionChangeCreate < Request
define_attribute :net_terms, Integer

# @!attribute net_terms_type
# @return [String] 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.
# @return [String] 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.
define_attribute :net_terms_type, String

# @!attribute plan_code
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/subscription_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SubscriptionCreate < Request
define_attribute :net_terms, Integer

# @!attribute net_terms_type
# @return [String] 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.
# @return [String] 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.
define_attribute :net_terms_type, String

# @!attribute next_bill_date
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/requests/subscription_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SubscriptionUpdate < Request
define_attribute :net_terms, Integer

# @!attribute net_terms_type
# @return [String] 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.
# @return [String] 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.
define_attribute :net_terms_type, String

# @!attribute next_bill_date
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/resources/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Invoice < Resource
define_attribute :net_terms, Integer

# @!attribute net_terms_type
# @return [String] 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.
# @return [String] 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.
define_attribute :net_terms_type, String

# @!attribute number
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/resources/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Subscription < Resource
define_attribute :net_terms, Integer

# @!attribute net_terms_type
# @return [String] 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.
# @return [String] 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.
define_attribute :net_terms_type, String

# @!attribute object
Expand Down
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
Loading