M2_Stripe_Card

The Membership 2 M2 Stripe Card class.

Defined (1)

The class is defined in the following location(s).

/lib/stripe-php/lib/Stripe/Card.php  
  1. class M2_Stripe_Card extends M2_Stripe_ApiResource 
  2. public static function constructFrom($values, $apiKey=null) 
  3. $class = get_class(); 
  4. return self::scopedConstructFrom($class, $values, $apiKey); 
  5.  
  6. /** 
  7. * @return string The instance URL for this resource. It needs to be special 
  8. * cased because it doesn't fit into the standard resource pattern. 
  9. */ 
  10. public function instanceUrl() 
  11. $id = $this['id']; 
  12. if (!$id) { 
  13. $msg = "Could not determine which URL to request: $class instance " 
  14. . "has invalid ID: $id"; 
  15. throw new M2_Stripe_InvalidRequestError($msg, null); 
  16.  
  17. if (isset($this['customer'])) { 
  18.  
  19. $parent = $this['customer']; 
  20. $base = self::classUrl('M2_Stripe_Customer'); 
  21. } else if (isset($this['recipient'])) { 
  22.  
  23. $parent = $this['recipient']; 
  24. $base = self::classUrl('M2_Stripe_Recipient'); 
  25. } else { 
  26.  
  27. return null; 
  28.  
  29. $parent = M2_Stripe_ApiRequestor::utf8($parent); 
  30. $class = get_class($this); 
  31. $id = M2_Stripe_ApiRequestor::utf8($id); 
  32.  
  33. $parentExtn = urlencode($parent); 
  34. $extn = urlencode($id); 
  35. return "$base/$parentExtn/cards/$extn"; 
  36.  
  37. /** 
  38. * @param array|null $params 
  39. * @return Stripe_Card The deleted card. 
  40. */ 
  41. public function delete($params=null) 
  42. $class = get_class(); 
  43. return self::_scopedDelete($class, $params); 
  44.  
  45. /** 
  46. * @return Stripe_Card The saved card. 
  47. */ 
  48. public function save() 
  49. $class = get_class(); 
  50. return self::_scopedSave($class);