WC_Legacy_Payment_Token

Legacy Payment Tokens.

Defined (1)

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

/includes/legacy/abstract-wc-legacy-payment-token.php  
  1. abstract class WC_Legacy_Payment_Token extends WC_Data { 
  2.  
  3. /** 
  4. * Sets the type of this payment token (CC, eCheck, or something else). 
  5. * @param string Payment Token Type (CC, eCheck) 
  6. */ 
  7. public function set_type( $type ) { 
  8. wc_deprecated_function( 'WC_Payment_Token::set_type', '3.0.0', 'Type cannot be overwritten.' ); 
  9.  
  10. /** 
  11. * Read a token by ID. 
  12. * @deprecated 3.0.0 - Init a token class with an ID. 
  13. */ 
  14. public function read( $token_id ) { 
  15. wc_deprecated_function( 'WC_Payment_Token::read', '3.0.0', 'a new token class initialized with an ID.' ); 
  16. $this->set_id( $token_id ); 
  17. $data_store = WC_Data_Store::load( 'payment-token' ); 
  18. $data_store->read( $this ); 
  19.  
  20. /** 
  21. * Update a token. 
  22. * @deprecated 3.0.0 - Use ::save instead. 
  23. */ 
  24. public function update() { 
  25. wc_deprecated_function( 'WC_Payment_Token::update', '3.0.0', 'WC_Payment_Token::save instead.' ); 
  26. $data_store = WC_Data_Store::load( 'payment-token' ); 
  27. try { 
  28. $data_store->update( $this ); 
  29. } catch ( Exception $e ) { 
  30. return false; 
  31.  
  32. /** 
  33. * Create a token. 
  34. * @deprecated 3.0.0 - Use ::save instead. 
  35. */ 
  36. public function create() { 
  37. wc_deprecated_function( 'WC_Payment_Token::create', '3.0.0', 'WC_Payment_Token::save instead.' ); 
  38. $data_store = WC_Data_Store::load( 'payment-token' ); 
  39. try { 
  40. $data_store->create( $this ); 
  41. } catch ( Exception $e ) { 
  42. return false; 
  43.