Skip to content

Commit c026aa1

Browse files
API Updates (#1386)
1 parent 11fd41a commit c026aa1

File tree

18 files changed

+439
-18
lines changed

18 files changed

+439
-18
lines changed

lib/resources.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,8 @@ module.exports = {
9393
}),
9494
TestHelpers: resourceNamespace('testHelpers', {
9595
TestClocks: require('./resources/TestHelpers/TestClocks'),
96+
Terminal: resourceNamespace('terminal', {
97+
Readers: require('./resources/TestHelpers/Terminal/Readers'),
98+
}),
9699
}),
97100
};

lib/resources/Terminal/Readers.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,24 @@ module.exports = StripeResource.extend({
3333
method: 'DELETE',
3434
path: '/{reader}',
3535
}),
36+
37+
cancelAction: stripeMethod({
38+
method: 'POST',
39+
path: '/{reader}/cancel_action',
40+
}),
41+
42+
processPaymentIntent: stripeMethod({
43+
method: 'POST',
44+
path: '/{reader}/process_payment_intent',
45+
}),
46+
47+
processSetupIntent: stripeMethod({
48+
method: 'POST',
49+
path: '/{reader}/process_setup_intent',
50+
}),
51+
52+
setReaderDisplay: stripeMethod({
53+
method: 'POST',
54+
path: '/{reader}/set_reader_display',
55+
}),
3656
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// File generated from our OpenAPI spec
2+
3+
'use strict';
4+
5+
const StripeResource = require('../../../StripeResource');
6+
const stripeMethod = StripeResource.method;
7+
8+
module.exports = StripeResource.extend({
9+
path: 'test_helpers/terminal/readers',
10+
11+
presentPaymentMethod: stripeMethod({
12+
method: 'POST',
13+
path: '/{reader}/present_payment_method',
14+
}),
15+
});

test/resources/Integration.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,14 @@ describe('Charges Resource', () => {
4242
});
4343
});
4444
});
45+
46+
describe('Reader Resource', () => {
47+
describe('presentPaymentMethod', () => {
48+
it('Sends the correct request', async () => {
49+
const reader = await stripe.testHelpers.terminal.readers.presentPaymentMethod(
50+
'rdr_123'
51+
);
52+
expect(reader).to.not.be.null;
53+
});
54+
});
55+
});
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
'use strict';
2+
3+
const stripe = require('../../../../testUtils').getSpyableStripe();
4+
5+
const expect = require('chai').expect;
6+
7+
describe('Terminal', () => {
8+
describe('Readers Resource', () => {
9+
describe('update', () => {
10+
it('Sends the correct request', () => {
11+
stripe.testHelpers.terminal.readers.presentPaymentMethod('rdr_123');
12+
expect(stripe.LAST_REQUEST).to.deep.equal({
13+
method: 'POST',
14+
url:
15+
'/v1/test_helpers/terminal/readers/rdr_123/present_payment_method',
16+
headers: {},
17+
data: {},
18+
settings: {},
19+
});
20+
});
21+
});
22+
});
23+
});

types/2020-08-27/Charges.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ declare module 'stripe' {
108108
/**
109109
* ID of the balance transaction that describes the reversal of the balance on your account due to payment failure.
110110
*/
111-
failure_balance_transaction?: string | Stripe.BalanceTransaction | null;
111+
failure_balance_transaction: string | Stripe.BalanceTransaction | null;
112112

113113
/**
114114
* Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes).
@@ -2136,7 +2136,10 @@ declare module 'stripe' {
21362136
): Promise<Stripe.Response<Stripe.Charge>>;
21372137

21382138
/**
2139-
* Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
2139+
* Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
2140+
* Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
2141+
* conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
2142+
* to an hour behind during outages. Search functionality is not available to merchants in India.
21402143
*/
21412144
search(
21422145
params: ChargeSearchParams,

types/2020-08-27/Checkout/Sessions.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ declare module 'stripe' {
13101310
metadata?: Stripe.MetadataParam;
13111311

13121312
/**
1313-
* The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
1313+
* The product's name, meant to be displayable to the customer.
13141314
*/
13151315
name: string;
13161316

types/2020-08-27/Customers.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,10 @@ declare module 'stripe' {
827827
): ApiListPromise<Stripe.PaymentMethod>;
828828

829829
/**
830-
* Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
830+
* Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
831+
* Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
832+
* conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
833+
* to an hour behind during outages. Search functionality is not available to merchants in India.
831834
*/
832835
search(
833836
params: CustomerSearchParams,

types/2020-08-27/Invoices.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ declare module 'stripe' {
620620
/**
621621
* If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent.
622622
*/
623-
us_bank_account?: PaymentMethodOptions.UsBankAccount | null;
623+
us_bank_account: PaymentMethodOptions.UsBankAccount | null;
624624
}
625625

626626
namespace PaymentMethodOptions {
@@ -2163,7 +2163,10 @@ declare module 'stripe' {
21632163
): Promise<Stripe.Response<Stripe.Invoice>>;
21642164

21652165
/**
2166-
* Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
2166+
* Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
2167+
* Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
2168+
* conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
2169+
* to an hour behind during outages. Search functionality is not available to merchants in India.
21672170
*/
21682171
search(
21692172
params: InvoiceSearchParams,

types/2020-08-27/PaymentIntents.d.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ declare module 'stripe' {
577577
/**
578578
* The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.
579579
*/
580-
microdeposit_type?: VerifyWithMicrodeposits.MicrodepositType | null;
580+
microdeposit_type: VerifyWithMicrodeposits.MicrodepositType | null;
581581
}
582582

583583
namespace VerifyWithMicrodeposits {
@@ -5994,7 +5994,10 @@ declare module 'stripe' {
59945994
): Promise<Stripe.Response<Stripe.PaymentIntent>>;
59955995

59965996
/**
5997-
* Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language)
5997+
* Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
5998+
* Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
5999+
* conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
6000+
* to an hour behind during outages. Search functionality is not available to merchants in India.
59986001
*/
59996002
search(
60006003
params: PaymentIntentSearchParams,

0 commit comments

Comments
 (0)