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 #1297

Merged
merged 1 commit into from
Nov 17, 2021
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
9 changes: 9 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,15 @@ describe('PaymentIntent', function() {
const paymentIntents = await stripe.paymentIntents.list({limit: 3});
expect(paymentIntents).not.to.be.null;
});

it('create method', async function() {
const paymentIntent = await stripe.paymentIntents.create({
amount: 1099,
currency: 'eur',
automatic_payment_methods: {enabled: true},
});
expect(paymentIntent).not.to.be.null;
});
});

describe('SetupIntent', function() {
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ declare module 'stripe' {
currently_due: Array<string> | null;

/**
* If the account is disabled, this string describes why. Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`.
* If the account is disabled, this string describes why. Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.listed`, `rejected.terms_of_service`, `rejected.card_casher`, `rejected.auto_fraud_shutdown`, `rejected.fraud`, `rejected.dishonest_merchant`, `rejected.identity_fraud`, `rejected.platform_fraud`, `rejected.platform_terms_of_service`, `rejected.other`, `under_review`, or `other`.
*/
disabled_reason: string | null;

Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/Capabilities.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ declare module 'stripe' {
currently_due: Array<string>;

/**
* If the capability is disabled, this string describes why. Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`.
* If the capability is disabled, this string describes why. Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.listed`, `rejected.terms_of_service`, `rejected.card_casher`, `rejected.auto_fraud_shutdown`, `rejected.fraud`, `rejected.dishonest_merchant`, `rejected.identity_fraud`, `rejected.platform_fraud`, `rejected.platform_terms_of_service`, `rejected.other`, `under_review`, or `other`.
*
* `rejected.unsupported_business` means that the account's business is not supported by the capability. For example, payment methods may restrict the businesses they support in their terms of service:
*
Expand Down
12 changes: 6 additions & 6 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1133,12 +1133,12 @@ declare module 'stripe' {
adjustable_quantity?: LineItem.AdjustableQuantity;

/**
* The amount to be collected per unit of the line item. If specified, must also pass `currency` and `name`.
* [Deprecated] The amount to be collected per unit of the line item. If specified, must also pass `currency` and `name`.
*/
amount?: number;

/**
* 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). Required if `amount` is passed.
* [Deprecated] 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). Required if `amount` is passed.
*/
currency?: string;

Expand All @@ -1155,22 +1155,22 @@ declare module 'stripe' {
dynamic_tax_rates?: Array<string>;

/**
* A list of image URLs representing this line item. Each image can be up to 5 MB in size. If passing `price` or `price_data`, specify images on the associated product instead.
* [Deprecated] A list of image URLs representing this line item. Each image can be up to 5 MB in size. If passing `price` or `price_data`, specify images on the associated product instead.
*/
images?: Array<string>;

/**
* The name for the item to be displayed on the Checkout page. Required if `amount` is passed.
* [Deprecated] The name for the item to be displayed on the Checkout page. Required if `amount` is passed.
*/
name?: string;

/**
* The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price`, `price_data` or `amount` is required.
* The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required.
*/
price?: string;

/**
* Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price`, `price_data` or `amount` is required.
* Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
*/
price_data?: LineItem.PriceData;

Expand Down
26 changes: 25 additions & 1 deletion types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ declare module 'stripe' {
*/
application_fee_amount: number | null;

/**
* Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods)
*/
automatic_payment_methods: PaymentIntent.AutomaticPaymentMethods | null;

/**
* Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.
*/
Expand Down Expand Up @@ -204,6 +209,13 @@ declare module 'stripe' {
}

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

type CancellationReason =
| 'abandoned'
| 'automatic'
Expand Down Expand Up @@ -329,7 +341,7 @@ declare module 'stripe' {
redirect_to_url?: NextAction.RedirectToUrl;

/**
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, or `oxxo_display_details`.
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.
*/
type: string;

Expand Down Expand Up @@ -811,6 +823,11 @@ declare module 'stripe' {
*/
application_fee_amount?: number;

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

/**
* Controls when the funds will be captured from the customer's account.
*/
Expand Down Expand Up @@ -948,6 +965,13 @@ declare module 'stripe' {
}

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

type CaptureMethod = 'automatic' | 'manual';

type ConfirmationMethod = 'automatic' | 'manual';
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/SetupIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ declare module 'stripe' {
redirect_to_url?: NextAction.RedirectToUrl;

/**
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, or `oxxo_display_details`.
* Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.
*/
type: string;

Expand Down