Path: blob/master/externals/stripe-php/lib/Stripe/Card.php
12256 views
<?php12class Stripe_Card extends Stripe_ApiResource3{4public static function constructFrom($values, $apiKey=null)5{6$class = get_class();7return self::scopedConstructFrom($class, $values, $apiKey);8}910/**11* @return string The instance URL for this resource. It needs to be special12* cased because it doesn't fit into the standard resource pattern.13*/14public function instanceUrl()15{16$id = $this['id'];17if (!$id) {18$class = get_class($this);19$msg = "Could not determine which URL to request: $class instance "20. "has invalid ID: $id";21throw new Stripe_InvalidRequestError($msg, null);22}2324if (isset($this['customer'])) {2526$parent = $this['customer'];27$base = self::classUrl('Stripe_Customer');28} else if (isset($this['recipient'])) {2930$parent = $this['recipient'];31$base = self::classUrl('Stripe_Recipient');32} else {3334return null;35}3637$parent = Stripe_ApiRequestor::utf8($parent);38$id = Stripe_ApiRequestor::utf8($id);3940$parentExtn = urlencode($parent);41$extn = urlencode($id);42return "$base/$parentExtn/cards/$extn";43}4445/**46* @param array|null $params47*48* @return Stripe_Card The deleted card.49*/50public function delete($params=null)51{52$class = get_class();53return self::_scopedDelete($class, $params);54}5556/**57* @return Stripe_Card The saved card.58*/59public function save()60{61$class = get_class();62return self::_scopedSave($class);63}64}65666768