#wuguimei

1 messages · Page 1 of 1 (latest)

remote bearBOT
ocean parrot
visual bear
#

What I mean is there any interface that can verify the correctness of card numbers, dates, and security codes

#

cvc_check but retrun null

ocean parrot
#

Can you share the payment method which you saw the cvc_check is null?

If you use Payment Element to collect the payment method details, it will the validate if those information and their formats are entered correctly. Then they will be sent to the card issuer to perform another round of validation to check if they match the details in their own system

visual bear
#

url: https://api.stripe.com/v1/payment_methods
response: {
"billing_details" : {
"address" : {
"city" : null,
"country" : null,
"line1" : null,
"line2" : null,
"postal_code" : null,
"state" : null
},
"email" : null,
"name" : null,
"phone" : null
},
"card" : {
"brand" : "mastercard",
"checks" : {
"address_line1_check" : null,
"address_postal_code_check" : null,
"cvc_check" : null
},
"country" : "HK",
"exp_month" : 10,
"exp_year" : 2027,
"funding" : "credit",
"generated_from" : null,
"last4" : "9770",
"networks" : {
"available" : [
"mastercard"
],
"preferred" : null
},
"three_d_secure_usage" : {
"supported" : true
},
"wallet" : null
},
"created" : 1683685952,
"customer" : null,
"id" : "pm_1N62pQL0nslfKAh0zf5HVjgB",
"livemode" : true,
"object" : "payment_method",
"type" : "card"
}

ocean parrot
visual bear
#

My process here is to customize the front-end UI, create a payment method based on the card number information, and then send the payment method to the server, which creates a Customer and creates a Setup Intent. Wait until the user completes the rental business, create PaymentIntent, update the amount when it is returned, and finally confirm for deduction

#

doesn't perform validation to the issuer, what should I do?

ocean parrot
#

When you attach the payment method to the customer and use it in future payment intent, Stripe doesn't send cvc to the issuer as Stripe is not allowed to save CVC/CVV.

If you wish to have card validated with issuer, then you should use SetupIntent directly to collect the payment method details: https://stripe.com/docs/payments/save-and-reuse

visual bear
ocean parrot
#

This works the same on card element. The guide I shared earlier on Payment Element includes saving other payment methods

ocean parrot
#

What is it about this link? Do you have any question with it?

visual bear
#

I have some questions I would like to ask. The server returns the setupIntent clientSecret to the client, and the client user enters the card number. Then, the client binds the payment method to my customer. How does my server know if the current user has been successfully bound? Is it necessary for the client to bind the payment method to it and inform the server?

ocean parrot
#

Is it necessary for the client to bind the payment method to it and inform the server?
The guide will save the payment method details to the customer object via SetupIntent. What does "it" in the "bind the payment method to it" refer to? You will receive the outcome at the client. Alternatively, you can listen to setup_intent.succeeded event at your server

visual bear
#

I know, the client will know if the binding was successful, but our server doesn't know, so do we need the client to tell the server again, or do we need to strip this callback to the server?

ocean parrot
#

Two options here:

  1. send the request to server from client about card saving successfully; or
  2. setup a webhook endpoint and listen to setup_intent.succeeded event at server. You may follow this guide to setup a webhook endpoint: https://stripe.com/docs/webhooks/quickstart

Learn how to set up and deploy a webhook to listen to events from Stripe.