| Server IP : 47.82.179.145 / Your IP : 216.73.217.129 Web Server : nginx/1.26.3 System : Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64 User : www ( 1001) PHP Version : 8.3.30 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/sureforms/inc/payments/ |
Upload File : |
<?php
/**
* SureForms Payments Main Class.
*
* @package sureforms
* @since 2.0.0
*/
namespace SRFM\Inc\Payments;
use SRFM\Inc\Payments\Admin\Admin_Handler;
use SRFM\Inc\Payments\Stripe\Admin_Stripe_Handler;
use SRFM\Inc\Payments\Stripe\Payments_Settings;
use SRFM\Inc\Payments\Stripe\Stripe_Webhook;
use SRFM\Inc\Traits\Get_Instance;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* SureForms Payments Main Class.
*
* @since 2.0.0
*/
class Payments {
use Get_Instance;
/**
* Constructor
*
* @since 2.0.0
*/
public function __construct() {
if ( is_admin() ) {
Admin_Handler::get_instance();
Admin_Stripe_Handler::get_instance();
}
// Initialize Payments_Settings for both admin and REST API contexts.
Payments_Settings::get_instance();
Front_End::get_instance();
Stripe_Webhook::get_instance();
add_filter( 'srfm_ai_form_generator_body', [ $this, 'add_payment_version_to_ai_body' ], 10, 2 );
}
/**
* Add payment version to AI form generator body.
*
* @param array<mixed> $body The body array for AI request.
* @param array<mixed> $params The request parameters.
* @since 2.0.0
* @return array<mixed> Modified body array.
*/
public function add_payment_version_to_ai_body( $body, $params ) {
// Get the form type from params.
$form_type = ! empty( $params['form_type'] ) && is_string( $params['form_type'] ) ? sanitize_text_field( $params['form_type'] ) : '';
// If form type is payment, add version to body.
if ( 'payment' === $form_type ) {
$body['version'] = 'payment';
}
return $body;
}
}