#pawe_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/1304419249573593128
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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 });
}
});
});
Can you share the ID (req_xxx) of the API request that errors? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_7hztOxdopc7Akl
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?
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
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
BLIK just isn't conducive to a non-Elements integration unfortunately: https://docs.stripe.com/payments/blik/accept-a-payment