#nickdnk_api

1 messages ยท Page 1 of 1 (latest)

eager lilyBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

vague saffron
#

There also seems to be no clear way to map capabilities to payment methods, as things like card map to card_payments (PMC vs. capability), if I were to use the capabilities API.

glossy hazel
#

hello! looking now

#

looking at the API ref and it seems to say what i also remember being true, which is

[payment method].display_preference.value shows you whether that payment method is "on" for that PMC
https://docs.stripe.com/api/payment_method_configurations/object#payment_method_configuration_object-affirm-display_preference-value

[payment method].available shows you if that payment method will actually be shown after taking capabilities into account
https://docs.stripe.com/api/payment_method_configurations/object#payment_method_configuration_object-affirm-available

so the short version is available should be the source of truth as to whether or not something can currently be shown

vague saffron
#

Okay, so I need to first update the PMC on Stripe, then read the .availabe property again after setting display_preference

#

I would suggest adding "eligible": bool to this API, so it's clear whether the account is even capable of using the payment method or not. It would also mean I could just skip those payment methods entirely when I read from Stripe's API. RIght now I have to "whitelist" the array of payment methods to those I know our accounts are capable of using, based on region/currency etc.

#

It adds a lot of manual overhead and mainteance for something stripe should be perfectly capable of maintaining

#

Unless this API only returns payment methods the account can use?

glossy hazel
#

sorry for the delay, juggling a few things atm

vague saffron
#

np

glossy hazel
#

looking at your most recent questions now

#

Unless this API only returns payment methods the account can use
i just ran some quick tests to see if it returns different values for merchant accounts based in different countries and it looks like it does, although i have to admit i'm not 100% sure what the precise logic is there

vague saffron
#

Okay, so if a capability is "not requested", which (as I understand) it will be (?) if I set the display_preference to on? Or do I also have to know exactly what capabiliy to request for the account and then request it?

#

MobilePay, for instance

#

Sorry let me reword that

#

If I set the display preference to on for something that does not yet have capability, but it actually is capable, just not "requested" - does it automatically request it?

glossy hazel
#

capabilities are distinct from display preferences - i think the dashboard does some magic to automatically request the capabilities in some circumstances, but i am pretty sure if you just update the PMC directly via the API you still need to request the underlying capability separately

#

let me double check that though

vague saffron
#

So that brings me to: How do I know which capability is required for each payment method?

#

If I knew, I could request from both endpoints and compare them to know what to do

glossy hazel
#

sorry for the slow response - been doing some research

vague saffron
#

no worries

glossy hazel
#

i don't think there's a super easy way to map capabilities to payment method types unfortunately, it looks like the [payment method].available property was actually added semi-recently (in geological time) to address that very problem of making it easier to tell which payment methods are available

#

but that doesn't necessarily make your life easier since you're trying to request capabilities for people

eager lilyBOT
vague saffron
#

Yea but you've mixed preference into available, which makes the property pretty hard to meaningfully use

vague saffron
#

"I want to use" should be a separate boolean from "can I use" - "can I use" is what I need to know

#

Am I correct in understanding that I have to then update the PMC, read back the new, presumably updated .available state and use that to determine if available?

glossy hazel
vague saffron
#

This needs some rethinking on your end I think ๐Ÿ˜„

#

but I'll work with that for now then

#

I will try and do some manual "if user requests payment method X, ensure capability is requested for it"

#

There should be an exhaustive list of capabilities and what they are required for

glossy hazel
vague saffron
#

Ah yea

#

So I am assuming that capabilities on the account only returns capabilities that can be enabled?

fierce dagger
#

Not sure off the top of my head but a way to test would be to create a connected account in a country that a given payment method isn't ellgible for and then see if the capability is present on the account or if it is present/unrequested

#

Taking over for solanum, here, by the way

vague saffron
#

I'm guesisng I should not see things like india_international_payments on a UK account

#

(then)

#

or us_bank_transfer_payments on a non-US account

#

For what I need now, I can work with this list and manually select the payment merthods and capabilities I want to manage on our end