Skip to content

Commit

Permalink
Codegen for openapi c2caca4 (#1266)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Oct 8, 2021
1 parent d68184e commit b01842f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/resources/Customers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ module.exports = StripeResource.extend({
path: '/{customer}/discount',
}),

listPaymentMethods: stripeMethod({
method: 'GET',
path: '/{customer}/payment_methods',
methodType: 'list',
}),

createBalanceTransaction: stripeMethod({
method: 'POST',
path: '/{customer}/balance_transactions',
Expand Down
5 changes: 5 additions & 0 deletions test/resources/generated_examples_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ describe('Customer', function() {
const customers = await stripe.customers.list({limit: 3});
expect(customers).not.to.be.null;
});

it('listPaymentMethods method', async function() {
const paymentMethods = await stripe.customers.listPaymentMethods('cus_xyz');
expect(paymentMethods).not.to.be.null;
});
});

describe('BalanceTransaction', function() {
Expand Down
44 changes: 44 additions & 0 deletions types/2020-08-27/Customers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,41 @@ declare module 'stripe' {

interface CustomerDeleteDiscountParams {}

interface CustomerListPaymentMethodsParams extends PaginationParams {
/**
* A required filter on the list, based on the object `type` field.
*/
type: CustomerListPaymentMethodsParams.Type;

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

namespace CustomerListPaymentMethodsParams {
type Type =
| 'acss_debit'
| 'afterpay_clearpay'
| 'alipay'
| 'au_becs_debit'
| 'bacs_debit'
| 'bancontact'
| 'boleto'
| 'card'
| 'card_present'
| 'eps'
| 'fpx'
| 'giropay'
| 'grabpay'
| 'ideal'
| 'oxxo'
| 'p24'
| 'sepa_debit'
| 'sofort'
| 'wechat_pay';
}

class CustomersResource {
/**
* Creates a new customer object.
Expand Down Expand Up @@ -735,6 +770,15 @@ declare module 'stripe' {
options?: RequestOptions
): Promise<Stripe.Response<Stripe.DeletedDiscount>>;

/**
* Returns a list of PaymentMethods for a given Customer
*/
listPaymentMethods(
id: string,
params: CustomerListPaymentMethodsParams,
options?: RequestOptions
): ApiListPromise<Stripe.PaymentMethod>;

/**
* Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance).
*/
Expand Down

0 comments on commit b01842f

Please sign in to comment.