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

Merged
merged 1 commit into from
Apr 8, 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 @@ -29,6 +29,11 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

applyCustomerBalance: stripeMethod({
method: 'POST',
path: '/{intent}/apply_customer_balance',
}),

cancel: stripeMethod({
method: 'POST',
path: '/{intent}/cancel',
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 @@ -221,7 +221,7 @@ declare module 'stripe' {
total_details: Session.TotalDetails | null;

/**
* The URL to the Checkout Session.
* The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you're using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it'll use `checkout.stripe.com.`
*/
url: string | null;
}
Expand Down Expand Up @@ -848,17 +848,17 @@ declare module 'stripe' {

interface TotalDetails {
/**
* This is the sum of all the line item discounts.
* This is the sum of all the discounts.
*/
amount_discount: number;

/**
* This is the sum of all the line item shipping amounts.
* This is the sum of all the shipping amounts.
*/
amount_shipping: number | null;

/**
* This is the sum of all the line item tax amounts.
* This is the sum of all the tax amounts.
*/
amount_tax: number;

Expand All @@ -868,12 +868,12 @@ declare module 'stripe' {
namespace TotalDetails {
interface Breakdown {
/**
* The aggregated line item discounts.
* The aggregated discounts.
*/
discounts: Array<Breakdown.Discount>;

/**
* The aggregated line item tax amounts by rate.
* The aggregated tax amounts by rate.
*/
taxes: Array<Breakdown.Tax>;
}
Expand Down
38 changes: 38 additions & 0 deletions types/2020-08-27/PaymentIntents.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4324,6 +4324,29 @@ declare module 'stripe' {
expand?: Array<string>;
}

interface PaymentIntentApplyCustomerBalanceParams {
/**
* Amount intended to be applied to this PaymentIntent from the customer's cash balance.
*
* A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency).
*
* The maximum amount is the amount of the PaymentIntent.
*
* When omitted, the amount defaults to the remaining amount requested on the PaymentIntent.
*/
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).
*/
currency?: string;

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

interface PaymentIntentCancelParams {
/**
* Reason for canceling this PaymentIntent. Possible values are `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`
Expand Down Expand Up @@ -5942,6 +5965,21 @@ declare module 'stripe' {
): ApiListPromise<Stripe.PaymentIntent>;
list(options?: RequestOptions): ApiListPromise<Stripe.PaymentIntent>;

/**
* Manually reconcile the remaining amount for a customer_balance PaymentIntent.
*
* This can be used when the cash balance for [a customer in manual reconciliation mode](docs/payments/customer-balance/reconciliation#cash-manual-reconciliation) received funds.
*/
applyCustomerBalance(
id: string,
params?: PaymentIntentApplyCustomerBalanceParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.PaymentIntent>>;
applyCustomerBalance(
id: string,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.PaymentIntent>>;

/**
* A PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action, or processing.
*
Expand Down
30 changes: 15 additions & 15 deletions types/2020-08-27/Quotes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ declare module 'stripe' {

interface TotalDetails {
/**
* This is the sum of all the line item discounts.
* This is the sum of all the discounts.
*/
amount_discount: number;

/**
* This is the sum of all the line item shipping amounts.
* This is the sum of all the shipping amounts.
*/
amount_shipping: number | null;

/**
* This is the sum of all the line item tax amounts.
* This is the sum of all the tax amounts.
*/
amount_tax: number;

Expand All @@ -240,12 +240,12 @@ declare module 'stripe' {
namespace TotalDetails {
interface Breakdown {
/**
* The aggregated line item discounts.
* The aggregated discounts.
*/
discounts: Array<Breakdown.Discount>;

/**
* The aggregated line item tax amounts by rate.
* The aggregated tax amounts by rate.
*/
taxes: Array<Breakdown.Tax>;
}
Expand Down Expand Up @@ -306,17 +306,17 @@ declare module 'stripe' {
namespace Upfront {
interface TotalDetails {
/**
* This is the sum of all the line item discounts.
* This is the sum of all the discounts.
*/
amount_discount: number;

/**
* This is the sum of all the line item shipping amounts.
* This is the sum of all the shipping amounts.
*/
amount_shipping: number | null;

/**
* This is the sum of all the line item tax amounts.
* This is the sum of all the tax amounts.
*/
amount_tax: number;

Expand All @@ -326,12 +326,12 @@ declare module 'stripe' {
namespace TotalDetails {
interface Breakdown {
/**
* The aggregated line item discounts.
* The aggregated discounts.
*/
discounts: Array<Breakdown.Discount>;

/**
* The aggregated line item tax amounts by rate.
* The aggregated tax amounts by rate.
*/
taxes: Array<Breakdown.Tax>;
}
Expand Down Expand Up @@ -423,17 +423,17 @@ declare module 'stripe' {

interface TotalDetails {
/**
* This is the sum of all the line item discounts.
* This is the sum of all the discounts.
*/
amount_discount: number;

/**
* This is the sum of all the line item shipping amounts.
* This is the sum of all the shipping amounts.
*/
amount_shipping: number | null;

/**
* This is the sum of all the line item tax amounts.
* This is the sum of all the tax amounts.
*/
amount_tax: number;

Expand All @@ -443,12 +443,12 @@ declare module 'stripe' {
namespace TotalDetails {
interface Breakdown {
/**
* The aggregated line item discounts.
* The aggregated discounts.
*/
discounts: Array<Breakdown.Discount>;

/**
* The aggregated line item tax amounts by rate.
* The aggregated tax amounts by rate.
*/
taxes: Array<Breakdown.Tax>;
}
Expand Down
2 changes: 2 additions & 0 deletions types/2020-08-27/WebhookEndpoints.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ declare module 'stripe' {
| 'billing_portal.configuration.created'
| 'billing_portal.configuration.updated'
| 'capability.updated'
| 'cash_balance.funds_available'
| 'charge.captured'
| 'charge.dispute.closed'
| 'charge.dispute.created'
Expand Down Expand Up @@ -471,6 +472,7 @@ declare module 'stripe' {
| 'billing_portal.configuration.created'
| 'billing_portal.configuration.updated'
| 'capability.updated'
| 'cash_balance.funds_available'
| 'charge.captured'
| 'charge.dispute.closed'
| 'charge.dispute.created'
Expand Down