#pawe_code

1 messages ยท Page 1 of 1 (latest)

crude roseBOT
#

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

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

junior edge
#

so i have attemted to do this then but i get other error that blik method does not exist
exports.createBLIKPaymentIntent = functions.https.onRequest((req, res) => {
cors(req, res, async () => {
try {
const paymentIntent = await stripe.paymentIntents.create({
amount: req.body.amount, // e.g., 1999 for $19.99
currency: 'pln',
payment_method_types: ['blik'],
payment_method: 'blik',
confirm: true
});
res.status(200).send({ clientSecret: paymentIntent.client_secret, ID:paymentIntent.id });
} catch (error) {
res.status(500).send({ error: error.message });
}
});
});

stoic oriole
junior edge
#

req_7hztOxdopc7Akl

stoic oriole
#

Checking

#

Hmm, indeed that error seems strange considering it is a confirmation call you're making. But looking at the call there is payment_method sent on the intent so confirmation will fail

#

Why are you trying to confirm server-side and not using the Payment Element?

junior edge
#

because stripe api for flutter web does not support blik

#

i have to write it myself

stoic oriole
#

OK, I think you need to add confirm: true do you creation call and then your code should work. You'll get a URL in the next_action hash in the confirmation response you can redirect users to

junior edge
#

when i add confirm true i get other error

#

no payment method blik

stoic oriole
#

Hmmm, I don't think there's a way around this unless you've already created a BLIK pm_xxx

#

Can you try the /confirm call again but omit the parameter code?

#

Alternatively, you're going to need to build a non-native flow for BLIK payments in a web page or something

#

It's a chicken and egg scenario โ€“ you can't set confirm: true on creation as you need to also pass payment_method (which you don't have at this point) and you can't call /confirm as you also need to pass payment_method