WC_Moip_Messages

WC Moip Messages Class.

Defined (1)

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

/includes/class-wc-moip-messages.php  
  1. class WC_Moip_Messages { 
  2.  
  3. /** 
  4. * Processes the Moip status message to translate. 
  5. * @param string $status Moip status message. 
  6. * @return string Translated status message. 
  7. */ 
  8. public static function translate_status( $status ) { 
  9. switch ( $status ) { 
  10. case 'Autorizado': 
  11. return __( 'Authorized', 'woocommerce-moip' ); 
  12. break; 
  13. case 'Iniciado': 
  14. return __( 'Initiate', 'woocommerce-moip' ); 
  15. break; 
  16. case 'BoletoImpresso': 
  17. return __( 'Billet Printed', 'woocommerce-moip' ); 
  18. break; 
  19. case 'Concluido': 
  20. return __( 'Concluded', 'woocommerce-moip' ); 
  21. break; 
  22. case 'Cancelado': 
  23. return __( 'Canceled', 'woocommerce-moip' ); 
  24. break; 
  25. case 'EmAnalise': 
  26. return __( 'In Review', 'woocommerce-moip' ); 
  27. break; 
  28. case 'Estornado': 
  29. return __( 'Reversed', 'woocommerce-moip' ); 
  30. break; 
  31. case 'Reembolsado': 
  32. return __( 'Refunded', 'woocommerce-moip' ); 
  33. break; 
  34. default: 
  35. break; 
  36.  
  37. /** 
  38. * Beginning of message 
  39. * @return string 
  40. */ 
  41. protected static function message_before() { 
  42. return __( 'Your transaction has been processed by Moip Payments S/A.', 'woocommerce-moip' ) . '<br />'; 
  43.  
  44. /** 
  45. * End of message 
  46. * @return string 
  47. */ 
  48. protected static function message_after() { 
  49. return __( 'If you have any questions regarding the transaction, please contact us or the Moip.', 'woocommerce-moip' ); 
  50.  
  51. /** 
  52. * Credit cart message. 
  53. * @param string $status Moip transaction status. 
  54. * @param int $code Moip transaction code. 
  55. * @return string 
  56. */ 
  57. public static function credit_cart_message( $status, $code ) { 
  58. $message = self::message_before(); 
  59. $message .= sprintf( __( 'The status of your transaction is %s and the MoIP code is %s.', 'woocommerce-moip' ), '<strong>' . esc_attr( $status ) . '</strong>', '<strong>' . esc_attr( $code ) . '</strong>' ) . '<br />'; 
  60. $message .= self::message_after(); 
  61.  
  62. return $message; 
  63.  
  64. /** 
  65. * Debit message. 
  66. * @return string 
  67. */ 
  68. public static function debit_message() { 
  69. $message = self::message_before(); 
  70. $message .= __( 'If you have not made **the payment, please click the button to your left to pay.', 'woocommerce-moip' ) . '<br />'; 
  71. $message .= self::message_after(); 
  72.  
  73. return $message; 
  74.  
  75. /** 
  76. * Debit email message. 
  77. * @return string 
  78. */ 
  79. public static function debit_email_message() { 
  80. $message = self::message_before(); 
  81. $message .= __( 'If you have not made **the payment, please use the link below to pay.', 'woocommerce-moip' ) . '<br />'; 
  82. $message .= self::message_after(); 
  83.  
  84. return $message; 
  85.  
  86. /** 
  87. * Billet message. 
  88. * @return string 
  89. */ 
  90. public static function billet_message() { 
  91. $message = self::message_before(); 
  92. $message .= __( 'If you have not yet received the billet, please click the button to the left to print it.', 'woocommerce-moip' ) . '<br />'; 
  93. $message .= self::message_after(); 
  94.  
  95. return $message; 
  96.  
  97. /** 
  98. * Billet email message. 
  99. * @return string 
  100. */ 
  101. public static function billet_email_message() { 
  102. $message = self::message_before(); 
  103. $message .= __( 'If you have not yet received the billet, please use the link below to print it.', 'woocommerce-moip' ) . '<br />'; 
  104. $message .= self::message_after(); 
  105.  
  106. return $message;