#nerder_error

1 messages ¡ Page 1 of 1 (latest)

stark badgerBOT
#

👋 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/1308386517550370867

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

hollow sigil
#

hi! we don't really directly support Flutter but I can try to help a bit. What is this exact "invalid token id" error, what's the exact code/API call that returns an error?

thorny blaze
#

this is the req_vZ9GHTcf8pmaik

#

the code is a 400

#

Invalid token id: tok_1QMp80HTyY8xD8aG7ZEjxD5g

#

please consider this, i'm using Connect here

hollow sigil
#

yeah it's becaue you're using Connect to process the payment on a connected account, but the Google Pay token was created on your platform, not the connected account.

thorny blaze
#

Ah!

#

that is what I was suspecting

hollow sigil
#

if you use our official libraries they should create it on the right account based on the params you pass, I don't know what your Flutter library does. If you have some code I can look at that creates the token I might be able to suggest something.

thorny blaze
#

i'm using flutter_stripe which is indeed the offically supported library

#

which is using the native IOS/Android libraries

hollow sigil
#

there is no officially supported library for flutter (Stripe only supports Android/iOS/React Native), it's a third party

thorny blaze
#

yes, you are right but let's say it's the "Stripe Sponsored" one

#

but anyway

hollow sigil
#

yes I know all that

thorny blaze
#

let me show you some code to understand better

hollow sigil
#

that'd be great

thorny blaze
#

Ok i think i understand!

#

Consider that i'm using pay to add supporto for Google Pay and Apple Pay which under the hood is using the native libraries for each platforms

#

and in order to work you need to pass down a configuration in json

#

something like this

#
{
  "provider": "google_pay",
  "data": {
    "environment": "TEST",
    "apiVersion": 2,
    "apiVersionMinor": 0,
    "allowedPaymentMethods": [
      {
        "type": "CARD",
        "tokenizationSpecification": {
          "type": "PAYMENT_GATEWAY",
          "parameters": {
            "gateway": "stripe",
            "stripe:version": "2022-11-15",
            "stripe:publishableKey": "pk_test_xxx"
          }
        },
        "parameters": {
          "allowedCardNetworks": [
            "VISA",
            "MASTERCARD",
            "AMEX"
          ],
          "allowedAuthMethods": [
            "PAN_ONLY",
            "CRYPTOGRAM_3DS"
          ],
          "billingAddressRequired": true,
          "billingAddressParameters": {
            "format": "FULL",
            "phoneNumberRequired": true
          }
        }
      }
    ],
    "merchantInfo": {},
    "transactionInfo": {}
  }
}
hollow sigil
#

stripe:publishableKey needs to be "$platform_key/$connected_account_id", as you can see in the source code of stripe-android

thorny blaze
#

so probably to fix it i should append /acct_xx at the end?

#

let me try that real quick

#

Ok!

#

now the error is different but I think I can manage it

#

actually the payment even went trough

#

now another quick question, I see that the PI has been completed but the payment method has not been saved

hollow sigil
#

did you pass setup_future_usage and a customer object when creating the PaymentIntent?

thorny blaze
#

actually no

#

Ok so that will be one possible thing

#

but usually for cards what i do is that i create them on my platform first and then clone the card in the connected account

#

this is useful as I can enable 1-click purchase across the entire markeplace

#

while for Google Pay/Apple Pay this might not be as important as at the end their customer experience is almost one click already

#

I'd love to keep the same behaviour, should i send the token ID to my backend and handle the payment method creation myself there?

hollow sigil
#

technically yes you can do the same thing and clone them (in which case you do not want to apply the change we were talking about earlier)

#

which technically sort of isn't needed, but it's proabably easiest/best to do it since then you can slot into your presumably-existing code that clones PaymentMethods

thorny blaze
#

Yes exactly, It will stay more "consistent" and with Google Pay/Apple Pay we'll improve the overall first purchase experience

#

from there either reusuing our 1-click purchase or a wallet will be practically identical

#

probably i'll be creating a new payment method all the time they use Apple Pay/Google Pay

#

but still

hollow sigil
#

I believe that's normal enough when using those wallets yep

thorny blaze
#

Ok, last question and i'm done

#

If i don't remember incorrectly

#

when you pay with Apple/Google pay in checkout the payment method attached to the customer is with the correct logo of Apple/Google

#

but i'm my case it will just appear as a normal card?

#

or since i'm creating the pm with the token the dashboard will be able to understand it?

#

it's mostly for stats

hollow sigil
#

hard to say without knowing exactly what surface/component etc you're seeing this logo in but the PM does store the fact that it came from a wallet so I'd imagine it works the same

thorny blaze
#

ok this sounds amazing

#

so i'll be able to show back in my app and the stripe dashboard instead will display this correctly from the get go

#

amazing, all is clear now

#

thank you so much @hollow sigil you are the king

hollow sigil
#

happy to help