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

Merged
merged 1 commit into from Dec 6, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
@@ -1 +1 @@
v211
v212
65 changes: 65 additions & 0 deletions types/BillingPortal/Sessions.d.ts
Expand Up @@ -45,6 +45,11 @@ declare module 'stripe' {
*/
customer: string;

/**
* Information about a specific flow for the customer to go through.
*/
flow: Session.Flow | null;

/**
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
*/
Expand Down Expand Up @@ -72,6 +77,66 @@ declare module 'stripe' {
}

namespace Session {
interface Flow {
after_completion: Flow.AfterCompletion;

/**
* Configuration when `flow.type=subscription_cancel`.
*/
subscription_cancel: Flow.SubscriptionCancel | null;

/**
* Type of flow that the customer will go through.
*/
type: Flow.Type;
}

namespace Flow {
interface AfterCompletion {
/**
* Configuration when `after_completion.type=hosted_confirmation`.
*/
hosted_confirmation: AfterCompletion.HostedConfirmation | null;

/**
* Configuration when `after_completion.type=redirect`.
*/
redirect: AfterCompletion.Redirect | null;

/**
* The specified type of behavior after the flow is completed.
*/
type: AfterCompletion.Type;
}

namespace AfterCompletion {
interface HostedConfirmation {
/**
* A custom message to display to the customer after the flow is completed.
*/
custom_message: string | null;
}

interface Redirect {
/**
* The URL the customer will be redirected to after the flow is completed.
*/
return_url: string;
}

type Type = 'hosted_confirmation' | 'portal_homepage' | 'redirect';
}

interface SubscriptionCancel {
/**
* The ID of the subscription to be canceled.
*/
subscription: string;
}

type Type = 'payment_method_update' | 'subscription_cancel';
}

type Locale =
| 'auto'
| 'bg'
Expand Down
68 changes: 68 additions & 0 deletions types/BillingPortal/SessionsResource.d.ts
Expand Up @@ -19,6 +19,11 @@ declare module 'stripe' {
*/
expand?: Array<string>;

/**
* Information about a specific flow for the customer to go through.
*/
flow_data?: SessionCreateParams.FlowData;

/**
* The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used.
*/
Expand All @@ -36,6 +41,69 @@ declare module 'stripe' {
}

namespace SessionCreateParams {
interface FlowData {
/**
* Behavior after the flow is completed.
*/
after_completion?: FlowData.AfterCompletion;

/**
* Configuration when `flow_data.type=subscription_cancel`.
*/
subscription_cancel?: FlowData.SubscriptionCancel;

/**
* Type of flow that the customer will go through.
*/
type: FlowData.Type;
}

namespace FlowData {
interface AfterCompletion {
/**
* Configuration when `after_completion.type=hosted_confirmation`.
*/
hosted_confirmation?: AfterCompletion.HostedConfirmation;

/**
* Configuration when `after_completion.type=redirect`.
*/
redirect?: AfterCompletion.Redirect;

/**
* The specified behavior after the flow is completed.
*/
type: AfterCompletion.Type;
}

namespace AfterCompletion {
interface HostedConfirmation {
/**
* A custom message to display to the customer after the flow is completed.
*/
custom_message?: string;
}

interface Redirect {
/**
* The URL the customer will be redirected to after the flow is completed.
*/
return_url: string;
}

type Type = 'hosted_confirmation' | 'portal_homepage' | 'redirect';
}

interface SubscriptionCancel {
/**
* The ID of the subscription to be canceled.
*/
subscription: string;
}

type Type = 'payment_method_update' | 'subscription_cancel';
}

type Locale =
| 'auto'
| 'bg'
Expand Down