#wuguimei
1 messages · Page 1 of 1 (latest)
Once the payment methods are saved to Stripe, raw card number and CVC/CVV won't be retrievable. You can only retrieve the last 4 digits of the card and expiry date. By regulation, Stripe is not allowed to save CVV/CVC, so they won't be available.
You may retrieve the last4 and expiry from the card hash (https://stripe.com/docs/api/payment_methods/object#payment_method_object-card) with List Customer's Payment Methods API: https://stripe.com/docs/api/payment_methods/customer_list
What I mean is there any interface that can verify the correctness of card numbers, dates, and security codes
cvc_check but retrun null
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
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"
}
/v1/payment_methods endpoint doesn't perform validation with the issuer, so cvc_check will be null: https://dashboard.stripe.com/logs/req_vA7vefnYFFbE0e
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?
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
This works the same on card element. The guide I shared earlier on Payment Element includes saving other payment methods
What is it about this link? Do you have any question with it?
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?
When confirmSetupIntent is called, its response will return whether the status whether the the SetupIntent has been confirmed/bound successfully: https://stripe.com/docs/payments/save-and-reuse-cards-only?platform=ios#ios-collect-card-details
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 tosetup_intent.succeededevent at your server
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?
you can listen to setup_intent.succeeded event at your server?how to do it? https://stripe.com/docs/api/setup_intents/retrieve
Two options here:
- send the request to server from client about card saving successfully; or
- setup a webhook endpoint and listen to
setup_intent.succeededevent at server. You may follow this guide to setup a webhook endpoint: https://stripe.com/docs/webhooks/quickstart