Cards

Create a card from a token

$stripe->cards->createCardFromToken("customer_id", "token");

Create a card

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);

Update a card

Like createCard(), updateCard() takes an UpdateCardRequest object.

$request = $stripe->cards->updateCardRequest()->setExpMonth(3)->setExpYear(2031);
$stripe->cards->updateCard("customer_id", $card->getId(), $request); 

Retrieve a card

$card = $stripe->cards->getCard("customer_id", "card_id");

Delete a card

$stripe->cards->deleteCard("customer_id", "card_id");

List all cards associated with the given customer

$cards = $stripe->cards->listCards("customer_id");