Card.php 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Issuing;
  4. /**
  5. * You can <a href="https://stripe.com/docs/issuing/cards">create physical or
  6. * virtual cards</a> that are issued to cardholders.
  7. *
  8. * @property string $id Unique identifier for the object.
  9. * @property string $object String representing the object's type. Objects of the same type share the same value.
  10. * @property string $brand The brand of the card.
  11. * @property null|string $cancellation_reason The reason why the card was canceled.
  12. * @property \Stripe\Issuing\Cardholder $cardholder <p>An Issuing <code>Cardholder</code> object represents an individual or business entity who is <a href="https://stripe.com/docs/issuing">issued</a> cards.</p><p>Related guide: <a href="https://stripe.com/docs/issuing/cards#create-cardholder">How to create a Cardholder</a></p>
  13. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  14. * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
  15. * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with <a href="https://stripe.com/docs/api/expanding_objects">the <code>expand</code> parameter</a>. Additionally, it's only available via the <a href="https://stripe.com/docs/api/issuing/cards/retrieve">&quot;Retrieve a card&quot; endpoint</a>, not via &quot;List all cards&quot; or any other endpoint.
  16. * @property int $exp_month The expiration month of the card.
  17. * @property int $exp_year The expiration year of the card.
  18. * @property string $last4 The last 4 digits of the card number.
  19. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
  20. * @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  21. * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with <a href="https://stripe.com/docs/api/expanding_objects">the <code>expand</code> parameter</a>. Additionally, it's only available via the <a href="https://stripe.com/docs/api/issuing/cards/retrieve">&quot;Retrieve a card&quot; endpoint</a>, not via &quot;List all cards&quot; or any other endpoint.
  22. * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any.
  23. * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any.
  24. * @property null|string $replacement_reason The reason why the previous card needed to be replaced.
  25. * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped.
  26. * @property \Stripe\StripeObject $spending_controls
  27. * @property string $status Whether authorizations can be approved on this card.
  28. * @property string $type The type of the card.
  29. */
  30. class Card extends \Stripe\ApiResource
  31. {
  32. const OBJECT_NAME = 'issuing.card';
  33. use \Stripe\ApiOperations\All;
  34. use \Stripe\ApiOperations\Create;
  35. use \Stripe\ApiOperations\Retrieve;
  36. use \Stripe\ApiOperations\Update;
  37. /**
  38. * @param null|array $params
  39. * @param null|array|string $opts
  40. *
  41. * @throws \Stripe\Exception\ApiErrorException if the request fails
  42. *
  43. * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card
  44. */
  45. public function details($params = null, $opts = null)
  46. {
  47. $url = $this->instanceUrl() . '/details';
  48. list($response, $opts) = $this->_request('get', $url, $params, $opts);
  49. $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts);
  50. $obj->setLastResponse($response);
  51. return $obj;
  52. }
  53. }