#devertry_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1410841966174011473
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- devertry_webhooks, 3 days ago, 12 messages
hello! Can you share the request id [0]? it’ll have the prefix req_
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
XHRPOST
http://localhost:4000/affiliation
[HTTP/1.1 500 Internal Server Error 622ms]
domain "sjjsjsjsjsjjj"
email "hello@gmail.com"
firstname "sjsjsjj"
lastname "sjsjsjsj"
name "jsjsjsj"
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
req_NiIosPylS5cygE
whops
its test data so its ok
for context, you're creating a Customer
what is undefined specifically?
the request is successful, and a Customer is successfully created
yes but doestn return me it in the front end
in the backend .... 6am and not sleeping
TypeError: Cannot read properties of undefined (reading 'accounts')
async generateAccountUrl(email: string, business: number | null = null ) {
const payload = business ? {business} : null;
email = "tim." + 123 + ".@gmail.com"
console.log(email);
const accountId = await this.client.accounts.create({
type: 'express',
settings: {
payouts: {
schedule: {
interval: 'manual'
}
}
},
email});
console.log(accountId);
const {url} = await this.client.accountLinks.create({
account: accountId.id,
type: 'account_onboarding',
refresh_url: 'https://' + this.ctx.domain + '.' + env.ORIGIN + '/account',
return_url: 'https://' + this.ctx.domain + '.' + env.ORIGIN + '/account'
});
return {
accountId,
url
}
}
and here the this.client.accounts block
export class PaymentService {
ctx: BaseContext;
client: Stripe;
constructor(ctx: BaseContext) {
this.ctx = ctx;
this.client = new Stripe(env.STRIPE_API_KEY);
}
here I do the init of the api
the request you shared is for creating a Customer, and your code is for creating a Stripe Account. These are two entirely different objects
yes and I dont sheat
so either its a bug ... or a feature
here stripe dashboard with request and here the requested email
and one both I have a customer and Itry to make a accounts
in your backend, you use client.accounts.create and your error is
Cannot read properties of undefined (reading 'accounts')
It sounds to me like Stripe wasn't initialized / defined before you called it
I suggest that you add additional logs to your code to check when / whether Stripe is initialized, when you call this.client.accounts.create
Perhaps you should revert to your previous code and give it another try? I'm not aware of what changes you made to the code earlier.
I change nothing .... reall
ok I see nodejs is really not good at
const content = await get_custom_database.affiliate.generateOrganization({
domain: payload.domain,
email: payload.email,
firstname: payload.firstname,
lastname: payload.firstname,
name: payload.name,
userId: userId,
roles: rolesPromised,
affiliate_organization: organization,
affiliate: business,
generateBusinessAccount: get_custom_services.payment.generateAccountUrl,// <--
billing_email: '',
customer_account: customerAccount.id
});
I do a function injection and doesnt work at all
so when you add a log line before const accountId = await this.client.accounts.create({ to log this.client - what do you get?