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

Add support for documents on Account create and update #1084

Merged
merged 1 commit into from
Dec 4, 2020
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
48 changes: 24 additions & 24 deletions lib/resources/Accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ module.exports = StripeResource.extend({
path: 'accounts/{account}/reject',
}),

listCapabilities: stripeMethod({
method: 'GET',
path: 'accounts/{account}/capabilities',
methodType: 'list',
}),

retrieveCapability: stripeMethod({
method: 'GET',
path: 'accounts/{account}/capabilities/{capability}',
Expand All @@ -71,13 +65,24 @@ module.exports = StripeResource.extend({
path: 'accounts/{account}/capabilities/{capability}',
}),

listCapabilities: stripeMethod({
method: 'GET',
path: 'accounts/{account}/capabilities',
methodType: 'list',
}),

createExternalAccount: stripeMethod({
method: 'POST',
path: 'accounts/{account}/external_accounts',
}),

deleteExternalAccount: stripeMethod({
method: 'DELETE',
retrieveExternalAccount: stripeMethod({
method: 'GET',
path: 'accounts/{account}/external_accounts/{id}',
}),

updateExternalAccount: stripeMethod({
method: 'POST',
path: 'accounts/{account}/external_accounts/{id}',
}),

Expand All @@ -87,13 +92,8 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

retrieveExternalAccount: stripeMethod({
method: 'GET',
path: 'accounts/{account}/external_accounts/{id}',
}),

updateExternalAccount: stripeMethod({
method: 'POST',
deleteExternalAccount: stripeMethod({
method: 'DELETE',
path: 'accounts/{account}/external_accounts/{id}',
}),

Expand All @@ -107,8 +107,13 @@ module.exports = StripeResource.extend({
path: 'accounts/{account}/persons',
}),

deletePerson: stripeMethod({
method: 'DELETE',
retrievePerson: stripeMethod({
method: 'GET',
path: 'accounts/{account}/persons/{person}',
}),

updatePerson: stripeMethod({
method: 'POST',
path: 'accounts/{account}/persons/{person}',
}),

Expand All @@ -118,13 +123,8 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

retrievePerson: stripeMethod({
method: 'GET',
path: 'accounts/{account}/persons/{person}',
}),

updatePerson: stripeMethod({
method: 'POST',
deletePerson: stripeMethod({
method: 'DELETE',
path: 'accounts/{account}/persons/{person}',
}),
});
12 changes: 6 additions & 6 deletions lib/resources/ApplicationFees.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ module.exports = StripeResource.extend({
path: '/{id}/refunds',
}),

listRefunds: stripeMethod({
method: 'GET',
path: '/{id}/refunds',
methodType: 'list',
}),

retrieveRefund: stripeMethod({
method: 'GET',
path: '/{fee}/refunds/{id}',
Expand All @@ -30,4 +24,10 @@ module.exports = StripeResource.extend({
method: 'POST',
path: '/{fee}/refunds/{id}',
}),

listRefunds: stripeMethod({
method: 'GET',
path: '/{id}/refunds',
methodType: 'list',
}),
});
32 changes: 16 additions & 16 deletions lib/resources/Customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ module.exports = StripeResource.extend({
path: '/{customer}/balance_transactions',
}),

listBalanceTransactions: stripeMethod({
method: 'GET',
path: '/{customer}/balance_transactions',
methodType: 'list',
}),

retrieveBalanceTransaction: stripeMethod({
method: 'GET',
path: '/{customer}/balance_transactions/{transaction}',
Expand All @@ -36,15 +30,15 @@ module.exports = StripeResource.extend({
path: '/{customer}/balance_transactions/{transaction}',
}),

createSource: stripeMethod({
method: 'POST',
path: '/{customer}/sources',
listBalanceTransactions: stripeMethod({
method: 'GET',
path: '/{customer}/balance_transactions',
methodType: 'list',
}),

listSources: stripeMethod({
method: 'GET',
createSource: stripeMethod({
method: 'POST',
path: '/{customer}/sources',
methodType: 'list',
}),

retrieveSource: stripeMethod({
Expand All @@ -57,6 +51,12 @@ module.exports = StripeResource.extend({
path: '/{customer}/sources/{id}',
}),

listSources: stripeMethod({
method: 'GET',
path: '/{customer}/sources',
methodType: 'list',
}),

deleteSource: stripeMethod({
method: 'DELETE',
path: '/{customer}/sources/{id}',
Expand All @@ -72,8 +72,8 @@ module.exports = StripeResource.extend({
path: '/{customer}/tax_ids',
}),

deleteTaxId: stripeMethod({
method: 'DELETE',
retrieveTaxId: stripeMethod({
method: 'GET',
path: '/{customer}/tax_ids/{id}',
}),

Expand All @@ -83,8 +83,8 @@ module.exports = StripeResource.extend({
methodType: 'list',
}),

retrieveTaxId: stripeMethod({
method: 'GET',
deleteTaxId: stripeMethod({
method: 'DELETE',
path: '/{customer}/tax_ids/{id}',
}),
});
12 changes: 6 additions & 6 deletions lib/resources/Transfers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ module.exports = StripeResource.extend({
path: '/{id}/reversals',
}),

listReversals: stripeMethod({
method: 'GET',
path: '/{id}/reversals',
methodType: 'list',
}),

retrieveReversal: stripeMethod({
method: 'GET',
path: '/{transfer}/reversals/{id}',
Expand All @@ -30,4 +24,10 @@ module.exports = StripeResource.extend({
method: 'POST',
path: '/{transfer}/reversals/{id}',
}),

listReversals: stripeMethod({
method: 'GET',
path: '/{id}/reversals',
methodType: 'list',
}),
});
42 changes: 42 additions & 0 deletions types/2020-08-27/Accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,11 @@ declare module 'stripe' {
*/
default_currency?: string;

/**
* Documents that may be submitted to satisfy various informational requests.
*/
documents?: AccountCreateParams.Documents;

/**
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe will never directly email Custom accounts.
*/
Expand Down Expand Up @@ -1337,6 +1342,22 @@ declare module 'stripe' {
}
}

interface Documents {
/**
* One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check.
*/
bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification;
}

namespace Documents {
interface BankAccountOwnershipVerification {
/**
* One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
*/
files?: Array<string>;
}
}

interface Individual {
/**
* The individual's primary address.
Expand Down Expand Up @@ -1738,6 +1759,11 @@ declare module 'stripe' {
*/
default_currency?: string;

/**
* Documents that may be submitted to satisfy various informational requests.
*/
documents?: AccountUpdateParams.Documents;

/**
* The email address of the account holder. This is only to make the account easier to identify to you. Stripe will never directly email Custom accounts.
*/
Expand Down Expand Up @@ -2257,6 +2283,22 @@ declare module 'stripe' {
}
}

interface Documents {
/**
* One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check.
*/
bank_account_ownership_verification?: Documents.BankAccountOwnershipVerification;
}

namespace Documents {
interface BankAccountOwnershipVerification {
/**
* One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.
*/
files?: Array<string>;
}
}

interface Individual {
/**
* The individual's primary address.
Expand Down
22 changes: 11 additions & 11 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare module 'stripe' {
/**
* A unique string to reference the Checkout Session. This can be a
* customer ID, a cart ID, or similar, and can be used to reconcile the
* session with your internal systems.
* Session with your internal systems.
*/
client_reference_id: string | null;

Expand All @@ -55,19 +55,19 @@ declare module 'stripe' {
currency: string | null;

/**
* The ID of the customer for this session.
* The ID of the customer for this Session.
* For Checkout Sessions in `payment` or `subscription` mode, Checkout
* will create a new customer object based on information provided
* during the session unless an existing customer was provided when
* the session was created.
* during the payment flow unless an existing customer was provided when
* the Session was created.
*/
customer: string | Stripe.Customer | DeletedCustomer | null;

/**
* If provided, this value will be used when the Customer object is created.
* If not provided, customers will be asked to enter their email address.
* Use this parameter to prefill customer data if you already have an email
* on file. To access information about the customer once a session is
* on file. To access information about the customer once the payment flow is
* complete, use the `customer` attribute.
*/
customer_email: string | null;
Expand Down Expand Up @@ -542,7 +542,7 @@ declare module 'stripe' {
cancel_url: string;

/**
* A list of the types of payment methods (e.g., `card`) this Checkout session can accept.
* A list of the types of payment methods (e.g., `card`) this Checkout Session can accept.
*
* Read more about the supported payment methods and their requirements in our [payment
* method details guide](https://stripe.com/docs/payments/checkout/payment-methods).
Expand Down Expand Up @@ -585,7 +585,7 @@ declare module 'stripe' {
* object will be updated with the new email.
* If blank for Checkout Sessions in `payment` or `subscription` mode,
* Checkout will create a new customer object based on information
* provided during the session.
* provided during the payment flow.
*/
customer?: string;

Expand All @@ -599,7 +599,7 @@ declare module 'stripe' {
customer_email?: string;

/**
* The coupon or promotion code to apply to this session. Currently, only up to one may be specified.
* The coupon or promotion code to apply to this Session. Currently, only up to one may be specified.
*/
discounts?: Array<SessionCreateParams.Discount>;

Expand Down Expand Up @@ -628,7 +628,7 @@ declare module 'stripe' {
metadata?: Stripe.MetadataParam;

/**
* The mode of the Checkout Session. Required when using prices or `setup` mode. Pass `subscription` if Checkout session includes at least one recurring item.
* The mode of the Checkout Session. Required when using prices or `setup` mode. Pass `subscription` if the Checkout Session includes at least one recurring item.
*/
mode?: SessionCreateParams.Mode;

Expand Down Expand Up @@ -666,12 +666,12 @@ declare module 'stripe' {

interface Discount {
/**
* The ID of the coupon to apply to this session.
* The ID of the coupon to apply to this Session.
*/
coupon?: string;

/**
* The ID of a promotion code to apply to this session.
* The ID of a promotion code to apply to this Session.
*/
promotion_code?: string;
}
Expand Down
2 changes: 2 additions & 0 deletions types/2020-08-27/Files.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ declare module 'stripe' {

namespace File {
type Purpose =
| 'account_requirement'
| 'additional_verification'
| 'business_icon'
| 'business_logo'
Expand Down Expand Up @@ -98,6 +99,7 @@ declare module 'stripe' {

namespace FileListParams {
type Purpose =
| 'account_requirement'
| 'additional_verification'
| 'business_icon'
| 'business_logo'
Expand Down
4 changes: 2 additions & 2 deletions types/2020-08-27/Issuing/Authorizations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,12 @@ declare module 'stripe' {

interface AuthorizationListParams extends PaginationParams {
/**
* Only return issuing transactions that belong to the given card.
* Only return authorizations that belong to the given card.
*/
card?: string;

/**
* Only return authorizations belonging to the given cardholder.
* Only return authorizations that belong to the given cardholder.
*/
cardholder?: string;

Expand Down