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 v2019-10-10 (Account Preferred Time Zone) #735

Merged
merged 1 commit into from
Jan 10, 2023
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
24 changes: 24 additions & 0 deletions lib/recurly/resources/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Account extends RecurlyResource
private $_object;
private $_parent_account_id;
private $_preferred_locale;
private $_preferred_time_zone;
private $_shipping_addresses;
private $_state;
private $_tax_exempt;
Expand Down Expand Up @@ -625,6 +626,29 @@ public function setPreferredLocale(string $preferred_locale): void
$this->_preferred_locale = $preferred_locale;
}

/**
* Getter method for the preferred_time_zone attribute.
* The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names) used to determine the time zone of emails sent on behalf of the merchant to the customer.
*
* @return ?string
*/
public function getPreferredTimeZone(): ?string
{
return $this->_preferred_time_zone;
}

/**
* Setter method for the preferred_time_zone attribute.
*
* @param string $preferred_time_zone
*
* @return void
*/
public function setPreferredTimeZone(string $preferred_time_zone): void
{
$this->_preferred_time_zone = $preferred_time_zone;
}

/**
* Getter method for the shipping_addresses attribute.
* The shipping addresses on the account.
Expand Down
2 changes: 1 addition & 1 deletion lib/recurly/resources/invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ public function setPoNumber(string $po_number): void

/**
* Getter method for the previous_invoice_id attribute.
* On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from.
* On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from. This field is only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed) feature enabled. Sites with Only Bill What Changed enabled should use the [related_invoices endpoint](https://recurly.com/developers/api/v2019-10-10/index.html#operation/list_related_invoices) to see purchase invoices refunded by this invoice.
*
* @return ?string
*/
Expand Down
112 changes: 109 additions & 3 deletions openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7881,6 +7881,8 @@ paths:
summary: Apply available credit to a pending or past due charge invoice
description: Apply credit payment to the outstanding balance on an existing
charge invoice from an account’s available balance from existing credit invoices.
Credit that was refunded from the invoice cannot be applied back to the invoice
as payment.
parameters:
- "$ref": "#/components/parameters/site_id"
- "$ref": "#/components/parameters/invoice_id"
Expand All @@ -7899,7 +7901,8 @@ paths:
"$ref": "#/components/schemas/Error"
'422':
description: Tried applying credit to a legacy or closed invoice or there
was an error processing the credit payment.
was an error processing the credit payment, such as no available credit
on the account.
content:
application/json:
schema:
Expand All @@ -7910,7 +7913,95 @@ paths:
application/json:
schema:
"$ref": "#/components/schemas/Error"
x-code-samples: []
x-code-samples:
- lang: Node.js
source: |
try {
const invoice = await client.applyCreditBalance(invoiceId)
console.log('Applied credit balance to invoice: ', invoice)
} catch (err) {
if (err instanceof recurly.errors.ValidationError) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
console.log('Failed validation', err.params)
} else {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
console.log('Unknown Error: ', err)
}
}
- lang: Python
source: |
try:
invoice = client.apply_credit_balance(invoice_id)
print("Applied credit balance to invoice %s" % invoice.id)
except recurly.errors.NotFoundError:
# If the resource was not found, you may want to alert the user or
# just return nil
print("Resource Not Found")
- lang: ".NET"
source: |
try
{
Invoice invoice = client.ApplyCreditBalance(invoiceId);
Console.WriteLine($"Applied credit balance to invoice #{invoice.Number}");
}
catch (Recurly.Errors.Validation ex)
{
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in ex.Error.Params
Console.WriteLine($"Failed validation: {ex.Error.Message}");
}
catch (Recurly.Errors.ApiError ex)
{
// Use ApiError to catch a generic error from the API
Console.WriteLine($"Unexpected Recurly Error: {ex.Error.Message}");
}
- lang: Ruby
source: |
begin
invoice = @client.apply_credit_balance(invoice_id: invoice_id)
puts "Applied credit balance to invoice #{invoice}"
rescue Recurly::Errors::NotFoundError
# If the resource was not found, you may want to alert the user or
# just return nil
puts "Resource Not Found"
end
- lang: Java
source: |
try {
final Invoice invoice = client.applyCreditBalance(invoiceId);
System.out.println("Applied credit balance to invoice " + invoice.getId());
} catch (final ValidationException e) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in e.getError().getParams()
System.out.println("Failed validation: " + e.getError().getMessage());
} catch (final ApiException e) {
// Use ApiException to catch a generic error from the API
System.out.println("Unexpected Recurly Error: " + e.getError().getMessage());
}
- lang: PHP
source: |
try {
$invoice = $client->applyCreditBalance($invoice_id);

echo 'Applied credit balance to invoice:' . PHP_EOL;
var_dump($invoice);
} catch (\Recurly\Errors\Validation $e) {
// If the request was not valid, you may want to tell your user
// why. You can find the invalid params and reasons in err.params
var_dump($e);
} catch (\Recurly\RecurlyError $e) {
// If we don't know what to do with the err, we should
// probably re-raise and let our web framework and logger handle it
var_dump($e);
}
- lang: Go
source: "invoice, err := client.ApplyCreditBalance(invoiceID)\nif e, ok :=
err.(*recurly.Error); ok {\n\tif e.Type == recurly.ErrorTypeValidation {\n\t\tfmt.Printf(\"Failed
validation: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected
Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Applied credit
balance to invoice: %v\", invoice)"
"/sites/{site_id}/invoices/{invoice_id}/collect":
put:
tags:
Expand Down Expand Up @@ -15480,6 +15571,11 @@ components:
- sv-SE
- tr-TR
- zh-CN
preferred_time_zone:
type: string
example: America/Los_Angeles
description: Used to determine the time zone of emails sent on behalf of
the merchant to the customer. Must be a [supported IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
cc_emails:
type: string
description: Additional email address that should receive account correspondence.
Expand Down Expand Up @@ -15612,6 +15708,12 @@ components:
- sv-SE
- tr-TR
- zh-CN
preferred_time_zone:
type: string
example: America/Los_Angeles
description: The [IANA time zone name](https://docs.recurly.com/docs/email-time-zones-and-time-stamps#supported-api-iana-time-zone-names)
used to determine the time zone of emails sent on behalf of the merchant
to the customer.
cc_emails:
type: string
description: Additional email address that should receive account correspondence.
Expand Down Expand Up @@ -17764,7 +17866,11 @@ components:
type: string
title: Previous invoice ID
description: On refund invoices, this value will exist and show the invoice
ID of the purchase invoice the refund was created from.
ID of the purchase invoice the refund was created from. This field is
only populated for sites without the [Only Bill What Changed](https://docs.recurly.com/docs/only-bill-what-changed)
feature enabled. Sites with Only Bill What Changed enabled should use
the [related_invoices endpoint](https://recurly.com/developers/api/v2019-10-10/index.html#operation/list_related_invoices)
to see purchase invoices refunded by this invoice.
maxLength: 13
number:
type: string
Expand Down