Skip to content

Commit

Permalink
Generated Latest Changes for v2021-02-25
Browse files Browse the repository at this point in the history
  • Loading branch information
Recurly Integrations authored Apr 30, 2024
1 parent 7b694b1 commit b95a967
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 6 deletions.
45 changes: 45 additions & 0 deletions lib/recurly/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -3175,6 +3175,51 @@ public function createPendingPurchase(array $body, array $options = []): \Recurl
return $this->makeRequest('POST', $path, $body, $options);
}

/**
* Authorize a purchase
*
* @param array $body The body of the request.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\InvoiceCollection Returns the authorize invoice
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_authorize_purchase
*/
public function createAuthorizePurchase(array $body, array $options = []): \Recurly\Resources\InvoiceCollection
{
$path = $this->interpolatePath("/purchases/authorize", []);
return $this->makeRequest('POST', $path, $body, $options);
}

/**
* Capture a purchase
*
* @param string $transaction_id Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\InvoiceCollection Returns the captured invoice
* @link https://developers.recurly.com/api/v2021-02-25#operation/create_capture_purchase
*/
public function createCapturePurchase(string $transaction_id, array $options = []): \Recurly\Resources\InvoiceCollection
{
$path = $this->interpolatePath("/purchases/{transaction_id}/capture", ['transaction_id' => $transaction_id]);
return $this->makeRequest('POST', $path, [], $options);
}

/**
* Cancel Purchase
*
* @param string $transaction_id Transaction ID or UUID. For ID no prefix is used e.g. `e28zov4fw0v2`. For UUID use prefix `uuid-`, e.g. `uuid-123457890`.
* @param array $options Associative array of optional parameters
*
* @return \Recurly\Resources\InvoiceCollection Returns the cancelled invoice
* @link https://developers.recurly.com/api/v2021-02-25#operation/cancelPurchase
*/
public function cancelpurchase(string $transaction_id, array $options = []): \Recurly\Resources\InvoiceCollection
{
$path = $this->interpolatePath("/purchases/{transaction_id}/cancel/", ['transaction_id' => $transaction_id]);
return $this->makeRequest('POST', $path, [], $options);
}

/**
* List the dates that have an available export to download.
*
Expand Down
2 changes: 0 additions & 2 deletions lib/recurly/resources/invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,6 @@ public function setNetTerms(int $net_terms): void
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
*/
Expand Down
2 changes: 0 additions & 2 deletions lib/recurly/resources/subscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,6 @@ public function setNetTerms(int $net_terms): void
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
*/
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

0 comments on commit b95a967

Please sign in to comment.