woocommerce_eps_init

The WooCommerce Sisow Mastercard woocommerce eps init function.

Description

woocommerce_eps_init(); 

Usage

  1. if ( !function_exists( 'woocommerce_eps_init' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-sisow-mastercard/sisoweps.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = woocommerce_eps_init(); 
  7.  

Defined (1)

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

/sisoweps.php  
  1. function woocommerce_eps_init() { 
  2. if (!class_exists('WC_Payment_Gateway')) { 
  3. return; 
  4.  
  5. require_once(WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)) . '/sisow/sisow.cls5.php'); 
  6. require_once(WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)) . '/sisow/base.php'); 
  7.  
  8. class WC_Sisow_eps extends SisowBase
  9.  
  10. function __construct() { 
  11. $this->paymentcode = 'eps'; 
  12. $this->paymentname = 'Sisow EPS'; 
  13. $this->redirect = true; 
  14.  
  15. wp_enqueue_script( "sisow_giropay_script", "https://www.sisow.nl/Sisow/scripts/giro-eps.js", array('jquery')); 
  16. wp_enqueue_style( "sisow-eps-css", "https://bankauswahl.giropay.de/eps/widget/v1/style.css"); 
  17.  
  18. parent::__construct(); 
  19.  
  20. public function get_icon() 
  21. if($this->displaylogo == 'yes') 
  22. return '<img alt="'.$this->paymentname.'" title="" src="'.plugins_url() . "/" . plugin_basename( dirname(__FILE__)) . '/sisow/logo/'.$this->paymentcode.'.png'.'"'; 
  23.  
  24. public function payment_fields() { 
  25. $paymentfee_total = $this->getFee(); 
  26. $testmode = ($this->testmode == 'yes') ? true : false; 
  27.  
  28. $sisow = new Sisow($this->settings['merchantid'], $this->settings['merchantkey']); 
  29.  
  30. $text = '<script>( function($) { 
  31. $(document).ready(function() { 
  32. $(\'#eps_widget\').eps_widget({\'return\': \'bic\'}); 
  33. }); 
  34. } ) ( jQuery );</script>'; 
  35.  
  36. $text .= '<b>'.__('Betalen met', sisow) . ' ' . $this->title . '</b>'; 
  37. if($this->merchantId == '' || $this->merchantKey == '') 
  38. $text .= '</br><b>Let op MerchantID/MerchantKey niet ingevuld, controleer de instellingen!</b>'; 
  39.  
  40. if($this->testmode == 'yes') 
  41. $text .= '</br><b>Let op Testmodus ingeschakeld!</b>'; 
  42.  
  43. if ($paymentfee_total > 0) { 
  44. $text .= '</br><b>' . $this->paymentfeelabel . woocommerce_price($paymentfee_total) . '</b>'; 
  45.  
  46. $text .= '<br/>Bankleitzahl<br/>'; 
  47. $text .= '<input id="eps_widget" autocomplete="off" name="sisow_eps_bic" class="input-text required-entry" />'; 
  48. $text .= '</p>'; 
  49.  
  50. echo $text;//wpautop(wptexturize($text)); 
  51.  
  52. public function validate_fields() { 
  53. global $woocommerce; 
  54.  
  55. $this->bic = $_POST["sisow_eps_bic"]; 
  56.  
  57. if (!$this->bic) { 
  58. wc_add_notice( __( 'Please enter your bankleitzahl.', sisow ), error ); 
  59. return false; 
  60. } else { 
  61. return true; 
  62.  
  63.  
  64. add_filter('woocommerce_payment_gateways', 'add_sisow_eps_gateway'); 
  65.  
  66. function add_sisow_eps_gateway($methods) { 
  67. $temp = 'WC_Sisow_eps'; 
  68. $methods[] = $temp; 
  69. return $methods; 
  70.