#mkoenke
1 messages ยท Page 1 of 1 (latest)
Hi ๐
You need to specify a domain that you have control over so you can host the domain association file. We explain this here:
https://stripe.com/docs/stripe-js/elements/payment-request-button?client=html#verifying-your-domain-with-apple-pay
yes! We are hosting and serving the domain association file. On our platform we host many different sites, so we want to set it up so that when a site chooses their subdomain, we can make the call to stripe, and register the subdomain with apple programmatically. The problem is, when we try to do this locally or in a test environment, it appears to work because we get a successful response, but it is not reflected in the dashboard as actually registered, even when the stripe dashboard is in test mode.
Example response we get in test environment: #<Stripe::ApplePayDomain:0x4734c id=apwc_0NDUZFUmS57H7yUMTFzjIEK6> JSON: {
"id": "apwc_0NDUZFUmS57H7yUMTFzjIEK6",
"object": "apple_pay_domain",
"created": 1685460877,
"domain_name": "vhx.vhxqa4.com",
"livemode": false
}
Okay I can see that registration as well
so the one that is on the dashboard, I added manually
and I see a number of test Apple Pay domains associated with your account
where can I see them?
when i switch over to test mode on the dashboard, nothing changes
yes, those were both added manually. Whenever I do it through the API, I get a successful response, and nothing changes in the dashboard
If I make the call Stripe::ApplePayDomain.create({ domain_name: 'nyytalk.vhxqa4.com', })
I get this response
but nothing actually seems to happen
Hmmm..
The ID does show up as an object I can inspect and it is associated with your account
where can you see that?
It's an admin tool.
ahh ok
Wait, can you share the ID in the response, not just the screenshot?
apwc_0NEasOUmS57H7yUMKaOMDQr2
The one I looked up was related to one of the URLS that I see in your dashboard anyway
Okay I'm seeing that one too, created 37 minutes ago
interesting, but I can not see it in the dashboard?
Neither can I
Oh wait... ๐คฆ
We only display the LIve ones
Of which you only have 2
Even in Test mode
When I look at the Apple Pay domains for your account (in Admin) I can see this
ok thats good news, so it is working. I'm wondering if there is any way to confirm this on our end... if there is a domain registered that shows as test on your admin tool, will we be able to see apple pay on the payment element? even though we can not see it in our dashboard?
we have some development to do, conditionally adding and removing the domain registrations, and if we can't see it, I am not sure how to confirm our implementation works
๐ hopping in here since snufkin has to head out soon
ok great thanks!
The domains that are only registered in test mode will not show up at all/work with payment element - it's only the livemode registered domains that will work
interesting, will we get the same responses from stripe in test v live? Curioud how we should handle any errors but I can't seem to trigger an error in test. I would except that you wouldnt be able to register a domain repeatedly and get successful responses, but that is the behavior in test
What errors are you specifically talking about? Payment errors?
if something should go wrong with the registration, or if the domain is already registered... I dont know specifically what errors are possible
Ah, so you're specifically worried about domain registration - yeah you should be seeing the same errors in live and test mode
interesting! so you are able to register the same domain more than once, and will always get a successful response?
Yeah I believe there's no issue with registering the same domain twice (but I don't see a reason why you'd want to do that)
we have sites that are able to change their subdomain, or set a custom domain, so they could set it to 'abc' ,change to 'def', and then back to 'abc'... should we be concerned with deleting registrations if the subdomain is no longer in use, or can we register and just leave it?
You can just leave it (although you'd probably want to clean up every once in a while so it doesn't get cluttered)
ok thats good.... thanks for your help... I think the only problem we have is that we won't be able to test the registration until its in production... because we can add the code to register subdomains, but we won't be able to see it on the dashboard, and it actually won't enable apple pay in test, if it was registered in test, right?
You can still test the registration in test mode! Let me clarify - you register the domains in test mode, but you can still use them for testmode payments
Apple pay in test mode will work fine with a registered domain that was registered in livemode
ahh ok, thats great. Are there any common errors we can expect to have to handle when registering a domain? If something goes wrong, we would want to know and retry
There aren't really any errors that would warrant a programmatic retry - usually when you get errors it means something is wrong with your registration file, which is something you'd have to go and fix before retrying again
ahh that makes sense, do you have a sample of what that response would look like so we can notify ourselves to update the file?
I don't have that on hand, but you can just try this out yourself with a domain you know won't work and see what that response looks like