Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. class WC_mypayment extends WC_Payment_Gateway{
  2. public function __construct(){
  3.  
  4. $this->id = 'mypayment';
  5. $this->method_title = __('Pago mediante TPV','woocommerce');
  6. $this->method_description = __('Establecer los metodos de pago mediante TPV','woocommerce');
  7.  
  8. // Carga de form
  9. $this->setup_form();
  10. $this->init_settings(); // function de woocommerce
  11.  
  12. // Get options
  13. $this->title = $this->get_option('titulo');
  14. $this->description = $this->get_option('descripcion');
  15. $this->nombre_comercio = $this->get_option('nombre_comercio');
  16.  
  17. //Add actions para woocommerce
  18. add_action( 'woocommerce_receipt_mypayment', array( $this, 'receipt_page' ) );
  19. add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
  20. }
  21. public function setup_form(){
  22. global $woocommerce;
  23. // aqui establezco los parametros necesarios para configuracion, en la parte admin no tengo problema
  24.  
  25. }
  26. function receipt_page($order){
  27. echo "<p>".__("Gracias, nuestro metodo",'mypayment')."</p>";
  28. }
  29.  
  30. } // end class
  31. function add_mypayment_gateway($methods){
  32. $methods[]="WC_mypayment";return $methods;
  33. }
  34. add_filter('woocommerce_payment_gateways','add_mypayment_gateway');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement