Simplify_CardToken

Copyright (c) 2013 - 2015 MasterCard International Incorporated All rights reserved.

Defined (1)

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

/includes/gateways/simplify-commerce/includes/Simplify/CardToken.php  
  1. class Simplify_CardToken extends Simplify_Object { 
  2. /** 
  3. * Creates an Simplify_CardToken object 
  4. * @param array $hash a map of parameters; valid keys are:<dl style="padding-left:10px;"> 
  5. * <dt><tt>callback</tt></dt> <dd>The URL callback for the cardtoken </dd> 
  6. * <dt><tt>card.addressCity</tt></dt> <dd>City of the cardholder. [max length: 50, min length: 2] </dd> 
  7. * <dt><tt>card.addressCountry</tt></dt> <dd>Country code (ISO-3166-1-alpha-2 code) of residence of the cardholder. [max length: 2, min length: 2] </dd> 
  8. * <dt><tt>card.addressLine1</tt></dt> <dd>Address of the cardholder. [max length: 255] </dd> 
  9. * <dt><tt>card.addressLine2</tt></dt> <dd>Address of the cardholder if needed. [max length: 255] </dd> 
  10. * <dt><tt>card.addressState</tt></dt> <dd>State of residence of the cardholder. For the US, this is a 2-digit USPS code. [max length: 255, min length: 2] </dd> 
  11. * <dt><tt>card.addressZip</tt></dt> <dd>Postal code of the cardholder. The postal code size is between 5 and 9 in length and only contain numbers or letters. [max length: 9, min length: 3] </dd> 
  12. * <dt><tt>card.cvc</tt></dt> <dd>CVC security code of the card. This is the code on the back of the card. Example: 123 </dd> 
  13. * <dt><tt>card.expMonth</tt></dt> <dd>Expiration month of the card. Format is MM. Example: January = 01 [min value: 1, max value: 12] <strong>required </strong></dd> 
  14. * <dt><tt>card.expYear</tt></dt> <dd>Expiration year of the card. Format is YY. Example: 2013 = 13 [min value: 0, max value: 99] <strong>required </strong></dd> 
  15. * <dt><tt>card.name</tt></dt> <dd>Name as appears on the card. [max length: 50, min length: 2] </dd> 
  16. * <dt><tt>card.number</tt></dt> <dd>Card number as it appears on the card. [max length: 19, min length: 13] <strong>required </strong></dd> 
  17. * <dt><tt>key</tt></dt> <dd>Key used to create the card token. </dd></dl> 
  18. * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.<i/> 
  19. * @return CardToken a CardToken object. 
  20. */ 
  21. static public function createCardToken($hash, $authentication = null) { 
  22.  
  23. $args = func_get_args(); 
  24. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  25.  
  26. $instance = new Simplify_CardToken(); 
  27. $instance->setAll($hash); 
  28.  
  29. $object = Simplify_PaymentsApi::createObject($instance, $authentication); 
  30. return $object; 
  31.  
  32.  
  33.  
  34. /** 
  35. * Retrieve a Simplify_CardToken object from the API 
  36. * @param string id the id of the CardToken object to retrieve 
  37. * @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i> 
  38. * @return CardToken a CardToken object 
  39. */ 
  40. static public function findCardToken($id, $authentication = null) { 
  41.  
  42. $args = func_get_args(); 
  43. $authentication = Simplify_PaymentsApi::buildAuthenticationObject($authentication, $args, 2); 
  44.  
  45. $val = new Simplify_CardToken(); 
  46. $val->id = $id; 
  47.  
  48. $obj = Simplify_PaymentsApi::findObject($val, $authentication); 
  49.  
  50. return $obj; 
  51.  
  52. /** 
  53. * @ignore 
  54. */ 
  55. public function getClazz() { 
  56. return "CardToken";