woocommerce_ideal_init

The WooCommerce Sisow Mastercard woocommerce ideal init function.

Description

woocommerce_ideal_init(); 

Usage

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

Defined (1)

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

/sisowideal.php  
  1. function woocommerce_ideal_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_ideal extends SisowBase
  9.  
  10. function __construct() { 
  11. $this->paymentcode = 'ideal'; 
  12. $this->paymentname = 'Sisow iDEAL'; 
  13. $this->redirect = true; 
  14. parent::__construct(); 
  15.  
  16. public function get_icon() { 
  17. if($this->displaylogo == 'yes') 
  18. return '<img alt="'.$this->paymentname.'" title="" src="'.plugins_url() . "/" . plugin_basename( dirname(__FILE__)) . '/sisow/logo/'.$this->paymentcode.'.png'.'"'; 
  19.  
  20. public function payment_fields() { 
  21. $paymentfee_total = $this->getFee(); 
  22. $testmode = ($this->testmode == 'yes') ? true : false; 
  23.  
  24. $sisow = new Sisow($this->settings['merchantid'], $this->settings['merchantkey']); 
  25. $options = ''; 
  26. $sisow->DirectoryRequest($options, false, $testmode); 
  27.  
  28. $text = '<b>'.__('Betalen met', sisow) . ' ' . $this->title . '</b>'; 
  29. if($this->merchantId == '' || $this->merchantKey == '') 
  30. $text .= '<br/><b>Let op MerchantID/MerchantKey niet ingevuld, controleer de instellingen!</b>'; 
  31.  
  32. if($this->testmode == 'yes') 
  33. $text .= '<br/><b>Let op Testmodus ingeschakeld!</b>'; 
  34.  
  35.  
  36. $text .= '<p>Kies hieronder uw bank<br/>'; 
  37. $text .= '<select name="sisow_bank">'; 
  38. $text .= '<option value="">Kies uw bank...</option>'; 
  39. foreach ($options as $value => $bank) { 
  40. $text .= '<option value="' . $value . '">' . $bank . '</option>'; 
  41. $text .= '</select></p>'; 
  42.  
  43. if ($paymentfee_total > 0) { 
  44. $text .= '<br/><b>' . $this->paymentfeelabel . woocommerce_price($paymentfee_total) . '</b>'; 
  45.  
  46. echo wpautop(wptexturize($text)); 
  47.  
  48. public function validate_fields() { 
  49. global $woocommerce; 
  50.  
  51. $this->issuerid = filter_input(INPUT_POST, 'sisow_bank'); 
  52.  
  53. if (!$this->issuerid) { 
  54. wc_add_notice( __( 'Kies uw bank.', sisow ), error ); 
  55. return false; 
  56. } else { 
  57. return true; 
  58.  
  59.  
  60. add_filter('woocommerce_payment_gateways', 'add_sisow_ideal_gateway'); 
  61.  
  62. function add_sisow_ideal_gateway($methods) { 
  63. $temp = 'WC_Sisow_ideal'; 
  64. $methods[] = $temp; 
  65. return $methods; 
  66.