#cmchen_65252

1 messages · Page 1 of 1 (latest)

west lionBOT
quasi trout
#

Did you confirm the PaymentIntent? Any example Id?

wheat socket
#

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);

quasi trout
#

You can pass confirm: True to confirm it immediately

wheat socket
#

do you mean " .setConfirmationMethod(PaymentIntentCreateParams.ConfirmationMethod.AUTOMATIC)"

quasi trout
#

no, .setConfirm(true)

west lionBOT
wheat socket
#

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

timid marsh
#

👋 taking over for my colleague. Let me catch up.

#

give me a moment and will be with you shortly

wheat socket
#

it's ok now, .setConfirm(true) solve my problem

#

think you

timid marsh
#

ok perfect let me know if you need any more help

wheat socket
#

@timid marsh hi how to verify the bank card is valid?

#

when customer add his cards

timid marsh
#

do you mean ahead of time? like before doing the transaction?

wheat socket
#

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

timid marsh
#

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

wheat socket
#

but i .setConfirm(true), i create a paymentIntent and auto deduct there is no need to confirme by customer again, what if deduct faild?

timid marsh
#

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

west lionBOT
wheat socket
#

do i need to create a new paymentIntent or re-use the failed one?

timid marsh
#

you can reuse the same one

wheat socket
#

where can i find the connect fee ?

wheat socket