#nielsen_paymentlink-customdomain
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/1438931056614179018
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, can you share the request you're making? When you say 'it does not work', what does this mean exactly? Can you share more please?
so we created a custom domain in the Stripe Dashboard so that, when payment links are created, they are created with that custom domain. If i generate a payment link from the Stripe Dashboard it does indeed use the custom domain. But when generating payment links using the Java SDK, it uses buy.stripe.com
// 1. Create a Price with custom_unit_amount enabled
PriceCreateParams priceParams = PriceCreateParams.builder()
.setCurrency("usd")
.setProductData(
PriceCreateParams.ProductData.builder()
.setName("Min Balance")
.build()
)
.setUnitAmount(0L)
.build();
Price price = Price.create(priceParams);
// 2. Create a Payment Link with the custom price
PaymentLinkCreateParams linkParams = PaymentLinkCreateParams.builder()
.addLineItem(
PaymentLinkCreateParams.LineItem.builder()
.setPrice(price.getId())
.setQuantity(1L)
.build()
)
.setSubmitType(PaymentLinkCreateParams.SubmitType.PAY)
.setOnBehalfOf("acct_1Pj61wIGqClPX8Ho")
.setTransferData(PaymentLinkCreateParams.TransferData.builder()
.setDestination("acct_1Pj61wIGqClPX8Ho")
.build())
.addPaymentMethodType(PaymentLinkCreateParams.PaymentMethodType.US_BANK_ACCOUNT)
.addPaymentMethodType(PaymentLinkCreateParams.PaymentMethodType.CARD)
.setPaymentIntentData(PaymentLinkCreateParams.PaymentIntentData.builder()
.putMetadata("payorId", "123")
.build())
.putMetadata("yay", "yay")
.build();
PaymentLink paymentLink = PaymentLink.create(linkParams);
System.out.println("Payment link created successfully!");
System.out.println(paymentLink);
System.out.println("URL: " + paymentLink.getUrl());
Can you share the example request to create the payment link where you expect the custom domain please?
req_ZGQRGHYHucwspj
It looks like you're creating the request on behalf of the Connected Account: https://dashboard.stripe.com/acct_1PbOWAIv5qZ8Xj8O/test/logs/req_ZGQRGHYHucwspj
Can you share the request that you made via the Dashboard?
If you omit the on_behalf_of: "acct_1Pj61wIGqClPX8Ho", does it work as expected?
req_VVXrL5KYutD1oS
Removing the onbehalfof does give me the right custome domain
does that mean we have to configure a custome domain for each connected account?
Ok I see, I will do that then. Last question, when creating payment link, do we have the option to show the email that is in Stripe for a specific Customer?
๐ Hi, pgskc has to head out so i'll be taking over the thread ๐
You can append this to the end of the payment link and the customer email field will be prefilled
This example is for customer@example.com %40 is the url-encoded of the @ symbol
?prefilled_email=customer%40example.com
If you want the pre-filled email to be non-editable
?locked_prefilled_email=customer%40example.com
Is that email supposed to be associated with the payment method? or can it be any email?
Payment Methods don't have email address associated to them directly generally.
A Customer object will have an associated email address, and that customer may have Payment Methods attached, but there is no email address assocaited to the Payment Method directly.
What does this email address field accomplish then?
What customer the transaction is associated with.
Will it create a new customer with that email address? or will it attempt to find one? I think some of our customers don't have email addresses.
https://docs.stripe.com/api/payment-link/create#create_payment_link-customer_creation
You can specify for it to create a customer always, or only if required (subscriptions for example require it)
Email address is required though.
Ok, so when the email is supplied, if it doesn't find a customer associated with that email what will it do?
or if it finds multiple customers with the same email?
if you for example specify if_required and it's a situation that doesn't require a customer to be created (one time payment for example) it will use a guest customer object
Right now I'm not specifying any of the options. I don't see in the docs what i the default behaviour
Ok got it. That's the behaviour we want. It was requested of me to show the email of the customer, however I wasn't sure what that would actually do. So in our case, since we have "if required" on by default, putting the customer's email there wouldn't really do anything?
It will make a guest customer object with that email associated so you can identify who the payment came from, that guest customer however doesn't keep any payment method information stored on it. It's essentially just a way to track the transaction.
Ok and one hopefully last thing. I'm trying to use test mode for the links, is it possible to do this with connected accounts and custom domains? The connected account in our production environment doesn't exist in test mode.
I'd suggest onboarding a test connected account to your test platform.
I believe technically you can onboard, a live account to your test account, but it's very much not recommended, lots of issues with this. it won't show up in your list of connected accounts, on the test mode dashboard for example.
and an account connected already to you live mode won't have any connection to your account in test mode by default
We do have test accounts we can use and when I tried to use the custome domain it says it's already being used
Where are you seeing this? Where are you trying to set the custom domain?
So in test mode, I tried to add the same custom domain as in production mode.
I guess we should have a separate domain for test mode?
I believe your test mode and live mode share the same custom domains.
at least when I toggle out of test mode and back to live mode I see the same exact domains registered on my account.
Just to back up, you are trying to setup these domains on the connected accounts correct?
not the platform?
based on your original question.
Yes, connected accounts
It seems to work for the platfom account like you said. Prod and test mode use the same custome domain there
how are you setting the domain on the CA?
I go to view dashboard as this account
from there I go to Business and Custom Domains
do you have the account id for the CA you are trying to set it on?
the test one right?
yes,
acct_1PgvZNRPHgC7qKjm
nielsen_paymentlink-customdomain
Do you have an example PaymentLink I can look at instead?
well right now, we don't have a custom domain setup for a connected account in test mode. I want to use the same custome domain I have in a prod connected account with a test mode connected account
hum
My gut: we don't want any Connect platforms to do this by hand and it's just "luck" it works
What are you really trying to build? Are you using Standard accounts? If so they should configure the domain, not you
amazing
So if you are a Connect platform with Custom accounts you absolutely should not do any of this on connected accounts at all.
Everything should be done on your own platform account instead
It seems to do that on it's own once we include the onbehalfOf parameter
that seems to be the way we need to do it so that the branding for the payment link is included
per each connect account
Hmmmm i see so you are doing everything on the platform but you are saying that you still seem to have to configure the domain at each individual connected account level for the custom domain to work? But you want the same domain for all connected accounts?
yes
no each connect account should have it's own domain. We originally thought we should use one custom domain for the platform account. And have CNAME records for each connect account on our side
But that didn't work once we saw that creating payment links using onbehalfof, forces the connect accounts domain
no worries
Do you want the exact same domain
or do you want a different domain?
we for sure want different domains for each connect account.
I'm fairly confident this makes no sense feature wise for Connect + Custom. Like what if you have 10k connected accounts. Managing this by hand in the Dashboard just feels ridiculously painful to me
But yeah I don't have the answer for this since it's mostly a Dashboard question. I recommend moving to our support team for 1:1 support directly and guidance on how to handle this.
Ok, so you think it's better to have the one custom domain in the platform account. And then we use CNAME records to put to the custome domain?
Not really. Basically we (Stripe) decided to use the connected account's domain with OBO. But that makes absolutely no sense (well to me at least) since there's no API for it.
I assume you are using Custom accounts on purpose/by design? Because conceptually Standard accounts + letting each individual business decide to configure this and pay for it or not would make more sense
Ok and to confirm, using the onBehalfOf parameter when creating payment links, and having that payment link page use the connect account's branding and custom domain (or default) is expected behavior?
Yes apparently, it's in the docs here: https://docs.stripe.com/payments/checkout/custom-domains?payment-ui=stripe-hosted#connect
I just am baffled why we made that decision ๐ (and I'm now complaining about it internally ๐)
So I think you're doing exactly what is expected. It just wasn't expected by me and makes limited sense to me ๐
Ok I understand. That helps at least to know. Now I can see how we should handle it
I just don't see a world where we'll add an API for this anytime soon though.
So let's go back to your real ask: it worked fine for you in Live mode but you had a problem in Test mode?
Yea I was just hoping to do testing in our staging environments. Where we create payment links and see the custom domain there. But it won't let us use the same custom domain from the live connect account in a separate test connect account
But it won't let us use the same custom domain from the live connect account in a separate test connect account
that's the part I'm hung up on.
Do you have an example connected account where you configured a custom domain and it works in Live mode already?
Yes, it's still in the process of adding the domain but it's this one.acct_1Phv8kIx7St4tW9N
okay but then it doesn't work yet right? Like if you create a PaymentLink in Live mode for them does it use that domain already?
Not yet it seems. I tried creating a link using the test mode API key and I still the see the default. plink_1STS6VIv5qZ8Xj8Ox05ZysjG
somehow that doesn't throw an error because that account doesn't exist in test mode
yeah that's normal, you have access to Live and Test mode for all your connected accounts
How come it doesn't actually show up in the connected accounts list in test mode?
for reasons I won't get into :p
My "gut" is that once the domain is approved in Live mode for that connected account, it will work just fine in Test mode too. But it has to be approved first so you have to wait for that step to complete
Ok, I can wait and see, if it doesn't work should contact devs here? or is this something that would need to go through support like you mentioned earlier?
Coming back here is fine I think though most of us don't know much about Dashboard flows. But it "should work" so yeah come back if you have a clear example where for the same connected account your PaymentLink in Live mode works with the custom domain and the Test mode one doesn't (and share exact PaymentLink ids plink_123)
Ok will do. Thank you
sure, sorry for the long back and forth but hopefully it just works in a few days ๐
I'll keep pushing internally on a better solution for Connect platforms but that's likely years away for an API for custom domains sadly (because of the CNAME and all the config, it's not an easy stateful API)
Have a great day