Skip to content

Commit

Permalink
Merge db97538 into eb5ed75
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Mar 23, 2023
2 parents eb5ed75 + db97538 commit 0ca9670
Show file tree
Hide file tree
Showing 19 changed files with 540 additions and 12 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v264
v275
5 changes: 5 additions & 0 deletions src/resources/Terminal/Readers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export const Readers = StripeResource.extend({
fullPath: '/v1/terminal/readers/{reader}/cancel_action',
}),

collectInputs: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}/collect_inputs',
}),

processPaymentIntent: stripeMethod({
method: 'POST',
fullPath: '/v1/terminal/readers/{reader}/process_payment_intent',
Expand Down
18 changes: 18 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2189,6 +2189,14 @@ describe('Quotes', function() {
const quote = await stripe.quotes.finalizeQuote('qt_xxxxxxxxxxxxx');
expect(quote).not.to.be.null;
});

it('previewInvoiceLines method', async function() {
const invoiceLineItems = await stripe.quotes.previewInvoiceLines(
'qt_xyz',
'in_xyz'
);
expect(invoiceLineItems).not.to.be.null;
});
});

describe('Radar.EarlyFraudWarnings', function() {
Expand Down Expand Up @@ -3078,3 +3086,13 @@ describe('WebhookEndpoints', function() {
expect(webhookEndpoint).not.to.be.null;
});
});

describe('Tax.Transactions', function() {
it('createFromCalculation method', async function() {
const transaction = await stripe.tax.transactions.createFromCalculation({
calculation: 'xxx',
reference: 'yyy',
});
expect(transaction).not.to.be.null;
});
});
5 changes: 5 additions & 0 deletions types/Capital/FinancingSummary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ declare module 'stripe' {
*/
details: FinancingSummary.Details | null;

/**
* The Financing Offer ID this Financing Summary corresponds to
*/
financing_offer: string | null;

/**
* Status of the Connected Account's financing. [/v1/capital/financing_summary](https://stripe.com/docs/api/capital/financing_summary) will only return `details` for `paid_out` financing.
*/
Expand Down
5 changes: 5 additions & 0 deletions types/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ declare module 'stripe' {
*/
amount_total: number;

/**
* Exchange rate used to convert source currency amounts to customer currency amounts
*/
fx_rate: string;

/**
* Creation currency of the CheckoutSession before localization
*/
Expand Down
1 change: 1 addition & 0 deletions types/Checkout/SessionsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,7 @@ declare module 'stripe' {
| 'ideal'
| 'klarna'
| 'konbini'
| 'link'
| 'oxxo'
| 'p24'
| 'paynow'
Expand Down
1 change: 1 addition & 0 deletions types/PaymentLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ declare module 'stripe' {
| 'ideal'
| 'klarna'
| 'konbini'
| 'link'
| 'oxxo'
| 'p24'
| 'paynow'
Expand Down
2 changes: 2 additions & 0 deletions types/PaymentLinksResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ declare module 'stripe' {
| 'ideal'
| 'klarna'
| 'konbini'
| 'link'
| 'oxxo'
| 'p24'
| 'paynow'
Expand Down Expand Up @@ -1130,6 +1131,7 @@ declare module 'stripe' {
| 'ideal'
| 'klarna'
| 'konbini'
| 'link'
| 'oxxo'
| 'p24'
| 'paynow'
Expand Down
12 changes: 12 additions & 0 deletions types/SetupIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ declare module 'stripe' {
*/
attach_to_self?: boolean;

/**
* Settings for automatic payment methods compatible with this Setup Intent
*/
automatic_payment_methods: SetupIntent.AutomaticPaymentMethods | null;

/**
* Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
*/
Expand Down Expand Up @@ -154,6 +159,13 @@ declare module 'stripe' {
}

namespace SetupIntent {
interface AutomaticPaymentMethods {
/**
* Automatically calculates compatible payment methods
*/
enabled: boolean | null;
}

type CancellationReason =
| 'abandoned'
| 'duplicate'
Expand Down
12 changes: 12 additions & 0 deletions types/SetupIntentsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ declare module 'stripe' {
*/
attach_to_self?: boolean;

/**
* When enabled, this SetupIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this SetupIntent's other parameters.
*/
automatic_payment_methods?: SetupIntentCreateParams.AutomaticPaymentMethods;

/**
* Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If the payment method attached is a card, a return_url may be provided in case additional authentication is required.
*/
Expand Down Expand Up @@ -92,6 +97,13 @@ declare module 'stripe' {
}

namespace SetupIntentCreateParams {
interface AutomaticPaymentMethods {
/**
* Whether this feature is enabled.
*/
enabled: boolean;
}

type FlowDirection = 'inbound' | 'outbound';

interface MandateData {
Expand Down
178 changes: 178 additions & 0 deletions types/Tax/CalculationLineItems.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// File generated from our OpenAPI spec

declare module 'stripe' {
namespace Stripe {
namespace Tax {
/**
* The CalculationLineItem object.
*/
interface CalculationLineItem {
/**
* Unique identifier for the object.
*/
id: string;

/**
* String representing the object's type. Objects of the same type share the same value.
*/
object: 'tax.calculation_line_item';

/**
* The line item amount in integer cents. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
*/
amount: number;

/**
* The amount of tax calculated for this line item, in integer cents.
*/
amount_tax: number;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
livemode: boolean;

/**
* A Product ID.
*/
product: string | null;

/**
* The number of units of the item being purchased. For reversals, this is the quantity reversed.
*/
quantity: number;

/**
* A custom identifier for this line item.
*/
reference: string | null;

/**
* Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
*/
tax_behavior: CalculationLineItem.TaxBehavior;

/**
* Detailed account of taxes relevant to this line item.
*/
tax_breakdown: Array<CalculationLineItem.TaxBreakdown> | null;

/**
* The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource.
*/
tax_code: string;
}

namespace CalculationLineItem {
type TaxBehavior = 'exclusive' | 'inclusive';

interface TaxBreakdown {
/**
* The amount of tax, in integer cents.
*/
amount: number;

jurisdiction: TaxBreakdown.Jurisdiction;

/**
* Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address).
*/
sourcing: TaxBreakdown.Sourcing;

/**
* Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax.
*/
tax_rate_details: TaxBreakdown.TaxRateDetails | null;

/**
* The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
*/
taxability_reason: TaxBreakdown.TaxabilityReason;

/**
* The amount on which tax is calculated, in integer cents.
*/
taxable_amount: number;
}

namespace TaxBreakdown {
interface Jurisdiction {
/**
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
*/
country: string;

/**
* A human-readable name for the jurisdiction imposing the tax.
*/
display_name: string;

/**
* Indicates the level of the jurisdiction imposing the tax.
*/
level: Jurisdiction.Level;

/**
* [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
*/
state: string | null;
}

namespace Jurisdiction {
type Level = 'city' | 'country' | 'county' | 'district' | 'state';
}

type Sourcing = 'destination' | 'origin';

type TaxabilityReason =
| 'customer_exempt'
| 'not_collecting'
| 'not_subject_to_tax'
| 'not_supported'
| 'portion_product_exempt'
| 'portion_reduced_rated'
| 'portion_standard_rated'
| 'product_exempt'
| 'product_exempt_holiday'
| 'proportionally_rated'
| 'reduced_rated'
| 'reverse_charge'
| 'standard_rated'
| 'taxable_basis_reduced'
| 'zero_rated';

interface TaxRateDetails {
/**
* A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)".
*/
display_name: string;

/**
* The tax rate percentage as a string. For example, 8.5% is represented as "8.5".
*/
percentage_decimal: string;

/**
* The tax type, such as `vat` or `sales_tax`.
*/
tax_type: TaxRateDetails.TaxType;
}

namespace TaxRateDetails {
type TaxType =
| 'gst'
| 'hst'
| 'igst'
| 'jct'
| 'lease_tax'
| 'pst'
| 'qst'
| 'rst'
| 'sales_tax'
| 'vat';
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion types/Tax/Calculations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ declare module 'stripe' {
/**
* The list of items the customer is purchasing.
*/
line_items: ApiList<Stripe.LineItem> | null;
line_items: ApiList<Stripe.Tax.CalculationLineItem> | null;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Expand Down
9 changes: 2 additions & 7 deletions types/Tax/CalculationsResource.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* The boolean value that indicates if the calculation is a preview. If true, the calculation is not stored. If false, the calculation is stored for 48 hours. Defaults to true.
*/
preview?: boolean;

/**
* Shipping cost details to be used for the calculation
*/
Expand Down Expand Up @@ -267,11 +262,11 @@ declare module 'stripe' {
id: string,
params?: CalculationListLineItemsParams,
options?: RequestOptions
): ApiListPromise<Stripe.LineItem>;
): ApiListPromise<Stripe.Tax.CalculationLineItem>;
listLineItems(
id: string,
options?: RequestOptions
): ApiListPromise<Stripe.LineItem>;
): ApiListPromise<Stripe.Tax.CalculationLineItem>;
}
}
}
Expand Down
Loading

0 comments on commit 0ca9670

Please sign in to comment.