Skip to content

Commit

Permalink
Merge pull request #290 from recurly/v3-v2021-02-25-1674147238
Browse files Browse the repository at this point in the history
Generated Latest Changes for v2021-02-25 (Custom Fields on Line Items)
  • Loading branch information
douglaslise authored Jan 19, 2023
2 parents 8a3bf01 + c848911 commit 421b9b9
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 13 deletions.
9 changes: 9 additions & 0 deletions lib/recurly.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,10 @@ export declare class LineItem {
* If this date is provided, it indicates the end of a time range.
*/
endDate?: Date | null;
/**
* The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
*/
customFields?: CustomField[] | null;
/**
* When the line item was created.
*/
Expand Down Expand Up @@ -3808,6 +3812,10 @@ export interface LineItemCreate {
* Origin `external_gift_card` is allowed if the Gift Cards feature is enabled on your site and `type` is `credit`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements. Origin `prepayment` is only allowed if `type` is `charge` and `tax_exempt` is left blank or set to true. This origin creates a charge and opposite credit on the account to be used for future invoices.
*/
origin?: string | null;
/**
* The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
*/
customFields?: CustomField[] | null;
/**
* If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date. Defaults to the current date-time.
*/
Expand Down Expand Up @@ -5738,6 +5746,7 @@ export declare class Client {
* code: accountCode,
* firstName: 'Benjamin',
* lastName: 'Du Monde',
* preferredTimeZone: 'America/Chicago',
* address: {
* street1: '900 Camp St',
* city: 'New Orleans',
Expand Down
1 change: 1 addition & 0 deletions lib/recurly/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class Client extends BaseClient {
* code: accountCode,
* firstName: 'Benjamin',
* lastName: 'Du Monde',
* preferredTimeZone: 'America/Chicago',
* address: {
* street1: '900 Camp St',
* city: 'New Orleans',
Expand Down
2 changes: 2 additions & 0 deletions lib/recurly/resources/LineItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const Resource = require('../Resource')
* @prop {number} creditApplied - The amount of credit from this line item that was applied to the invoice.
* @prop {string} creditReasonCode - The reason the credit was given when line item is `type=credit`.
* @prop {string} currency - 3-letter ISO 4217 currency code.
* @prop {Array.<CustomField>} customFields - The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
* @prop {string} description - Description that appears on the invoice. For subscription related items this will be filled in automatically.
* @prop {number} discount - The discount applied to the line item.
* @prop {Date} endDate - If this date is provided, it indicates the end of a time range.
Expand Down Expand Up @@ -80,6 +81,7 @@ class LineItem extends Resource {
creditApplied: Number,
creditReasonCode: String,
currency: String,
customFields: ['CustomField'],
description: String,
discount: Number,
endDate: Date,
Expand Down
35 changes: 24 additions & 11 deletions openapi/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ paths:
code: accountCode,
firstName: 'Benjamin',
lastName: 'Du Monde',
preferredTimeZone: 'America/Chicago',
address: {
street1: '900 Camp St',
city: 'New Orleans',
Expand Down Expand Up @@ -750,6 +751,7 @@ paths:
"code": account_code,
"first_name": "Benjamin",
"last_name": "Du Monde",
"preferred_time_zone": "America/Chicago",
"acquisition": {
"campaign": "podcast-marketing",
"channel": "social_media",
Expand Down Expand Up @@ -785,6 +787,7 @@ paths:
Code = accountCode,
FirstName = "Benjamin",
LastName = "Du Monde",
PreferredTimeZone = "America/Chicago",
Address = new Address()
{
City = "New Orleans",
Expand Down Expand Up @@ -815,6 +818,7 @@ paths:
code: account_code,
first_name: "Benjamin",
last_name: "Du Monde",
preferred_time_zone: "America/Chicago",
acquisition: {
campaign: "podcast-marketing",
channel: "social_media",
Expand Down Expand Up @@ -853,6 +857,7 @@ paths:
accountReq.setCode(accountCode);
accountReq.setFirstName("Aaron");
accountReq.setLastName("Du Monde");
accountReq.setPreferredTimeZone("America/Chicago");

address.setStreet1("900 Camp St.");
address.setCity("New Orleans");
Expand All @@ -879,6 +884,7 @@ paths:
"code" => $account_code,
"first_name" => "Douglas",
"last_name" => "DuMonde",
"preferred_time_zone" => "America/Chicago",
"shipping_addresses" => [
[
"first_name" => "Douglas",
Expand Down Expand Up @@ -908,17 +914,17 @@ paths:
- lang: Go
source: "accountReq := &recurly.AccountCreate{\n\tCode: &accountCode,\n\tFirstName:
recurly.String(\"Isaac\"),\n\tLastName: recurly.String(\"Du Monde\"),\n\tEmail:
\ recurly.String(\"[email protected]\"),\n\tBillingInfo: &recurly.BillingInfoCreate{\n\t\tFirstName:
recurly.String(\"Isaac\"),\n\t\tLastName: recurly.String(\"Du Monde\"),\n\t\tAddress:
&recurly.AddressCreate{\n\t\t\tPhone: recurly.String(\"415-555-5555\"),\n\t\t\tStreet1:
\ recurly.String(\"400 Alabama St.\"),\n\t\t\tCity: recurly.String(\"San
Francisco\"),\n\t\t\tPostalCode: recurly.String(\"94110\"),\n\t\t\tCountry:
\ recurly.String(\"US\"),\n\t\t\tRegion: recurly.String(\"CA\"),\n\t\t},\n\t\tNumber:
recurly.String(\"4111111111111111\"),\n\t\tMonth: recurly.String(\"12\"),\n\t\tYear:
\ recurly.String(\"22\"),\n\t\tCvv: recurly.String(\"123\"),\n\t},\n}\n\naccount,
err := client.CreateAccount(accountReq)\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.String(\"[email protected]\"),\n\tPreferredTimeZone: recurly.String(\"America/Los_Angeles\"),\n\tBillingInfo:
&recurly.BillingInfoCreate{\n\t\tFirstName: recurly.String(\"Isaac\"),\n\t\tLastName:
\ recurly.String(\"Du Monde\"),\n\t\tAddress: &recurly.AddressCreate{\n\t\t\tPhone:
\ recurly.String(\"415-555-5555\"),\n\t\t\tStreet1: recurly.String(\"400
Alabama St.\"),\n\t\t\tCity: recurly.String(\"San Francisco\"),\n\t\t\tPostalCode:
recurly.String(\"94110\"),\n\t\t\tCountry: recurly.String(\"US\"),\n\t\t\tRegion:
\ recurly.String(\"CA\"),\n\t\t},\n\t\tNumber: recurly.String(\"4111111111111111\"),\n\t\tMonth:
\ recurly.String(\"12\"),\n\t\tYear: recurly.String(\"22\"),\n\t\tCvv:
\ recurly.String(\"123\"),\n\t},\n}\n\naccount, err := client.CreateAccount(accountReq)\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}\nfmt.Printf(\"Created Account:
%s\", account.Id)"
"/accounts/{account_id}":
Expand Down Expand Up @@ -14688,6 +14694,8 @@ paths:
The API request allows the inclusion of one of the following fields: **external_hpp_type** with `'adyen'` and **online_banking_payment_type** with `'ideal'` or `'sofort'` in the **billing_info** object.

For additional information regarding shipping fees, please see https://docs.recurly.com/docs/shipping

Note: an email address is required on the account for a Pending Purchase.
requestBody:
content:
application/json:
Expand Down Expand Up @@ -19133,6 +19141,8 @@ components:
format: date-time
title: End date
description: If this date is provided, it indicates the end of a time range.
custom_fields:
"$ref": "#/components/schemas/CustomFields"
created_at:
type: string
format: date-time
Expand Down Expand Up @@ -19299,6 +19309,8 @@ components:
true. This origin creates a charge and opposite credit on the account
to be used for future invoices.
"$ref": "#/components/schemas/LineItemCreateOriginEnum"
custom_fields:
"$ref": "#/components/schemas/CustomFields"
start_date:
type: string
format: date-time
Expand Down Expand Up @@ -22899,6 +22911,7 @@ components:
- item
- plan
- subscription
- charge
RefundTypeEnum:
type: string
enum:
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 421b9b9

Please sign in to comment.