Hi,
I’m trying to create a rule that will retrieve the list of subscriptions from my Stripe customer and add it to the app_metadata of the user profile.
However, when I am receiving the following error: ERROR: Cannot read property ‘list’ of undefined
Snippet of my code in the rule:
var stripe = require(‘stripe’)(‘sk_test_XXXXXXXX’);
var customer = {
customer: user.app_metadata.stripe_customer_id
};
stripe.subscriptions.list(customer, function(err, subscriptions) {
if (err) {
console.log(“error from stripe”);
}
Per the Stripe API documentation, this should work:
I’ve verified that the user.app_metadata.stripe_customer_id is populated correctly, and still get the same error
I also tested this with Postman and I am able to retrieve the subscriptions.
Any ideas?