#gennesisomega_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/1230224786924507227
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
So, the context of this is our ecommerce platform registers the domain upon application to our payments processing service powered by Stripe (our merchants undergo underwriting). There was nothing stopping our domains from being registered with capital letters (it just pulls the domain from a database field), so what would happen is people would try to enable Apple Pay in their dashboard, but it would never appear at checkout. The solution is to update the payment method domain to the domain with only lowercase letters. We have about 54 store domains that need to be updated.
I'm automating this by writing a script in node.js to try to loop through a set of domains and account numbers and store the payment method domain ID to then run the update call to the Stripe API, but it doesn't seem possible according to the documentation to retrieve the payment method domain that way, but my script doesn't have each individual payment method domain off hand (these are all connected accounts).
I noticed the cURL version of the API call retrieves the payment method domain object via the account number and domain, but I wasn't able to pull this off with a request via axios.
Hi, what do you mean by 'update the payment method domain'? Our Update a payment method domain, https://docs.stripe.com/api/payment_method_domains/update only allows you to enable or disable it.
when you say 'update' are you asking for looping a create payment method domain, https://docs.stripe.com/api/payment_method_domains/create?
Okay thanks for clarifying that. I should have read the docs closer.
So in that case, yes, a new payment method domain needs to be created for each of the 54 invalid payment method domains we have.
I suppose in that case, the only thing we need is the domain. But how does stripe know which account to associate that domain with? Example: the cURL to create a payment method domain uses the merchant's Stripe account ID as a header.
curl --location 'https://api.stripe.com/v1/payment_method_domains'
-u '<STRIPE_API_KEY>:'
--header 'Stripe-Account: <Merchant Stripe Account ID>'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'domain_name=www.<Merchants Store Domain in lowercase letters>'
This is the call in node
const stripe = require('stripe')('sk_test_nSx2OXTyVrDTeGqgb8qmZCI2');
const paymentMethodDomain = await stripe.paymentMethodDomains.create({
domain_name: 'example.com',
});
is there an attribute for the account ID?
Again, the domains I need to create new payment method domains for are connected accounts.
๐ stepping in
Yeah you can see how to pass the Stripe Account Header in each language here: https://stripe.com/docs/connect/authentication
Oh sweet!
Basically you add an options object with stripeAccount: 'acct_123' in node
I was looking for this document to share with you as well: https://docs.stripe.com/payments/payment-methods/pmd-registration?dashboard-or-api=dashboard#register-your-domain-while-using-connect
Awesome! Thanks yall! Can I respond in this thread if I have any further questions while I go through this?
Yep I'll leave it open for a bit
If it does get closed for inactivity then you can always post again in the main channel
Oh okay awesome. Thanks again! This is a great starting point for me. Doesn't help I'm new to node in general.