#brandontrytn_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/1219376752317562922
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
elements = stripe.elements({
appearance: {
labels: 'above',
theme: userPrefs !== null && userPrefs.isDarkThemeEnabled ? 'night' : 'none'
},
clientSecret: clientSecret,
locale: window.globalSettings.culture
});
paymentElement = elements.create('payment', {
business: {
name: $('#ShopName').val()
},
defaultValues: {
billingDetails: {
address: {
country: settings.fields.$country.val()
},
name: settings.fields.$name.val()//,
//email: settings.fields.$email.val(),
//phone: settings.fields.$phone.val()
}
},
fields: {
billingDetails: {
address: {
country: 'never'
}
}
},
wallets: {
applePay: 'never',
googlePay: 'never'
}
});
paymentElement.mount('#payment-element');
Just making sure I understand this, these are two different Stripe elements pages that you are creating payment intents for and confirming basically the same way?
2 different pages yes, one we are fine supporting link on, the other we do not wish to present link option ever
the different sites are powered by the same api to create the payment intents
One thing I can think of is payment method configurations. You could have one PMC with link enabled and one PMC with it disabled and then just pass in the correct config when creating your payment intents https://docs.stripe.com/api/payment_method_configurations/object#payment_method_configuration_object-link
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is there a way to exclude a specific method but allow the others without having to specify all of them but the one?
Unfortunately not, as far as I am aware.
currently we utilize automatic payment methods because we don't want to have to specify every payment method
This is an extension of automatic payment methods. It just lets you have multiple automatic payment method configurations.
what api version is this available in? I do not see "available" link option in the list of paymentintentpaymentmethodoptions
createOptions.PaymentMethodOptions = new PaymentIntentPaymentMethodOptions
{
Link = new PaymentIntentPaymentMethodOptionsLink
{
Available = false
}
};
Which client library is that? I can check the changelog
using Stripe.net v43.17.0
Ah, you are trying to set this on a completely different type of object. It looks like this field never existed on a payment method or payment intent's payment method options property
https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_options-link-capture_method
https://docs.stripe.com/api/payment_methods/create#create_payment_method-link
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
The object that I linked to is a payment method configuration and you pass the configuration's ID to the payment intent when creating the intent
is this configuration something made on the fly? so a call would be made to using this configuration object and the response contains an ID that would be used in the paymentintent create call? or is it created once and persisted?
Created once and persisted, these configurations are meant to be reused
given we service connect accounts would this need to be created once for the platform, once per platform environment (live/test) or once per connected account?
If you are using direct charges (payment intents created directly on each account), you would need configurations on each account. If the payment intents are created on your platform account, you only need to define this once on your platform account
they are direct on each account, we only collect an application fee.
so seems like I would need a call to check for a configuration each time and name it such that I could filter down to this specific configuration (only in this instance) and if it does exist use it, if not create it on the fly for the account and then use it
Yep that makes sense to me. Depending on how many connected accounts you have it may make sense to just cache these PMC IDs on your side to avoid the lookup.
Also just to double check, each of your connected accounts will have this back vs front differenitation correct?
yes, each one has both options
we could cache it, yes, that would be no problem at all for us
sometimes someone will pay with link on the front of office side and then the back of office side will edit the record which results in an additional charge. currently we support the additional charge using the saved link payment method on file which is stored on the stripe customer record. will this change impact that at all or will that continue to work?
That would be fine, you would just want to make sure link is an option for that second payment intent. So you would use whichever PMC has link available.
and if we create a payment intent with no options config it will work as it does today?
Correct, by default it uses your account's default correction.
Also potentially good news, I think was wrong before when I said you would have to define this per account. It looks like you should only have to define this once at the account level for direct charge integrations. https://docs.stripe.com/connect/multiple-payment-method-configurations
I will test this right now to confirm how it works. Apologies
oh great, that means I can create this once and just a constant in the code for the ID if that's the case
Yep, looks like you only need the one for your connect configuration on your platform account. Apologies that I was confidently wrong there at first.
The one caveat is that it is a bit weird to get the right ID to use. I had to get the ID from the connect settings page in the dashboard. Via the API you can list configurations while passing the Stripe-Account header for the connected account that you want to use. There will be a configuration with an application property that is your connect application's ID and then a parent_id property that is the pmc_ ID that you can use when creating a payment intent with the payment intents API. https://dashboard.stripe.com/settings/payment_methods/connected_accounts
If you list your configurations via the API, it lists the configuration with its ID on your parent account, which will error out if you pass it along with the Stripe-Account header for the connected account.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Basically, this configuration could have ID pmc_123 on your platform account, but the ID will be pmc_456 on your connected accounts. Listing the configs on your platform returns pmc_123 which will error out if you try to use it on a connected account. But if you list the configs on one of your connected accounts, it will give you the correct pmc_456 ID.
That was a lot of words, does that make sense?
so I create the PMC once for the platform, then make the call at the connected account level to request the list of PMCs in order to get the ID as the ID will be unique to each connect account?
*ignoring the caching layer
The connected account ID wil actually be the same across your connected accounts. Our dashboard shows that ID, but for some reason our API doesn't return it for API calls from your platform at the moment. I will flag that we should add that to make things easier for direct charge situations.
ok so if I use what's located in the dashboard after I create it I can use that pmc_ across all connected accounts?
Exactly
ok sounds good, I like not having to make the calls every time, will create a new pmc to exclude link and pass that static id in my code for all new payment intents created using this back of office channel. will test that and if I run into unexpected results will revert back here
Yep sounds good to me. Glad we could find a solution here