#matih_code
1 messages · Page 1 of 1 (latest)
👋 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/1422275560247132283
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
# python
is_parent = customer.buyer.is_parent
is_swish = False
if (
self.company.country.code == settings.SWEDEN_COUNTRY_KEY
and self.company.currency_code == Company.Currencies.SEK
):
is_swish = True
payment_method_types.append("swish")
checkout_kwargs = {
"customer": customer.stripe_id, # 'cus_T932HelOJ4y0Zu'
"line_items": line_items,
"mode": "payment",
"payment_method_types": payment_method_types, # ['card', 'swish']
"cancel_url": f"{self.location.get_full_url()}?cancelled=1",
"success_url": f"{settings.ROOT_URL}{success_url}",
"automatic_tax": {
"enabled": True,
"liability": {
"type": "self",
},
},
"client_reference_id": str(self.receipt_id),
"allow_promotion_codes": True,
"payment_intent_data": {
"application_fee_amount": self.get_application_fee(), # 4000
},
"stripe_account": self.company.stripe_id,
}
if is_swish and is_parent:
checkout_kwargs |= {
"payment_method_data": {
"billing_details": {
"phone": customer.buyer.full_telephone, # '+46737859110'
}
}
}
stripe.api_key = settings.STRIPE_SECRET_KEY
session = stripe.checkout.Session.create(**checkout_kwargs)
When I run this, I get error:
'Received unknown parameter: payment_method_data[billing_details]'
Hi there, I'll be with you shortly. I'm working on other threads.
This is the message (translated from Swedish to English so that you can understand) your customer experience shared with us:
Thank you for contacting us regarding the issue with Swish payment requests for children under 16. We understand your concern and would like to help resolve this issue.
To fix the problem of sending a Swish payment request to a parent's phone number, please try the following configuration:
- When configuring the payment, set payment_method_options[swish][authorization_method] to swish_app.
- Enter the parent's phone number in the payment_method_data[billing_details][phone] field. This setting should ensure that the payment request is sent to the parent's Swish app for authorization, instead of displaying a payment window in the current view.
Can you help us investigate this issue further with our internal team?
- Send us screenshots of the current behavior you are experiencing (the payment window appears in the view).
- Send a screenshot of your current Swish payment configuration settings.
- If possible, share a cleaned code snippet of how you currently initiate Swish payment requests.
You can find more information about Swish Payments here (https://docs.stripe.com/payments/swish/accept-a-payment). With this additional information, we will be able to conduct a more thorough investigation and provide you with a more tailored solution if needed.
I don't want to come off as rude, but the text reads like AI-generated slop.
authorization_methoddoesn't exist as a valid key underpayment_method_options[swish]https://docs.stripe.com/api/checkout/sessions/create?lang=python&api-version=2025-08-27.basil#create_checkout_session-payment_method_options- when I set
payment_method_data[billing_details][phone]i receive the API error:'Received unknown parameter: payment_method_data[billing_details]'
@fallen sorrel if this isn't your purview, please invite one of your colleagues to this channel
Taking a look, Swish appears to be in beta. I'm assuming you're in the beta?
yes. the platform has been accepted into the beta, and the connected accounts are accepted.
i'm currently trying to make this work in our sandbox
however, considering that the AI-generated text is of zero help, are you able to give me some insight?
what we're attempting to do is that when we create the checkout, we want to attach which phone number the swish-payment request should be sent to
We're not familiar with Swish, can you check the email thread from when you were accepted into the beta? Is there a contact email address in there?
i'm reading your docs here: https://docs.stripe.com/payments/swish/accept-a-payment?web-or-mobile=web&payment-ui=stripe-hosted#direct-api-test-integration
what i currently see is that only the phone which has initiated the payment process will have the swish app opened
Typically there should be a contact email that you can reach out directly to.
yes, we did but we got the ai-generated reply back
so, you have no other help to share?
What was the email address provided? Was it support@stripe.com?
we started the conversation there, yes
the CEO has held the conversation and share the responses with me
Luis from Stripe Support
Gotcha, let me see if there's a dedicated e-mail for this beta.
Any luck?
Hi, taking over as my teammate needs to step away. There is not that parameter when creating a CheckoutSessions: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_method_data
You can collect the phone number from the customer on on your Checkout, https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-phone_number_collection-enabled
Ok, I misunderstood what you've asked here. Specifically, you're asking about https://docs.stripe.com/payments/swish/accept-a-payment?web-or-mobile=web&payment-ui=direct-api#alternative-authorization-method
Given that is a private feature, you sould want to talk to support.
@woeful wharf I'm speaking directly with team. Can you provide me with the account IDs?
@woeful wharf better yet, I'm going to trigger a flow that will have our bot send you a DM to create a support ticket that will come right to our team if you have not reached out to support yet.
Hello @woeful wharf, we have sent you a direct message, please check it at https://discord.com/channels/@me/1422607492508024932
- 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.