#kopi_the_first

1 messages · Page 1 of 1 (latest)

jade swiftBOT
hardy vault
#

I'd suggest following up with our support team.

How can I see if I'm using direct charges,
overall this is something you should know as it's a foundational part of designing your Connect integration. Code wise, you are using Direct Charges if you create PaymentIntents/other objects using the stripeAccount option to process the payments on other accounts.
To use Destination Charges you would use options like transfer_data , and note that it changes the liability for refunds/chargebacks to be on your platform

wheat glade
#

in my backend integration when its marked as a paypal payment, I'm not attaching stripeAccount as the second argument (nodeJS SDK)

  if (usePayPal) {
    metadata = {
      ...metadata,
      transfer_to: stripeConnectId,
      requires_manual_transfer: '1',
    };
    const session = await provider.checkout.sessions.create({
      payment_method_types: ['paypal'],
      mode: 'payment',
      line_items: lineItems,
      payment_intent_data: { metadata },
      metadata,
      expires_at: dayjs().add(31, 'minutes').unix(),
      success_url: checkoutReturnOverWrite
        ? `${checkoutReturnOverWrite}?type=success${isDev ? '&dev=1' : ''}`
        : 'https://www.events.clubkit.app/success',
      cancel_url: checkoutReturnOverWrite ? `${checkoutReturnOverWrite}?type=fail${isDev ? '&dev=1' : ''}` : 'https://www.events.clubkit.app/fail',
    });

    return session;
  }

But what we do is basically just collect the paypal payment ourself and in the success webhook we make a manual transfer to the partner the payments is intended.

#

the issue here is does not matter how I tweak the backend code I keep getting back that "Payment method is not authorized". This is a bit misleading, because on testing environment everything works flawless, and it just got us back just before release 😄

hardy vault
#

ok well from that code presumably you are using separate charges and transfers, where you process that CheckoutSession and then do a call to /v1/transfers later based on your metadata

#

I keep getting back that "Payment method is not authorized".
what does that mean, do you have an example?

wheat glade
#
StripeInvalidRequestError: The payment method type provided: paypal is invalid. Please ensure the provided type is activated in your dashboard (https://dashboard.stripe.com/account/payments/settings) and your account is enabled for any preview features that you are trying to use. See https://stripe.com/docs/payments/payment-methods/integration-options for supported payment method, currency, and country combinations
#

FYI this works in development environment fails only on real payments

hardy vault
#

if you use SC&T for the Paypal payments I suggest pushing back on the support team and explain that you do/show the code/ask to be escalated since they might have you classified wrong or they don't realise you can use Direct Charges in one part of your integration and SC&T in another

hardy vault
#

also share the request ID req_xxx from the error message so I can look

wheat glade
#

thank You. Give me a sec, let me make a new request.

#

req_TCBlHR8R6SkO4Y

#

funny thing is when I check the logs URL, it shows me as a connected account. While it is not a connected account but our main account.

hardy vault
#

well it is a connected account

#

you are passing stripeAccount in your actual code(try searching your codebase for that string) so the code you showed earlier is probably not what is actually running at runtime

wheat glade
#

yes I'm suspecting that the stripeAccount gets into this somehow

#

let me verify it and come back to You, if thats not the case. Thanks for the support already!

#

So I forced an undefined stripeAccountId in our case:

    const session = await provider.checkout.sessions.create(
      {
        payment_method_types: ['paypal'],
        mode: 'payment',
        line_items: lineItems,
        payment_intent_data: { metadata },
        metadata,
        expires_at: dayjs().add(31, 'minutes').unix(),
        success_url: checkoutReturnOverWrite
          ? `${checkoutReturnOverWrite}?type=success${isDev ? '&dev=1' : ''}`
          : 'https://www.events.clubkit.app/success',
        cancel_url: checkoutReturnOverWrite ? `${checkoutReturnOverWrite}?type=fail${isDev ? '&dev=1' : ''}` : 'https://www.events.clubkit.app/fail',
      },
      { stripeAccount: undefined },
    );

Now I can see from the error log that its NOT a connected account. Request ID:
req_zK8QbfNOEKoowk

#

yet I'm getting the same error message, that the payment type is not authorized

hardy vault
wheat glade
#

yepp. So just to sum it up, I gotta push back to support. I think when I was setting up connect, I had to fill some usage related questions and probably we classified our business wrong and thats why its disabled.

#

do You know if those things can be changed through API or only through support ?

hardy vault
#

only through support

wheat glade
#

alright man, thanks for the help!

#

⭐ ⭐ ⭐ ⭐ ⭐ support, have a nice day!