feat(stripe): add failure_reason for refunds (#27884)

This commit is contained in:
Simon Schick
2018-08-06 21:05:57 +02:00
committed by Sheetal Nandi
parent ef1f0f87e8
commit 347bdf75c3
2 changed files with 10 additions and 4 deletions

View File

@@ -189,7 +189,7 @@ declare namespace Stripe {
* account holder to setup a username and password, and handle all account
* management directly with them. Possible values are custom and standard.
*/
type: 'custom' | 'standard';
type: "custom" | "standard";
}
interface IAccountShared {
@@ -1470,7 +1470,7 @@ declare namespace Stripe {
source?: sources.ISourceCreationOptionsExtended;
}
interface ICustomerListOptions extends IListOptionsCreated {
interface ICustomerListOptions extends IListOptionsCreated {
/**
* A filter on the list based on the customers email field. The value must be a string.
*/
@@ -4347,7 +4347,7 @@ declare namespace Stripe {
/**
* Value is 'card'
*/
object: 'card';
object: "card";
/**
* The card number
@@ -4680,7 +4680,7 @@ declare namespace Stripe {
trial_period_days?: number;
/**
* Indicates if a plans trial_period_days should be applied to the subscription. Setting trial_end per subscription is preferred,
* Indicates if a plans trial_period_days should be applied to the subscription. Setting trial_end per subscription is preferred,
* and this defaults to false. Setting this flag to true together with trial_end is not allowed.
*/
trial_from_plan?: boolean;
@@ -5039,6 +5039,11 @@ declare namespace Stripe {
* For other types of refunds, it can be pending, succeeded, failed, or canceled.
*/
status: "pending" | "succeeded" | "failed" | "canceled";
/**
* If the refund failed, the reason for refund failure if known.
*/
failure_reason?: "lost_or_stolen_card" | "expired_or_canceled_card" | "unknown";
}
interface IRefundCreationOptions extends IDataOptionsWithMetadata {

View File

@@ -59,6 +59,7 @@ stripe.charges.create({
// asynchronously called
charge.refunds.create().then(function (refund) {
const reason = refund.failure_reason;
// asynchronously called
});
charge.refunds.create({ amount: 100 }).then(function (refund) {