PaymentGateway.php 899 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Class NF_Abstracts_PaymentGateway
  4. */
  5. abstract class NF_Abstracts_PaymentGateway
  6. {
  7. protected $_slug = '';
  8. protected $_name = '';
  9. protected $_settings = array();
  10. public function __construct()
  11. {
  12. add_filter( 'ninja_forms_collect_payment_process', array( $this, '_process' ) );
  13. }
  14. public function get_slug()
  15. {
  16. return $this->_slug;
  17. }
  18. public function get_name()
  19. {
  20. return $this->_name;
  21. }
  22. public function get_settings()
  23. {
  24. return $this->_settings;
  25. }
  26. public function _process( $action_settings, $form_id, $data )
  27. {
  28. if( $this->_slug == $action_settings[ 'payment_gateway' ] ){
  29. return $this->process( $action_settings, $form_id, $data );
  30. }
  31. }
  32. abstract protected function process( $action_settings, $form_id, $data );
  33. }