Skip to content

Commit

Permalink
Codegen for openapi 6f9da2d
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed May 18, 2021
1 parent 0c67cd3 commit 7b50b6f
Show file tree
Hide file tree
Showing 12 changed files with 968 additions and 25 deletions.
4 changes: 4 additions & 0 deletions lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ module.exports = {
Checkout: resourceNamespace('checkout', {
Sessions: require('./resources/Checkout/Sessions'),
}),
Identity: resourceNamespace('identity', {
VerificationReports: require('./resources/Identity/VerificationReports'),
VerificationSessions: require('./resources/Identity/VerificationSessions'),
}),
Issuing: resourceNamespace('issuing', {
Authorizations: require('./resources/Issuing/Authorizations'),
Cards: require('./resources/Issuing/Cards'),
Expand Down
11 changes: 11 additions & 0 deletions lib/resources/Identity/VerificationReports.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// File generated from our OpenAPI spec

'use strict';

const StripeResource = require('../../StripeResource');

module.exports = StripeResource.extend({
path: 'identity/verification_reports',

includeBasic: ['retrieve', 'list'],
});
22 changes: 22 additions & 0 deletions lib/resources/Identity/VerificationSessions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// File generated from our OpenAPI spec

'use strict';

const StripeResource = require('../../StripeResource');
const stripeMethod = StripeResource.method;

module.exports = StripeResource.extend({
path: 'identity/verification_sessions',

includeBasic: ['create', 'retrieve', 'update', 'list'],

cancel: stripeMethod({
method: 'POST',
path: '/{session}/cancel',
}),

redact: stripeMethod({
method: 'POST',
path: '/{session}/redact',
}),
});
14 changes: 7 additions & 7 deletions types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,37 +507,37 @@ declare module 'stripe' {

interface Requirements {
/**
* The date the fields in `currently_due` must be collected by to keep payouts enabled for the account. These fields might block payouts sooner if the next threshold is reached before these fields are collected.
* Date by which the fields in `currently_due` must be collected to keep the account enabled. These fields may disable the account sooner if the next threshold is reached before they are collected.
*/
current_deadline: number | null;

/**
* The fields that need to be collected to keep the account enabled. If not collected by the `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
* Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled.
*/
currently_due: Array<string> | null;

/**
* If the account is disabled, this string describes why the account can't create charges or receive payouts. Can be `requirements.past_due`, `requirements.pending_verification`, `rejected.fraud`, `rejected.terms_of_service`, `rejected.listed`, `rejected.other`, `listed`, `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.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`.
*/
disabled_reason: string | null;

/**
* The fields that are `currently_due` and need to be collected again because validation or verification failed for some reason.
* Fields that are `currently_due` and need to be collected again because validation or verification failed.
*/
errors: Array<Requirements.Error> | null;

/**
* The fields that need to be collected assuming all volume thresholds are reached. As they become required, these fields appear in `currently_due` as well, and the `current_deadline` is set.
* Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set.
*/
eventually_due: Array<string> | null;

/**
* The fields that weren't collected by the `current_deadline`. These fields need to be collected to re-enable the account.
* Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the account.
*/
past_due: Array<string> | null;

/**
* Fields that may become required depending on the results of verification or review. An empty array unless an asynchronous verification is pending. If verification fails, the fields in this array become required and move to `currently_due` or `past_due`.
* Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields become required and move to `currently_due` or `past_due`.
*/
pending_verification: Array<string> | null;
}
Expand Down
14 changes: 7 additions & 7 deletions types/2020-08-27/Capabilities.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ declare module 'stripe' {
namespace Capability {
interface Requirements {
/**
* The date the fields in `currently_due` must be collected by to keep the capability enabled for the account.
* Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. These fields may disable the capability sooner if the next threshold is reached before they are collected.
*/
current_deadline: number | null;

/**
* The fields that need to be collected to keep the capability enabled. If not collected by the `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled.
* Fields that need to be collected to keep the capability enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled.
*/
currently_due: Array<string>;

/**
* If the capability is disabled, this string describes why. Possible values are `requirement.fields_needed`, `pending.onboarding`, `pending.review`, `rejected_fraud`, `rejected.unsupported_business` or `rejected.other`.
* 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`.
*
* `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 All @@ -63,22 +63,22 @@ declare module 'stripe' {
disabled_reason: string | null;

/**
* The fields that are `currently_due` and need to be collected again because validation or verification failed for some reason.
* Fields that are `currently_due` and need to be collected again because validation or verification failed.
*/
errors: Array<Requirements.Error>;

/**
* The fields that need to be collected assuming all volume thresholds are reached. As they become required, these fields appear in `currently_due` as well, and the `current_deadline` is set.
* Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set.
*/
eventually_due: Array<string>;

/**
* The fields that weren't collected by the `current_deadline`. These fields need to be collected to enable the capability for the account.
* Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the capability on the account.
*/
past_due: Array<string>;

/**
* Fields that may become required depending on the results of verification or review. An empty array unless an asynchronous verification is pending. If verification fails, the fields in this array become required and move to `currently_due` or `past_due`.
* Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields become required and move to `currently_due` or `past_due`.
*/
pending_verification: Array<string>;
}
Expand Down
13 changes: 7 additions & 6 deletions types/2020-08-27/Coupons.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ declare module 'stripe' {
}

interface CouponCreateParams {
/**
* Specifies how long the discount will be in effect. Can be `forever`, `once`, or `repeating`.
*/
duration: CouponCreateParams.Duration;

/**
* A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed).
*/
Expand All @@ -138,6 +133,11 @@ declare module 'stripe' {
*/
currency?: string;

/**
* Specifies how long the discount will be in effect if used on a subscription. Can be `forever`, `once`, or `repeating`. Defaults to `once`.
*/
duration?: CouponCreateParams.Duration;

/**
* Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect.
*/
Expand Down Expand Up @@ -235,9 +235,10 @@ declare module 'stripe' {
* A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it.
*/
create(
params: CouponCreateParams,
params?: CouponCreateParams,
options?: RequestOptions
): Promise<Stripe.Response<Stripe.Coupon>>;
create(options?: RequestOptions): Promise<Stripe.Response<Stripe.Coupon>>;

/**
* Retrieves the coupon with the given ID.
Expand Down
2 changes: 1 addition & 1 deletion types/2020-08-27/FileLinks.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ declare module 'stripe' {

interface FileLinkCreateParams {
/**
* The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `pci_document`, `sigma_scheduled_query`, or `tax_document_user_upload`.
* The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, or `tax_document_user_upload`.
*/
file: string;

Expand Down
4 changes: 4 additions & 0 deletions types/2020-08-27/Files.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ declare module 'stripe' {
| 'document_provider_identity_document'
| 'finance_report_run'
| 'identity_document'
| 'identity_document_downloadable'
| 'pci_document'
| 'selfie'
| 'sigma_scheduled_query'
| 'tax_document_user_upload';
}
Expand Down Expand Up @@ -112,7 +114,9 @@ declare module 'stripe' {
| 'document_provider_identity_document'
| 'finance_report_run'
| 'identity_document'
| 'identity_document_downloadable'
| 'pci_document'
| 'selfie'
| 'sigma_scheduled_query'
| 'tax_document_user_upload';
}
Expand Down
Loading

0 comments on commit 7b50b6f

Please sign in to comment.