#samaral

1 messages · Page 1 of 1 (latest)

radiant marlin
warm shoal
#

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:

radiant marlin
warm shoal
#

...
},
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.

radiant marlin
#

@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);
  }) ()
warm shoal
#

I will run that now.

warm shoal
#

My call is timing out on
const prices = await stripe.prices.list({
limit: 100,
});

radiant marlin
#

it's starting to sound as if you are having issues with connecting to Stripe servers

warm shoal
#

Yea, this could be it. I can connect to Stripe servers on my home computer (github example) but not through AWS lambda.

tribal whale
#
const stripe = require('stripe')('secret_key_xyz', {
  httpAgent: new https.Agent({keepAlive: false})
});

something like the above would probably improve the connection issues