ClientToken.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Braintree;
  3. class ClientToken
  4. {
  5. const DEFAULT_VERSION = 2;
  6. // static methods redirecting to gateway
  7. /**
  8. *
  9. * @param array $params
  10. * @return string
  11. */
  12. public static function generate($params=[])
  13. {
  14. return Configuration::gateway()->clientToken()->generate($params);
  15. }
  16. /**
  17. *
  18. * @param type $params
  19. * @throws InvalidArgumentException
  20. */
  21. public static function conditionallyVerifyKeys($params)
  22. {
  23. return Configuration::gateway()->clientToken()->conditionallyVerifyKeys($params);
  24. }
  25. /**
  26. *
  27. * @return string client token retrieved from server
  28. */
  29. public static function generateWithCustomerIdSignature()
  30. {
  31. return Configuration::gateway()->clientToken()->generateWithCustomerIdSignature();
  32. }
  33. /**
  34. *
  35. * @return string client token retrieved from server
  36. */
  37. public static function generateWithoutCustomerIdSignature()
  38. {
  39. return Configuration::gateway()->clientToken()->generateWithoutCustomerIdSignature();
  40. }
  41. }
  42. class_alias('Braintree\ClientToken', 'Braintree_ClientToken');