/classes/instances/klarna.php

  1. <?php 
  2.  
  3. class WC_QuickPay_Klarna extends WC_QuickPay_Instance { 
  4.  
  5. public $main_settings = NULL; 
  6.  
  7. public function __construct() { 
  8. parent::__construct(); 
  9.  
  10. // Get gateway variables 
  11. $this->id = 'klarna'; 
  12.  
  13. $this->method_title = 'QuickPay - Klarna'; 
  14.  
  15. $this->setup(); 
  16.  
  17. $this->title = $this->s('title'); 
  18. $this->description = $this->s('description'); 
  19.  
  20. add_filter( 'woocommerce_quickpay_cardtypelock_klarna', array( $this, 'filter_cardtypelock' ) ); 
  21.  
  22.  
  23. /** 
  24. * init_form_fields function. 
  25. * 
  26. * Initiates the plugin settings form fields 
  27. * 
  28. * @access public 
  29. * @return array 
  30. */ 
  31. public function init_form_fields() 
  32. $this->form_fields = array( 
  33. 'enabled' => array( 
  34. 'title' => __( 'Enable', 'woo-quickpay' ),  
  35. 'type' => 'checkbox',  
  36. 'label' => __( 'Enable Klarna payment', 'woo-quickpay' ),  
  37. 'default' => 'no' 
  38. ),  
  39. '_Shop_setup' => array( 
  40. 'type' => 'title',  
  41. 'title' => __( 'Shop setup', 'woo-quickpay' ),  
  42. ),  
  43. 'title' => array( 
  44. 'title' => __( 'Title', 'woo-quickpay' ),  
  45. 'type' => 'text',  
  46. 'description' => __( 'This controls the title which the user sees during checkout.', 'woo-quickpay' ),  
  47. 'default' => __('Klarna', 'woo-quickpay') 
  48. ),  
  49. 'description' => array( 
  50. 'title' => __( 'Customer Message', 'woo-quickpay' ),  
  51. 'type' => 'textarea',  
  52. 'description' => __( 'This controls the description which the user sees during checkout.', 'woo-quickpay' ),  
  53. 'default' => __('Pay with Klarna', 'woo-quickpay') 
  54. ),  
  55. ); 
  56.  
  57.  
  58. /** 
  59. * filter_cardtypelock function. 
  60. * 
  61. * Sets the cardtypelock 
  62. * 
  63. * @access public 
  64. * @return string 
  65. */ 
  66. public function filter_cardtypelock( ) 
  67. return 'klarna'; 
.