#reja_code

1 messages ยท Page 1 of 1 (latest)

vernal wedgeBOT
#

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

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

topaz shuttle
#

protected function createSetupIntent($customer_id): SetupIntent
{
try
{
return $this->getStripeClient()->setupIntents->create(
[
'customer' => $customer_id,
]
);
}
catch (Exception $e)
{
$this->throwStripeException($e->getMessage());
}
}

vernal wedgeBOT
vital whaleBOT
pulsar raptor
#

Hi there ๐Ÿ‘‹ if you want to avoid showing those payment method types in the Payment Element you'll need to do one of three things.

  1. Turn off the payment method completely in the Payment Method configuration that you showed a screenshot of. Disabling recurring payments doesn't disable the payment method type for use with dynamic payment methods.
  2. Create a new Payment Method Configuration to use with your flow that is limited to the payment method types you want to offer.
  3. Manually specify the desired payment method types by using payment_method_types when creating the Setup Intent: https://docs.stripe.com/api/setup_intents/create#create_setup_intent-payment_method_types
topaz shuttle
#

will try option 2, tried payment_method_types but it doenst not make a difference

#

{

#

or am i doing something wrong

pulsar raptor
#

You may need to do more on the frontend depending on exactly what flow you're using. Are you creating the Payment Element before you create your Setup Intent?

topaz shuttle
#

option 1 is not possible because we want the methods for invoice mailing

#

talked to frontend developer

const options = {
'mode': 'setup',
'currency': 'eur',
'setup_future_usage': 'off_session',
'appearance': appearance,
};

            const elements = stripe.elements(options);

            const paymentElement = elements.create(
                'payment',
                {
                    paymentMethodOrder: ['sepa_debit', 'card'],
                    fields: {
                        billingDetails: {
                            name: 'never',
                            email: 'never',
                            phone: 'never',
                        },
                    },
                }
            );

            paymentElement.mount('#payment-element');
#

looks likes he created the element first