Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class WC_mypayment extends WC_Payment_Gateway{
- public function __construct(){
- $this->id = 'mypayment';
- $this->method_title = __('Pago mediante TPV','woocommerce');
- $this->method_description = __('Establecer los metodos de pago mediante TPV','woocommerce');
- // Carga de form
- $this->setup_form();
- $this->init_settings(); // function de woocommerce
- // Get options
- $this->title = $this->get_option('titulo');
- $this->description = $this->get_option('descripcion');
- $this->nombre_comercio = $this->get_option('nombre_comercio');
- //Add actions para woocommerce
- add_action( 'woocommerce_receipt_mypayment', array( $this, 'receipt_page' ) );
- add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
- }
- public function setup_form(){
- global $woocommerce;
- // aqui establezco los parametros necesarios para configuracion, en la parte admin no tengo problema
- }
- function receipt_page($order){
- echo "<p>".__("Gracias, nuestro metodo",'mypayment')."</p>";
- }
- } // end class
- function add_mypayment_gateway($methods){
- $methods[]="WC_mypayment";return $methods;
- }
- add_filter('woocommerce_payment_gateways','add_mypayment_gateway');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement