#Vladislav Marinov
1 messages · Page 1 of 1 (latest)
My first problem is that I get only this Ideal UI even though I have enabled cards as well (see photo).
Can you share the ID of a Payment Intent where this is an issue?pi_xxx
Secondly, if Ideal is chosen can I just open the window in another window and execute code on payment successs as it would be with the card payment.
Can you elaborate more on what exactly you mean here?
so on the UI
i have this
<Elements stripe={stripePromise} options={options}>
<CheckoutForm />
</Elements>
and the checkoutForm is
<form id="payment-form" onSubmit={handleSubmit}>
<PaymentElement />
<button
type="submit"
disabled={isProcessing || !stripe || !elements}
className="rn-button-style--2 btn-solid mt--40"
>
{isProcessing ? "Processing..." : "Pay now"}
</button>
</form>
the pk and the sc load fine
the paymentelement is rendering only Ideal payment and no other ones
Yep, I need the pi_xxx ID or the client_secret of the payment that only shows iDEAL
i will give you the client secret in test mode
No, that's your API key. I need the client_secret you pass to the <Elements> component
pi_foo_secret_bar
something like that
Let's see
might be a problem on my stripe account but a lot of methods are allowed there
it just doesnt make sense to me not to have the UI with more payment options than just IDEal
I suspect because you created the payment for €0,01: https://dashboard.stripe.com/test/logs/req_QjdSeQ6uIaLmVq
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You need to pass amount: 100 for €1,00. Card payments have a minimum charge amount: https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts
o wait so 1 measn 0.01
I assumed I needed to put a decimal
yeah that worked
thank you
one more question!
its more like an advice
Yep, the amount is in the smallest currency unit (i.e. cents for €)
So I am building a MERN app and when someone pays I want to execute a POST request that takes body and does things on the backend! If someone pays with Ideal they will probably get redirected and I cannot execute the code in the success page (one that I need to be sure that they will not close it, and second that I will lose the inputs for the request body on page refresh)
is there a way if someone pays with Ideal not to get redirected but rather a second window to open, finish the payment and then the original page to see the payment outcome and execute code
Our recommendation is to use webhooks for async actions/fulfilment like this rather than relying on redirects to success URLs: https://stripe.com/docs/payments/handling-payment-events
yeah, I have tried this but still, I cannot put body from my side to such request
it's good method for requests without body from the frontend
The issue with using your approach of making the POST request from a success page is there is no guarantee your customer(s) ever make it to that page. They could pay, and then immediately close the window, there may be technical issues that prevent the redirect.
yeah, exactly! But with the webhook I cannot send req.body from my frontend
What details are in that payload?
for example you create an account when your payment is successful
so i need a way to send to the webhook user details such as image, name, surname, etc.
Yes, but what data is included in the body you send to your backend that isn't included in a payment_intent.* webhook event?
My recommendation would be to maybe include those in the metadata of the Payment Intent
so i can submit an entire formData with the payment intened?
can I add a file because on sign up I need to upload a profile picture with multer and AWS so the user has profile picture
Hi! I'm taking over this thread.
You could store the file on your server with a specific ID, and then store that ID in the PaymentIntent metadata field.
okay, I will try to figure it out myself with the provided help
if I cannot, I will probably end up here
one more thing
can I actually customize the order of the payment methods
in the UI
lets say Card Details then to be Ideal and then in the smaller menu the rest?
as you can see on the top currently first is card details and then Klarma
If you are using the PaymentElement, then yes: https://stripe.com/docs/js/elements_object/create_payment_element#payment_element_create-options-paymentMethodOrder
Happy to help 🙂
the chat will stay right?