#zhyga_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/1299315213123981374
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Could you please share the PaymentIntent Id used ?
my typo "Bank Transfer", not Bank Acount. Its not possible to pay via Bank Transfer.
checking PaymentIntent Id. Give me a moment
pi_3QDkcVRwTRvw88Wo05BQHUfq
Thanks, checking...
I see those PaymentMethods enabled for that PaymentIntent card, sepa_debit and customer_balance which is bank transfer
Can you share a screen shot of your PaymentElement ?
When opening the dev tool
Are you seeing any particular log line?
Do you have a hosted test website, that we can use ?
yes, we have
let me send it to you
https://dev.jobbuffer.de/payment email: maryna.zhygadloaa@jobbuffer.de psw: JobBuffer202$
Are you using the deferred mode here ?
Its seems you are not using the PaymentIntent generated with the customer_balance, but you are using the deferred approach.
is there a particular reason for that ?
moment, checking
this is my code on BE to create PI on Stripe fun createPaymentIntent(userId: String, customerId: String, basket: BasketOutput): PaymentIntentOutput? {
return try {
val params = PaymentIntentCreateParams.builder()
.setCustomer(customerId)
.setAmount(basket.total)
.setCurrency(basket.selectedPackage?.defaultPrice?.currency ?: StripeProxyConstants.CURRENCY_EUR)
.putMetadata("basketId", basket.id)
.putMetadata("userId", userId)
.build()
val intent = PaymentIntent.create(params)
PaymentIntentOutput(intent.id, intent.metadata["basketId"] ?: "unknown", intent.clientSecret)
} catch (e: StripeException) {
logger.error("Error during payment intent creation for Stripe: ${e.message}")
null
}
}
we havent used PaymentIntent generated with the customer_balance.
- we create PI 2. Crete a method of payment. 3.Confirming payment intent
Why you are not using the Payment Intent created in the PaymentElement?
because to draw this element we needed to pass clientSecret. So we call create paymentIntent throug our payment proxy, where we receive clientSecret. We use it for payment element. Then we create method of payment, and confirm intent wiith this MOP.
did we do smth wrong?
So we call create paymentIntent throug our payment proxy, where we receive clientSecret.
Yes great, but why you are not using the clientSecret with the PaymentElement then ?
yes, we do
According to the code you've shared no you aren't actually
Can you please share where in the frontend you are using the clientSecret with the PaymentElement ?
moment
You should set the clientSecret in your stripeOptions instead of passing the amount, mode, and currency
so, 1 create paymentIntent using backendProxy. 2. clientSecretFrom step 1 should be passed to PaymentElement instead of nstead of passing the amount, mode, and currency.
what will be step 3?
you'd call confirmPayment
Basically the guide here: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements
so the problem is in the code. if i eliminate this problem, Bank Transfer should be present automatically
I don't know really, I answered your last question. Can you share a pi_xxx ID that you're creating?
pi_3QDkcVRwTRvw88Wo05BQHUfq
Can you remove the paymentMethodCreation line? Is that necessary (I don't think it is based on what you've shared)
(in fact just remove all those options params other than clientSecret)
if i remove it, i wont be able to retrieve paymentMethod on frontend
without paymentMethodCreation i woulnt be able to call PI confirm
Yes you can, you call confirmPayment and pass elements which reads the payment data from the form: https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements#web-submit-payment
You only need to create the PM explicitly like that if you want to send it server-side to process some logic on it
we do payment confirm via our paymentProxy backend. What you recomend to do it from fe to Stripe stripe.confirmPayment, right?
You seem to be mixing a deferred and non-deferred integration and it's probably confusing the payment method logic. If you're creating the intent before you initialise the Payment Element then you only need to pass clientSecret and then pass elements to confirmPayment
Yes, so that customers can complete any 3DS/auth flows that may be requested. If you confirm server-side the intent will just transition to requires_action and you'll need to send it back to the front-end