#samaral
1 messages · Page 1 of 1 (latest)
This is the console output from my AWS console:
_stripe: {
VERSION: '8.176.0',
on: [Function: bound addListener],
once: [Function: bound once],
off: [Function: bound removeListener],
_api: {
auth: 'Bearer SECRET_KEY',
host: 'api.stripe.com',
port: '443',
protocol: 'https',
basePath: '/v1/',
version: null,
timeout: 80000,
maxNetworkRetries: 0,
agent: null,
httpClient: [NodeHttpClient],
dev: false,
stripeAccount: null
},
accounts: {
_stripe: [Circular],
basePath: [Function],
resourcePath: '',
path: [Function]
},
account: {
...
},
webhooks: {
DEFAULT_TOLERANCE: 300,
constructEvent: [Function: constructEvent],
generateTestHeaderString: [Function: generateTestHeaderString],
signature: [Object]
},
_prevRequestMetrics: [],
_enableTelemetry: true,
StripeResource: [Function: StripeResource] {
extend: [Function: protoExtend],
method: [Function: stripeMethod],
BASIC_METHODS: [Object],
MAX_BUFFERED_REQUEST_METRICS: 100
}
},
basePath: [Function],
resourcePath: 'prices',
path: [Function]
}
Where as my github example outputs:
heya @warm shoal! did you retrieve the prices before attempting to print them? It looks like you're missing a few lines of code from what you originally provided. https://stripe.com/docs/api/prices/list?lang=node
...
},
basePath: [Function (anonymous)],
resourcePath: 'prices',
path: [Function (anonymous)],
create: [Function (anonymous)],
retrieve: [Function (anonymous)],
update: [Function (anonymous)],
list: [Function (anonymous)]
}
Yes, my lambda function is timing out on
const prices = await stripe.prices.list({
limit: 3,
});
From what I can tell in the logs, my stripe.prices.list doesn't exist in my AWS example.
In my github example, I see the list and it outputs the prices very quickly.
I feel like I am missing something with regards to my AWS setup, for example does:
httpClient: [NodeHttpClient],
stripeAccount: null
in _api imply I am missing something in my stripe connection. I don't see these in my github example.
@warm shoal honestly, i'm not that familiar with AWS, but firstly, if you attempt to run the below in a simple node.js file, does it work for you?
const stripe = require('stripe')('sk_test_...');
( async () => {
const prices = await stripe.prices.list({
limit: 100,
});
console.log(prices);
}) ()
I will run that now.
My call is timing out on
const prices = await stripe.prices.list({
limit: 100,
});
it's starting to sound as if you are having issues with connecting to Stripe servers
maybe try this on your server to check? https://github.com/stripe/stripe-reachability
Yea, this could be it. I can connect to Stripe servers on my home computer (github example) but not through AWS lambda.
@warm shoal we saw similar issues recurring for some AWS lambda instances and our engineering team dug a little bit deeper and you can take a look at https://github.com/stripe/stripe-node/issues/1040#issuecomment-748405623
const stripe = require('stripe')('secret_key_xyz', {
httpAgent: new https.Agent({keepAlive: false})
});
something like the above would probably improve the connection issues