#uhoh-error

1 messages · Page 1 of 1 (latest)

ionic flume
#

Can you log exactly what you are sending in that call? Because the error makes it look like you aren't sending what you think you are at least

flint smelt
#
        amount,
        currency: 'cad',
        customerId,
        payment_method: paymentMethodId,
        confirm: true,
      };```
#

and stripeAccount is the accountId

ionic flume
#

sure but right now it's all abstract/theoretical. Please log exactly what you are passing and share the exact output of that

flint smelt
#
amount: 500,
currency: 'cad',
customer: 'cus_MIaKvObCIOrAyc',
payment_method: 'pm_1LZzA6IAShFZhsKWzoiy38KP',
confirm: true,
}```
#

"error":{"message":{"message":"Stripe: Unknown arguments ([object Object]). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to POST `/payment_intents`)"

ionic flume
#

That's still far from what I asked 😅

#

what is in the second parameter exactly?

#

Can you give me exact end to end code to reproduce your exact issue?

flint smelt
#
      const { stripe_account: stripeAccount } = await getStripeAccount(['stripe_account]); // this returns an connect account id, or null if none is found
      const paymentIntentDetails = {
          amount: 500,
          currency: 'cad',
          customer: 'cus_MIaKvObCIOrAyc',
          payment_method: 'pm_1LZzA6IAShFZhsKWzoiy38KP',
          confirm: true,
          }
      paymentIntent = await stripe.paymentIntents.create(
        paymentIntentDetails,
        stripeAccount ? { stripeAccount } : {},
      );
#

I'm not sure what else to provide

ionic flume
#

Take a step back from your error, and try to write a clear code that I can simply copy-paste to reproduce your problem

#
(node:54150) UnhandledPromiseRejectionWarning: ReferenceError: getStripeAccount is not defined
    at /Users/remi/Workspace/stripe-node-examples/reproduce_error.js:4:45
    at Object.<anonymous> (/Users/remi/Workspace/stripe-node```
Like what exactly is that function, can you share that?
flint smelt
#
         const paymentIntentDetails = {
          amount: 500,
          currency: 'cad',
          customer: 'cus_MIaKvObCIOrAyc',
          payment_method: 'pm_1LZzA6IAShFZhsKWzoiy38KP',
          confirm: true,
          }
      paymentIntent = await stripe.paymentIntents.create(
        paymentIntentDetails,
        stripeAccount ? { stripeAccount } : {},
      );```
#

Here

ionic flume
#

thanks! trying

#
    paymentIntentDetails,
    {},
  );``` okay so really your question boils down to "why does this error" right?
flint smelt
#

yes

#

sorry I made it that complicated haha

ionic flume
#

Sorry I had no clue that's what you were asking but I also thought it just worked

#

So looks like you just can't pass {} but null works so you want stripeAccount ? { stripeAccount } : null,

flint smelt
#

Thank you!!

#

sorry for the confusion earlier