MS_Gateway_Authorize_View_Card

The Membership 2 MS Gateway Authorize View Card class.

Defined (1)

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

/app/gateway/authorize/view/class-ms-gateway-authorize-view-card.php  
  1. class MS_Gateway_Authorize_View_Card extends MS_View { 
  2.  
  3. public function to_html() { 
  4. $action_url = ''; 
  5. $fields = $this->prepare_fields(); 
  6.  
  7. ob_start(); 
  8. ?> 
  9. <div class='ms-wrap ms-card-info-wrapper'> 
  10. <h2><?php _e( 'Credit card info', 'membership2' ); ?> </h2> 
  11. <table class="ms-table"> 
  12. <tbody> 
  13. <tr> 
  14. <th><?php _e( 'Card Number', 'membership2' ); ?></th> 
  15. <th><?php _e( 'Card Expiration date', 'membership2' ); ?></th> 
  16. </tr> 
  17. <tr> 
  18. <td><?php echo '**** **** **** ' . $this->data['authorize']['card_num']; ?></td> 
  19. <td><?php echo '' . $this->data['authorize']['card_exp']; ?></td> 
  20. </tr> 
  21. </tbody> 
  22. </table> 
  23. <form action="<?php echo esc_url( $action_url ); ?>" method="post"> 
  24. <?php 
  25. foreach ( $fields as $field ) { 
  26. MS_Helper_Html::html_element( $field ); 
  27. ?> 
  28. </form> 
  29. <div class="clear"></div> 
  30. </div> 
  31. <?php 
  32. return ob_get_clean(); 
  33.  
  34. private function prepare_fields() { 
  35. $fields = array( 
  36. 'gateway' => array( 
  37. 'id' => 'gateway',  
  38. 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN,  
  39. 'value' => $this->data['gateway']->id,  
  40. ),  
  41.  
  42. 'ms_relationship_id' => array( 
  43. 'id' => 'ms_relationship_id',  
  44. 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN,  
  45. 'value' => $this->data['ms_relationship_id'],  
  46. ),  
  47.  
  48. '_wpnonce' => array( 
  49. 'id' => '_wpnonce',  
  50. 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN,  
  51. 'value' => wp_create_nonce( 'update_card' ),  
  52. ),  
  53.  
  54. 'action' => array( 
  55. 'id' => 'action',  
  56. 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN,  
  57. 'value' => 'update_card',  
  58. ),  
  59.  
  60. 'submit' => array( 
  61. 'id' => 'submit',  
  62. 'type' => MS_Helper_Html::INPUT_TYPE_SUBMIT,  
  63. 'value' => __( 'Change card number', 'membership2' ),  
  64. ),  
  65. ); 
  66.  
  67. return $this;