$stripe->cards->createCardFromToken("customer_id", "token");
The createCard()
method takes a CreateCardRequest
object as its only parameter.
$request = $stripe->cards->createCardRequest("4242424242424242", 1, 2020);
$card = $stripe->cards->createCard("customer_id", $request);
Like createCard()
, updateCard()
takes an UpdateCardRequest
object.
$request = $stripe->cards->updateCardRequest()->setExpMonth(3)->setExpYear(2031);
$stripe->cards->updateCard("customer_id", $card->getId(), $request);
$card = $stripe->cards->getCard("customer_id", "card_id");
$stripe->cards->deleteCard("customer_id", "card_id");
$cards = $stripe->cards->listCards("customer_id");