#cmchen_65252
1 messages · Page 1 of 1 (latest)
Did you confirm the PaymentIntent? Any example Id?
PaymentIntentCreateParams params = PaymentIntentCreateParams.builder()
.setAmount(1000L) // 支付金额,以分为单位
.setCurrency("usd") // 支付货币类型
.setReceiptEmail("test@qq.com") //支付成功发送邮箱
.setDescription("test")
.setPaymentMethod("pm_1NpnGJH405nfaGplROqHQLgn")
.setCustomer("cus_Od0mzhljy2PO77")
.setCaptureMethod(PaymentIntentCreateParams.CaptureMethod.AUTOMATIC)
.putMetadata("orderId", UUID.randomUUID().toString())
.build();
PaymentIntent paymentIntent = PaymentIntent.create(params);
You can pass confirm: True to confirm it immediately
do you mean " .setConfirmationMethod(PaymentIntentCreateParams.ConfirmationMethod.AUTOMATIC)"
no, .setConfirm(true)
my payment flow is: 1、custoemr add card to set a payment method 2、customer receive my product 3、 auto deduct money from customer's card
how can i use stripe to make this happen
👋 taking over for my colleague. Let me catch up.
give me a moment and will be with you shortly
ok perfect let me know if you need any more help
do you mean ahead of time? like before doing the transaction?
yes i want to know if customer add a invalid card like card's number or expiry date incorrect or card has been lock by bank
honestly it's not worth it to make 2 calls, the authentication will happen on the PaymentIntent, and if the payment fails then you could ask for another Payment Method
but i .setConfirm(true), i create a paymentIntent and auto deduct there is no need to confirme by customer again, what if deduct faild?
then you can send the client_secret to the front-end and use PaymentElements to collect another payment method
and confirm the PaymentIntent on session
do i need to create a new paymentIntent or re-use the failed one?
you can reuse the same one
where can i find the connect fee ?
can i deduct $1 and refund to customer to valid the bank card ?