#gennesisomega_api

1 messages ยท Page 1 of 1 (latest)

gritty micaBOT
#

๐Ÿ‘‹ 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.

misty quest
#

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).

gaunt epochBOT
misty quest
#

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.

oblique wharf
misty quest
#

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',
});

gaunt epochBOT
misty quest
#

is there an attribute for the account ID?

#

Again, the domains I need to create new payment method domains for are connected accounts.

maiden urchin
#

๐Ÿ‘‹ stepping in

misty quest
#

Oh sweet!

maiden urchin
#

Basically you add an options object with stripeAccount: 'acct_123' in node

oblique wharf
misty quest
#

Awesome! Thanks yall! Can I respond in this thread if I have any further questions while I go through this?

maiden urchin
#

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

misty quest
#

Oh okay awesome. Thanks again! This is a great starting point for me. Doesn't help I'm new to node in general.