#junaid_abbasi999

1 messages · Page 1 of 1 (latest)

strange scrollBOT
sinful bough
#

I am using test mode of stripe.

cloud goblet
#

Hello! Do you mind sharing a request ID I can take a look at?

sinful bough
#

where would i find the request Id?

cloud goblet
#

You should be able to find it in the Dashboard

sinful bough
#

don't have any request in dashboard but I consoled the response that i am getting and in that I see this " requestId: undefined,"..

#

sorry the response is not consoled.... It's what I am getting at my terminal..... requestId is undefined. there is also a lot more information attached to it.

cloud goblet
#

Gotcha

#

Let's take a different approach - can you share the Customer ID you're trying to retrieve, and the code you're using to do it?

sinful bough
#

cus_NSbfYUbm7rB8PN

#

app.post("/retrieve-account", async (req, res) => {
console.log("customerId:", req.body.accountId);
const account = await stripe.accounts.retrieve(req.body.accountId);
console.log(account);
res.json(account);
});

cloud goblet
#

Why are you using stripe.accounts.retrieve and not stripe.customers.retrieve?

sinful bough
#

sorry brother my bad....

#

didn't see it... thanks for help

cloud goblet
#

Glad I could help!

sinful bough
#

one last thing my customer object has default_source and invoiceSettings.default_payment_method set to null even though I have added two credit cards to this specific customer. I have a requirement where i need to find the default card attached to a customer.

twin mauve
#

Hi, stepping in here

sinful bough
#

Yes I got that. But how will I able to get the default payemnt method id?

#

if these two are null eventhough payment methods are added to it

twin mauve
sinful bough
#

one last thing if i didn't set a default payment method how will stripe decide what payment method to charge?

twin mauve
#

No, you'd need to explicitly pass the payment method id when creating the subscription.

sinful bough
#

no but for future payment you need an id for payment method.

twin mauve
#

What do you mean for 'future payments'? Are you talking about when you create a one-time Payment Intent for that customer?

sinful bough
#

yes but they are hapenning off-session

#

I do need a payment method id.

twin mauve
#

I'm not 100% clear on what you're trying to do. However, once you have setup the payment method, you can use that payment method for future payments. You'd need to pass the payment method id for that payment.

sinful bough
#

Ok let me draw a sceneroi for you to understand.
user 1 orders a service from user 2 and sets his payment method, user 1 will not be charget at this time.
user 2 provides the service and clicks a button named as 'confirm'. Then we charge the user 1 off-session.

#

for now what I am doing is when user 1 is ordering a service, I save the id of the first card that is returned by stripe card list api in my database. And when user 2 click 'confirm'. I retrieve that ID and I charge user 1.

#

Hope that makes my case clear enough