Charging an existing card and customer with a security code on the lane
We use Stripe to process payments on the website we operate on
When a customer signs up, we create a customer on Stripe and save it customer_Id
to the database against the customer.
Also, when a customer places an order on the website, we provide the option to save the card for future use. Therefore, we save the card against the customer as a source of payment on the strip.
This is the code we use to create a payment source:
public void CreatePaymentSource(int customerId, string paymentToken)
{
var customer = _customerProvider.GetLoggedInCustomer(customerId);
//returns the customer_id e.g. cux_XXXXXXX from the customers table in our DB
var userStripeId = _customerProvider.GetCustomerStripeId(customerId);
var customerService = new StripeCustomerService();
// paymentToken is the secure token provided by Stripe.js in the card details entry form
var updateOptions = new StripeCustomerUpdateOptions()
{
Email = customer.Email,
SourceToken = paymentToken
};
// update customer to create a payment source
var stripeCustomer = customerService.Update(userStripeId, updateOptions);
}
Now the documentation says that if we want to charge an existing card, all we have to do is pass card_id
, 'customer_id' and 'amount' - based on this example: https://stripe.com/docs/charges#saving- credit-card-details-for-later
I want something like this:
1 - I want to show that the card is saved with the last 4 digits
I can do this using the information returned from the strip for the map -
My question
2 - I want the user to enter the security number every time they want to use the card to place an order. But how can we check the security number on the card?
EDIT - MY NEW QUESTION
As pointed out in a comment and in another question that CVC validation is not possible with Stripe - So what is the alternative for validating if a user is the cardholder?
Note. We use stripe.net - but answering any platform or programming language would be helpful.
source to share
No one has answered this question yet
See similar questions:
or similar: