First time I am working with Payment System with PHP and Stripe API.
I have html form where user can Add their credit card info. Form fields are bellow :
- Card Number
- Month
- Year
- CVC
I can successfully add user credit card to my stripe account as Customer Account.
Now After added the credit card and I can get the card details using stripe API and...
Is it require to show the credit card number to the form field called
Card Number
?If so, then I can't see any full credit card number, I can see one of stripe object called
last4
. I know it's a last 4 digit of user credit cardOkey, If I show only 4 digit to the
Card Number
field then when I update the form It's showingThe card number is not a valid credit card number.
because the field is only showing4 digit
If I again enter my card number to that
Card Number
field then it's successfully updated.
Now how can I update the user credit card without again enter the credit card number to the Card Number
field ?
Update :
This is the Payment information form image :
and Update Code is following :
$updateCustomer = \Stripe\Customer::retrieve("$acc_id");
$updateCustomer->description = "Customer account of $fname_db $lname_db - #$u_id ($accountFor Account)";
$updateCustomer->source = "$stripToken";
$updateCustomer->save();
**** **** **** 9424
, from a UX perspective the customer can see, "oh this is my card identified by the last 4 digits, looks like I can update it here too" – Alex