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

API Updates for beta branch #1469

Merged
merged 46 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1d4344a
API Updates (#1413)
dcr-stripe May 5, 2022
59e8199
Bump version to 8.221.0
dcr-stripe May 5, 2022
ffe44f5
API Updates (#1414)
dcr-stripe May 5, 2022
0bf569b
Bump version to 8.222.0
dcr-stripe May 5, 2022
7cdf066
API Updates (#1415)
richardm-stripe May 9, 2022
47776ef
feat(http-client): retry closed connection errors (#1336)
bpinto May 9, 2022
50aab85
Remove deprecated orders-related events (#1417)
richardm-stripe May 10, 2022
1512d00
Bump version to 9.0.0
richardm-stripe May 10, 2022
16bf01d
API Updates (#1420)
richardm-stripe May 11, 2022
2876814
Bump version to 9.1.0
richardm-stripe May 11, 2022
4819fc5
API Updates (#1422)
kamil-stripe May 19, 2022
76576f9
Bump version to 9.2.0
richardm-stripe May 20, 2022
53e9d65
Codegen for openapi v146 (#1430)
pakrym-stripe May 23, 2022
d8ef8ec
Bump version to 9.3.0
pakrym-stripe May 23, 2022
ae76904
Codegen for openapi v147 (#1431)
pakrym-stripe May 23, 2022
798f44b
Bump version to 9.4.0
pakrym-stripe May 23, 2022
ff15721
docs: Update HttpClient documentation to remove experimental status. …
dcr-stripe May 25, 2022
cc0867c
Codegen for openapi v149 (#1434)
pakrym-stripe May 26, 2022
702c1f1
Bump version to 9.5.0
pakrym-stripe May 26, 2022
1490297
API Updates (#1439)
dcr-stripe Jun 1, 2022
66993bb
Bump version to 9.6.0
dcr-stripe Jun 1, 2022
d0f14ef
Update README.md (#1440)
pakrym-stripe Jun 6, 2022
553986d
Codegen for openapi v152 (#1441)
pakrym-stripe Jun 8, 2022
e0fe7f8
Add test for cash balance methods. (#1438)
dcr-stripe Jun 8, 2022
e393e1e
Bump version to 9.7.0
pakrym-stripe Jun 8, 2022
5416318
Codegen for openapi v154 (#1446)
pakrym-stripe Jun 9, 2022
5135ab0
Add types for extra request options (#1448)
remi-stripe Jun 9, 2022
1eea97d
Bump version to 9.8.0
pakrym-stripe Jun 9, 2022
855e38e
Only publish stable version to the latest tag (#1450)
pakrym-stripe Jun 13, 2022
17fba45
Fix non-conforming changelog entries and port the Makefile fix (#1452)
pakrym-stripe Jun 14, 2022
6137808
Codegen for openapi v157 (#1453)
kamil-stripe Jun 17, 2022
d4679fb
Bump version to 9.9.0
kamil-stripe Jun 17, 2022
2307df7
fix: Stop using path.join to create URLs. (#1455)
dcr-stripe Jun 21, 2022
34b7ad5
API Updates (#1458)
yejia-stripe Jun 23, 2022
87ebb14
API Updates (#1459)
dcr-stripe Jun 23, 2022
061f407
Bump version to 9.10.0
pakrym-stripe Jun 23, 2022
15df8ba
Add feature/** and sdk-release/** to PR CI triggers (#1461)
kamil-stripe Jun 28, 2022
a028d65
API Updates (#1462)
dcr-stripe Jun 29, 2022
d608e23
Bump version to 9.11.0
dcr-stripe Jun 29, 2022
d7ccbbb
Codegen for openapi v162 (#1467)
pakrym-stripe Jul 6, 2022
58b0563
Codegen for openapi v163 (#1468)
pakrym-stripe Jul 7, 2022
c9a03cd
Bump version to 9.12.0
pakrym-stripe Jul 7, 2022
fc1fc8d
Set version to 9.12.0 to simplify merge
pakrym-stripe Jul 7, 2022
3e338fc
Include latest changes from the master branch
pakrym-stripe Jul 7, 2022
b719ddb
Reset version to 9.8.0-beta.1
pakrym-stripe Jul 7, 2022
f894866
Codegen for openapi v163
pakrym-stripe Jul 7, 2022
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 9.12.0 - 2022-07-07
* [#1468](https://github.com/stripe/stripe-node/pull/1468) API Updates
* Add support for `currency` on `CheckoutSessionCreateParams`, `InvoiceUpcomingLinesParams`, `InvoiceUpcomingParams`, `PaymentLinkCreateParams`, `SubscriptionCreateParams`, `SubscriptionSchedule.phases[]`, `SubscriptionScheduleCreateParams.phases[]`, `SubscriptionScheduleUpdateParams.phases[]`, and `Subscription`
* Add support for `currency_options` on `CheckoutSessionCreateParams.shipping_options[].shipping_rate_data.fixed_amount`, `CouponCreateParams`, `CouponUpdateParams`, `Coupon`, `OrderCreateParams.shipping_cost.shipping_rate_data.fixed_amount`, `OrderUpdateParams.shipping_cost.shipping_rate_data.fixed_amount`, `PriceCreateParams`, `PriceUpdateParams`, `Price`, `ProductCreateParams.default_price_data`, `PromotionCode.restrictions`, `PromotionCodeCreateParams.restrictions`, `ShippingRate.fixed_amount`, and `ShippingRateCreateParams.fixed_amount`
* Add support for `restrictions` on `PromotionCodeUpdateParams`
* Add support for `fixed_amount` and `tax_behavior` on `ShippingRateUpdateParams`
* [#1467](https://github.com/stripe/stripe-node/pull/1467) API Updates
* Add support for `customer` on `CheckoutSessionListParams` and `RefundCreateParams`
* Add support for `currency` and `origin` on `RefundCreateParams`
* Add support for new values `financial_connections.account.created`, `financial_connections.account.deactivated`, `financial_connections.account.disconnected`, `financial_connections.account.reactivated`, and `financial_connections.account.refreshed_balance` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]`

## 9.11.0 - 2022-06-29
* [#1462](https://github.com/stripe/stripe-node/pull/1462) API Updates
* Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card`
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v161
v163
2 changes: 1 addition & 1 deletion lib/apiVersion.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// File generated from our OpenAPI spec

module.exports = {ApiVersion: '2020-08-27'};
module.exports = {ApiVersion: '2020-08-27; server_side_confirmation_beta=v1'};
86 changes: 50 additions & 36 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,56 @@ describe('PaymentLink', function() {
});
});

describe('Price', function() {
it('create method', async function() {
const price = await stripe.prices.create({
unit_amount: 2000,
currency: 'usd',
currency_options: {
uah: {unit_amount: 5000},
eur: {unit_amount: 1800},
},
recurring: {interval: 'month'},
product: 'prod_xxxxxxxxxxxxx',
});
expect(price).not.to.be.null;
});

it('list method', async function() {
const prices = await stripe.prices.list({limit: 3});
expect(prices).not.to.be.null;
});

it('create method', async function() {
const price = await stripe.prices.create({
unit_amount: 2000,
currency: 'usd',
recurring: {interval: 'month'},
product: 'prod_xxxxxxxxxxxxx',
});
expect(price).not.to.be.null;
});

it('retrieve method', async function() {
const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx');
expect(price).not.to.be.null;
});

it('update method', async function() {
const price = await stripe.prices.update('price_xxxxxxxxxxxxx', {
metadata: {order_id: '6735'},
});
expect(price).not.to.be.null;
});

it('search method', async function() {
const prices = await stripe.prices.search({
query: "active:'true' AND metadata['order_id']:'6735'",
});
expect(prices).not.to.be.null;
});
});

describe('SetupAttempt', function() {
it('list method', async function() {
const setupAttempts = await stripe.setupAttempts.list({
Expand Down Expand Up @@ -2005,42 +2055,6 @@ describe('Plan', function() {
});
});

describe('Price', function() {
it('list method', async function() {
const prices = await stripe.prices.list({limit: 3});
expect(prices).not.to.be.null;
});

it('create method', async function() {
const price = await stripe.prices.create({
unit_amount: 2000,
currency: 'usd',
recurring: {interval: 'month'},
product: 'prod_xxxxxxxxxxxxx',
});
expect(price).not.to.be.null;
});

it('retrieve method', async function() {
const price = await stripe.prices.retrieve('price_xxxxxxxxxxxxx');
expect(price).not.to.be.null;
});

it('update method', async function() {
const price = await stripe.prices.update('price_xxxxxxxxxxxxx', {
metadata: {order_id: '6735'},
});
expect(price).not.to.be.null;
});

it('search method', async function() {
const prices = await stripe.prices.search({
query: "active:'true' AND metadata['order_id']:'6735'",
});
expect(prices).not.to.be.null;
});
});

describe('Product', function() {
it('list method', async function() {
const products = await stripe.products.list({limit: 3});
Expand Down
14 changes: 5 additions & 9 deletions types/2020-08-27/CashBalances.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare module 'stripe' {
object: 'cash_balance';

/**
* A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0.
* A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
*/
available: {
[key: string]: number;
Expand Down Expand Up @@ -57,20 +57,16 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* A hash of settings for this cash balance.
*/
settings?: CashBalanceUpdateParams.Settings;
}

namespace CashBalanceUpdateParams {
interface Settings {
/**
* Method for using the customer balance to pay outstanding
* `customer_balance` PaymentIntents. If set to `automatic`, all available
* funds will automatically be used to pay any outstanding PaymentIntent.
* If set to `manual`, only customer balance funds from bank transfers
* with a reference code matching
* `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will
* automatically be used to pay the corresponding outstanding
* PaymentIntent.
* Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).
*/
reconciliation_mode?: Settings.ReconciliationMode;
}
Expand Down
47 changes: 41 additions & 6 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,33 +303,33 @@ declare module 'stripe' {

interface CustomerDetails {
/**
* The customer's address at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022.
* The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022.
*/
address: Stripe.Address | null;

/**
* The email associated with the Customer, if one exists, on the Checkout Session at the time of checkout or at time of session expiry.
* The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry.
* Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form.
*/
email: string | null;

/**
* The customer's name at the time of checkout. Note: This property is populated only for sessions on or after March 30, 2022.
* The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022.
*/
name: string | null;

/**
* The customer's phone number at the time of checkout
* The customer's phone number after a completed Checkout Session.
*/
phone: string | null;

/**
* The customer's tax exempt status at time of checkout.
* The customer's tax exempt status after a completed Checkout Session.
*/
tax_exempt: CustomerDetails.TaxExempt | null;

/**
* The customer's tax IDs at time of checkout.
* The customer's tax IDs after a completed Checkout Session.
*/
tax_ids: Array<CustomerDetails.TaxId> | null;
}
Expand Down Expand Up @@ -1283,6 +1283,11 @@ declare module 'stripe' {
*/
consent_collection?: SessionCreateParams.ConsentCollection;

/**
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency?: string;

/**
* ID of an existing Customer, if one exists. In `payment` mode, the customer's most recent card
* payment method will be used to prefill the email, name, card details, and billing address
Expand Down Expand Up @@ -2792,6 +2797,31 @@ declare module 'stripe' {
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
*/
currency: string;

/**
* Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
*/
currency_options?: {
[key: string]: FixedAmount.CurrencyOptions;
};
}

namespace FixedAmount {
interface CurrencyOptions {
/**
* A non-negative integer in cents representing how much to charge.
*/
amount: number;

/**
* Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
*/
tax_behavior?: CurrencyOptions.TaxBehavior;
}

namespace CurrencyOptions {
type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
}
}

type TaxBehavior = 'exclusive' | 'inclusive' | 'unspecified';
Expand Down Expand Up @@ -2907,6 +2937,11 @@ declare module 'stripe' {
}

interface SessionListParams extends PaginationParams {
/**
* Only return the Checkout Sessions for the Customer specified.
*/
customer?: string;

/**
* Specifies which fields in the response should be expanded.
*/
Expand Down
44 changes: 44 additions & 0 deletions types/2020-08-27/Coupons.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ declare module 'stripe' {
*/
currency: string | null;

/**
* Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
*/
currency_options?: {
[key: string]: Coupon.CurrencyOptions;
};

deleted?: void;

/**
Expand Down Expand Up @@ -94,6 +101,13 @@ declare module 'stripe' {
products: Array<string>;
}

interface CurrencyOptions {
/**
* Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer.
*/
amount_off: number;
}

type Duration = 'forever' | 'once' | 'repeating';
}

Expand Down Expand Up @@ -133,6 +147,13 @@ declare module 'stripe' {
*/
currency?: string;

/**
* Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
*/
currency_options?: {
[key: string]: CouponCreateParams.CurrencyOptions;
};

/**
* Specifies how long the discount will be in effect if used on a subscription. Can be `forever`, `once`, or `repeating`. Defaults to `once`.
*/
Expand Down Expand Up @@ -187,6 +208,13 @@ declare module 'stripe' {
products?: Array<string>;
}

interface CurrencyOptions {
/**
* A positive integer representing the amount to subtract from an invoice total.
*/
amount_off: number;
}

type Duration = 'forever' | 'once' | 'repeating';
}

Expand All @@ -198,6 +226,13 @@ declare module 'stripe' {
}

interface CouponUpdateParams {
/**
* Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
*/
currency_options?: {
[key: string]: CouponUpdateParams.CurrencyOptions;
};

/**
* Specifies which fields in the response should be expanded.
*/
Expand All @@ -214,6 +249,15 @@ declare module 'stripe' {
name?: string;
}

namespace CouponUpdateParams {
interface CurrencyOptions {
/**
* A positive integer representing the amount to subtract from an invoice total.
*/
amount_off: number;
}
}

interface CouponListParams extends PaginationParams {
/**
* A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
Expand Down
20 changes: 3 additions & 17 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,7 @@ declare module 'stripe' {
namespace CashBalance {
interface Settings {
/**
* Method for using the customer balance to pay outstanding
* `customer_balance` PaymentIntents. If set to `automatic`, all available
* funds will automatically be used to pay any outstanding PaymentIntent.
* If set to `manual`, only customer balance funds from bank transfers
* with a reference code matching
* `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will
* automatically be used to pay the corresponding outstanding
* PaymentIntent.
* Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).
*/
reconciliation_mode?: Settings.ReconciliationMode;
}
Expand Down Expand Up @@ -683,14 +676,7 @@ declare module 'stripe' {
namespace CashBalance {
interface Settings {
/**
* Method for using the customer balance to pay outstanding
* `customer_balance` PaymentIntents. If set to `automatic`, all available
* funds will automatically be used to pay any outstanding PaymentIntent.
* If set to `manual`, only customer balance funds from bank transfers
* with a reference code matching
* `payment_intent.next_action.display_bank_transfer_intructions.reference_code` will
* automatically be used to pay the corresponding outstanding
* PaymentIntent.
* Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).
*/
reconciliation_mode?: Settings.ReconciliationMode;
}
Expand Down Expand Up @@ -1068,7 +1054,7 @@ declare module 'stripe' {
): Promise<Stripe.Response<Stripe.CashBalance>>;

/**
* Updates a customer's cash balance.
* Changes the settings on a customer's cash balance.
*/
updateCashBalance(
id: string,
Expand Down
5 changes: 5 additions & 0 deletions types/2020-08-27/InvoiceLineItems.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ declare module 'stripe' {
*/
coupon?: string;

/**
* The currency to preview this invoice in. Defaults to that of `customer` if not specified.
*/
currency?: string;

/**
* The identifier of the customer whose upcoming invoice you'd like to retrieve.
*/
Expand Down
Loading