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

Merged
merged 1 commit into from
Apr 13, 2022
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
5 changes: 5 additions & 0 deletions lib/resources/PaymentIntents.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ module.exports = StripeResource.extend({
path: '/{intent}/confirm',
}),

incrementAuthorization: stripeMethod({
method: 'POST',
path: '/{intent}/increment_authorization',
}),

search: stripeMethod({
method: 'GET',
path: '/search',
Expand Down
5 changes: 5 additions & 0 deletions types/2020-08-27/Charges.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,11 @@ declare module 'stripe' {
*/
iin?: string | null;

/**
* Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support] /docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support.
*/
incremental_authorization_supported: boolean | null;

/**
* The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)
*/
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/Invoices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ declare module 'stripe' {

/**
* PaymentMethod objects represent your customer's payment instruments.
* They can be used with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or saved to
* You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
* Customer objects to store instrument details for future payments.
*
* Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
Expand Down
100 changes: 97 additions & 3 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ declare module 'stripe' {
/**
* The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
* The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
*
* Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?integration=elements) and learn about how `client_secret` should be handled.
* Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled.
*/
client_secret: string | null;

Expand Down Expand Up @@ -282,7 +282,7 @@ declare module 'stripe' {

/**
* PaymentMethod objects represent your customer's payment instruments.
* They can be used with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or saved to
* You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
* Customer objects to store instrument details for future payments.
*
* Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
Expand Down Expand Up @@ -1032,6 +1032,11 @@ declare module 'stripe' {
* Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity)
*/
request_extended_authorization: boolean | null;

/**
* Request ability to [increment](docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
*/
request_incremental_authorization_support: boolean | null;
}

interface Eps {
Expand Down Expand Up @@ -2513,6 +2518,11 @@ declare module 'stripe' {
* Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity)
*/
request_extended_authorization?: boolean;

/**
* Request ability to [increment](docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
*/
request_incremental_authorization_support?: boolean;
}

interface Eps {
Expand Down Expand Up @@ -3943,6 +3953,11 @@ declare module 'stripe' {
* Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity)
*/
request_extended_authorization?: boolean;

/**
* Request ability to [increment](docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
*/
request_incremental_authorization_support?: boolean;
}

interface Eps {
Expand Down Expand Up @@ -5510,6 +5525,11 @@ declare module 'stripe' {
* Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity)
*/
request_extended_authorization?: boolean;

/**
* Request ability to [increment](docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.
*/
request_incremental_authorization_support?: boolean;
}

interface Eps {
Expand Down Expand Up @@ -5867,6 +5887,48 @@ declare module 'stripe' {
}
}

interface PaymentIntentIncrementAuthorizationParams {
/**
* The updated total amount you intend to collect from the cardholder. This amount must be greater than the currently authorized amount.
*/
amount: number;

/**
* The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
application_fee_amount?: number;

/**
* An arbitrary string attached to the object. Often useful for displaying to users.
*/
description?: string;

/**
* Specifies which fields in the response should be expanded.
*/
expand?: Array<string>;

/**
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
*/
metadata?: Stripe.MetadataParam;

/**
* The parameters used to automatically create a Transfer when the payment is captured.
* For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).
*/
transfer_data?: PaymentIntentIncrementAuthorizationParams.TransferData;
}

namespace PaymentIntentIncrementAuthorizationParams {
interface TransferData {
/**
* The amount that will be transferred automatically when a charge succeeds.
*/
amount?: number;
}
}

interface PaymentIntentSearchParams {
/**
* The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents).
Expand Down Expand Up @@ -6051,6 +6113,38 @@ declare module 'stripe' {
options?: RequestOptions
): Promise<Stripe.Response<Stripe.PaymentIntent>>;

/**
* Perform an incremental authorization on an eligible
* [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
* PaymentIntent's status must be requires_capture and
* [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
* must be true.
*
* Incremental authorizations attempt to increase the authorized amount on
* your customer's card to the new, higher amount provided. As with the
* initial authorization, incremental authorizations may be declined. A
* single PaymentIntent can call this endpoint multiple times to further
* increase the authorized amount.
*
* If the incremental authorization succeeds, the PaymentIntent object is
* returned with the updated
* [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
* If the incremental authorization fails, a
* [card_declined](https://stripe.com/docs/error-codes#card-declined) error is returned, and no
* fields on the PaymentIntent or Charge are updated. The PaymentIntent
* object remains capturable for the previously authorized amount.
*
* Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
* Once captured, a PaymentIntent can no longer be incremented.
*
* Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
*/
incrementAuthorization(
id: string,
params: PaymentIntentIncrementAuthorizationParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.PaymentIntent>>;

/**
* Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
* Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/SetupAttempts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ declare module 'stripe' {

/**
* PaymentMethod objects represent your customer's payment instruments.
* They can be used with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or saved to
* You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
* Customer objects to store instrument details for future payments.
*
* Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/SetupIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ declare module 'stripe' {
/**
* The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.
*
* The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
* The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
*/
client_secret: string | null;

Expand Down Expand Up @@ -172,7 +172,7 @@ declare module 'stripe' {

/**
* PaymentMethod objects represent your customer's payment instruments.
* They can be used with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or saved to
* You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to
* Customer objects to store instrument details for future payments.
*
* Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios).
Expand Down