',
+ __('Activation error:', ''),
+ __('You need to have', ''),
+ 'https://givewp.com',
+ __('Give WP', ''),
+ __('version', ''),
+ PAYMENT_EREDE_FOR_GIVEWP_MIN_GIVE_VERSION,
+ __('for the Payment Gateway E-Rede for GiveWP plugin to activate.', '')
+ );
+
+ echo wp_kses_post($message);
+ }
+
+ public function custom_check_redirect_params(): void {
+ if ( is_front_page() ) {
+ $doacao_id = isset( $_GET['doacao_id'] ) ? (int) ( $_GET['doacao_id'] ) : 0;
+ $status = isset( $_GET['status'] ) ? sanitize_text_field( $_GET['status'] ) : '';
+
+ if ( $doacao_id && ( 'success' === $status || 'failure' === $status ) ) {
+ $redirect_url = '';
+
+ // Determinar a página de destino com base no status
+ if ( 'success' === $status ) {
+ // Obter a URL de sucesso do GiveWP
+ $redirect_url = give_get_success_page_uri() . '?donation_id=' . $doacao_id;
+ } elseif ( 'failure' === $status ) {
+ // Obter a URL de falha do GiveWP
+ $redirect_url = give_get_failed_transaction_uri();
+ }
+
+ // Redirecionar para a URL de destino se encontrada
+ if ( ! empty( $redirect_url ) ) {
+ wp_redirect( $redirect_url );
+ exit;
+ }
+ }
+ }
+ }
+
+ /**
+ * Register all of the hooks related to the admin area functionality
+ * of the plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ */
+ private function define_admin_hooks(): void {
+ $plugin_admin = new LknPaymentEredeForGivewpAdmin( $this->get_plugin_name(), $this->get_version() );
+
+ $this->loader->add_action( 'template_redirect', $this, 'custom_check_redirect_params' );
+
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
+
+ $this->loader->add_action('plugins_loaded', $this, 'check_environment', 999);
+ $this->loader->add_filter('plugin_action_links_' . PAYMENT_EREDE_FOR_GIVEWP_BASENAME, $this, 'define_row_meta', 10, 2);
+ $this->loader->add_action('lkn_payment_erede_cron_delete_logs', 'Lkn\PaymentEredeForGivewp\Includes\LknPaymentEredeForGivewpHelper', 'delete_old_logs', 10, 0 );
+ $this->loader->add_action('lkn_payment_erede_cron_verify_payment', $this, 'verify_payment', 10, 0 );
+
+ $this->loader->add_filter( 'give_get_settings_gateways', $plugin_admin, 'add_settings_into_section' );
+ $this->loader->add_filter('give_get_sections_gateways', $plugin_admin, 'new_setting_section');
+ $this->loader->add_action('give_view_donation_details_billing_after', $plugin_admin, 'add_donation_details');
+ }
+
+ /**
+ * Register all of the hooks related to the public-facing functionality
+ * of the plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ */
+ private function define_public_hooks(): void {
+ $plugin_public = new LknPaymentEredeForGivewpPublic( $this->get_plugin_name(), $this->get_version() );
+
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
+ $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
+ $this->loader->add_action('givewp_register_payment_gateway', $this, 'new_gateway_register', 999);
+ }
+
+ /**
+ * Register gateway to new GiveWP v3
+ *
+ * @since 3.0.0
+ *
+ * @param PaymentGatewayRegister $paymentGatewayRegister
+ *
+ * @return void
+ */
+ final public function new_gateway_register($paymentGatewayRegister): void {
+ $paymentGatewayRegister->registerGateway('Lkn\PaymentEredeForGivewp\PublicView\LknPaymentEredeForGivewpDebitGateway');
+ $paymentGatewayRegister->registerGateway('Lkn\PaymentEredeForGivewp\PublicView\LknPaymentEredeForGivewpCreditGateway');
+ }
+
+ /**
+ * Run the loader to execute all of the hooks with WordPress.
+ *
+ * @since 1.0.0
+ */
+ public function run(): void {
+ $this->loader->run();
+ }
+
+ /**
+ * The name of the plugin used to uniquely identify it within the context of
+ * WordPress and to define internationalization functionality.
+ *
+ * @since 1.0.0
+ * @return string The name of the plugin.
+ */
+ public function get_plugin_name() {
+ return $this->plugin_name;
+ }
+
+ /**
+ * The reference to the class that orchestrates the hooks with the plugin.
+ *
+ * @since 1.0.0
+ * @return Payment_Erede_For_Givewp_Loader Orchestrates the hooks of the plugin.
+ */
+ public function get_loader() {
+ return $this->loader;
+ }
+
+ /**
+ * Retrieve the version number of the plugin.
+ *
+ * @since 1.0.0
+ * @return string The version number of the plugin.
+ */
+ public function get_version() {
+ return $this->version;
+ }
+}
diff --git a/includes/class-payment-erede-for-givewp-activator.php b/Includes/LknPaymentEredeForGivewpActivator.php
similarity index 84%
rename from includes/class-payment-erede-for-givewp-activator.php
rename to Includes/LknPaymentEredeForGivewpActivator.php
index f6c6206..4c344d3 100644
--- a/includes/class-payment-erede-for-givewp-activator.php
+++ b/Includes/LknPaymentEredeForGivewpActivator.php
@@ -1,33 +1,35 @@
-
- */
-class Payment_Erede_For_Givewp_Activator {
- /**
- * Short Description. (use period)
- *
- * Long Description.
- *
- * @since 1.0.0
- */
- public static function activate(): void {
- }
-}
+
+ */
+class LknPaymentEredeForGivewpActivator {
+ /**
+ * Short Description. (use period)
+ *
+ * Long Description.
+ *
+ * @since 1.0.0
+ */
+ public static function activate(): void {
+ }
+}
diff --git a/includes/class-payment-erede-for-givewp-deactivator.php b/Includes/LknPaymentEredeForGivewpDeactivator.php
similarity index 86%
rename from includes/class-payment-erede-for-givewp-deactivator.php
rename to Includes/LknPaymentEredeForGivewpDeactivator.php
index d5249ee..699bf2c 100644
--- a/includes/class-payment-erede-for-givewp-deactivator.php
+++ b/Includes/LknPaymentEredeForGivewpDeactivator.php
@@ -1,35 +1,37 @@
-
- */
-class Payment_Erede_For_Givewp_Deactivator {
- /**
- * Short Description. (use period)
- *
- * Long Description.
- *
- * @since 1.0.0
- */
- public static function deactivate(): void {
- wp_unschedule_hook( 'lkn_payment_erede_cron_delete_logs' );
- wp_unschedule_hook( 'lkn_payment_erede_cron_verify_payment' );
- }
-}
+
+ */
+class LknPaymentEredeForGivewpDeactivator {
+ /**
+ * Short Description. (use period)
+ *
+ * Long Description.
+ *
+ * @since 1.0.0
+ */
+ public static function deactivate(): void {
+ wp_unschedule_hook( 'lkn_payment_erede_cron_delete_logs' );
+ wp_unschedule_hook( 'lkn_payment_erede_cron_verify_payment' );
+ }
+}
diff --git a/includes/class-payment-erede-for-givewp-helper.php b/Includes/LknPaymentEredeForGivewpHelper.php
similarity index 82%
rename from includes/class-payment-erede-for-givewp-helper.php
rename to Includes/LknPaymentEredeForGivewpHelper.php
index a147b9d..31a2cec 100644
--- a/includes/class-payment-erede-for-givewp-helper.php
+++ b/Includes/LknPaymentEredeForGivewpHelper.php
@@ -1,122 +1,115 @@
-
- */
-abstract class Payment_Erede_For_Givewp_Helper {
- /**
- * Get all paymethod config options
- *
- * @since 1.0.0
- *
- * @param string $type
- *
- * @return array
- */
- public static function get_configs($type) :array {
- $configs = array();
-
- switch ($type) {
- case 'credit':
- $configs['env'] = give_get_option('lkn_erede_credit_env_setting_field', 'sandbox');
- $configs['pv'] = give_get_option('lkn_erede_credit_pv_setting_field', '');
- $configs['token'] = give_get_option('lkn_erede_credit_token_setting_field', '');
- $configs['billing_fields'] = give_get_option('lkn_erede_credit_billing_fields_setting_field', 'disabled');
- $configs['debug'] = give_get_option('lkn_erede_credit_debug_setting_field', 'disabled');
- $description = give_get_option('lkn_erede_credit_softdescription_setting_field', __('Donation', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN));
- $configs['description'] = Payment_Erede_For_Givewp_Helper::format_softdescriptor_string($description);
-
- if ('production' === $configs['env']) {
- $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions';
- } else {
- $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions';
- }
-
- break;
- case 'debit-3ds':
- $configs['env'] = give_get_option('lkn_erede_debit_3ds_env_setting_field', 'sandbox');
- $configs['pv'] = give_get_option('lkn_erede_debit_3ds_pv_setting_field', '');
- $configs['token'] = give_get_option('lkn_erede_debit_3ds_token_setting_field', '');
- $configs['billing_fields'] = give_get_option('lkn_erede_debit_3ds_billing_fields_setting_field', 'disabled');
- $configs['debug'] = give_get_option('lkn_erede_debit_3ds_debug_setting_field', 'disabled');
- $description = give_get_option('lkn_erede_debit_3ds_softdescription_setting_field', __('Donation', PAYMENT_EREDE_FOR_GIVEWP_TEXT_DOMAIN));
- $configs['description'] = Payment_Erede_For_Givewp_Helper::format_softdescriptor_string($description);
-
- if ('production' === $configs['env']) {
- $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions';
- } else {
- $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions';
- }
-
- break;
-
- default:
- # code...
- break;
- }
-
- return $configs;
- }
-
- /**
- * Get billing fields option
- *
- * @since 1.0.0
- *
- * @return string
- */
- public static function get_billing_fields_opt() :string {
- return give_get_option('lkn_erede_credit_billing_fields_setting_field', 'disabled');
- }
-
- public static function log($message, $type) :void {
- error_log($message, 3, PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $type . '.log');
- }
-
- public static function delete_old_logs() :void {
- $logsPath = PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR;
-
- foreach (scandir($logsPath) as $logFilename) {
- if ('.' !== $logFilename && '..' !== $logFilename && 'index.php' !== $logFilename) {
- $logDate = explode('-', $logFilename)[0];
- $logDate = explode('.', $logDate);
-
- $logDay = $logDate[0];
- $logMonth = $logDate[1];
- $logYear = $logDate[2];
-
- $logDate = $logYear . '-' . $logMonth . '-' . $logDay;
-
- $logDate = new DateTime($logDate);
- $now = new DateTime(date('Y-m-d'));
-
- $interval = $logDate->diff($now);
- $logAge = $interval->format('%a');
-
- if ($logAge >= 15) {
- unlink($logsPath . '/' . $logFilename);
- }
- }
- }
- }
-
- public static function format_softdescriptor_string($str) :string {
- $str = preg_replace('/[áàãâä]/ui', 'a', $str);
- $str = preg_replace('/[éèêë]/ui', 'e', $str);
- $str = preg_replace('/[íìîï]/ui', 'i', $str);
- $str = preg_replace('/[óòõôö]/ui', 'o', $str);
- $str = preg_replace('/[úùûü]/ui', 'u', $str);
- $str = preg_replace('/[ç]/ui', 'c', $str);
- $str = preg_replace('/[^a-zA-Z0-9_]/', '', $str);
-
- return $str;
- }
-}
+
+ */
+abstract class LknPaymentEredeForGivewpHelper {
+ /**
+ * Get all paymethod config options
+ *
+ * @since 1.0.0
+ *
+ * @param string $type
+ *
+ * @return array
+ */
+ public static function get_configs($type) :array {
+ $configs = array();
+ switch ($type) {
+ case 'credit':
+ $configs['env'] = give_get_option('lkn_erede_credit_env_setting_field', 'sandbox');
+ $configs['pv'] = give_get_option('lkn_erede_credit_pv_setting_field', '');
+ $configs['token'] = give_get_option('lkn_erede_credit_token_setting_field', '');
+ $configs['billing_fields'] = give_get_option('lkn_erede_credit_billing_fields_setting_field', 'disabled');
+ $configs['debug'] = give_get_option('lkn_erede_credit_debug_setting_field', 'disabled');
+ $description = give_get_option('lkn_erede_credit_softdescription_setting_field', 'Doação');
+ $configs['description'] = LknPaymentEredeForGivewpHelper::format_softdescriptor_string($description);
+ $configs['withoutAuth3DS'] = give_get_option('lkn_erede_credit_transaction_without_authentication');
+
+ if ('production' === $configs['env']) {
+ $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions';
+ } else {
+ $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions';
+ }
+
+ break;
+ case 'debit-3ds':
+ $configs['env'] = give_get_option('lkn_erede_debit_3ds_env_setting_field', 'sandbox');
+ $configs['pv'] = give_get_option('lkn_erede_debit_3ds_pv_setting_field', '');
+ $configs['token'] = give_get_option('lkn_erede_debit_3ds_token_setting_field', '');
+ $configs['billing_fields'] = give_get_option('lkn_erede_debit_3ds_billing_fields_setting_field', 'disabled');
+ $configs['debug'] = give_get_option('lkn_erede_debit_3ds_debug_setting_field', 'disabled');
+ $description = give_get_option('lkn_erede_debit_3ds_softdescription_setting_field', 'Doação');
+ $configs['description'] = LknPaymentEredeForGivewpHelper::format_softdescriptor_string($description);
+
+ if ('production' === $configs['env']) {
+ $configs['api_url'] = 'https://api.userede.com.br/erede/v1/transactions';
+ } else {
+ $configs['api_url'] = 'https://sandbox-erede.useredecloud.com.br/v1/transactions';
+ }
+
+ break;
+
+ default:
+ # code...
+ break;
+ }
+
+ return $configs;
+ }
+
+ public static function log($message, $type) :void {
+ error_log($message, 3, PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR . $type . '.log');
+ }
+
+ public static function delete_old_logs() :void {
+ $logsPath = PAYMENT_EREDE_FOR_GIVEWP_LOG_DIR;
+
+ foreach (scandir($logsPath) as $logFilename) {
+ if ('.' !== $logFilename && '..' !== $logFilename && 'index.php' !== $logFilename) {
+ $logDate = explode('-', $logFilename)[0];
+ $logDate = explode('.', $logDate);
+
+ $logDay = $logDate[0];
+ $logMonth = $logDate[1];
+ $logYear = $logDate[2];
+
+ $logDate = $logYear . '-' . $logMonth . '-' . $logDay;
+
+ $logDate = new DateTime($logDate);
+ $now = new DateTime(gmdate('Y-m-d'));
+
+ $interval = $logDate->diff($now);
+ $logAge = $interval->format('%a');
+
+ if ($logAge >= 15) {
+ wp_delete_file($logsPath . '/' . $logFilename);
+ }
+ }
+ }
+ }
+
+ public static function format_softdescriptor_string($str) :string {
+ $str = preg_replace('/[áàãâä]/ui', 'a', $str);
+ $str = preg_replace('/[éèêë]/ui', 'e', $str);
+ $str = preg_replace('/[íìîï]/ui', 'i', $str);
+ $str = preg_replace('/[óòõôö]/ui', 'o', $str);
+ $str = preg_replace('/[úùûü]/ui', 'u', $str);
+ $str = preg_replace('/[ç]/ui', 'c', $str);
+ $str = preg_replace('/[^a-zA-Z0-9_]/', '', $str);
+
+ return $str;
+ }
+}
diff --git a/includes/class-payment-erede-for-givewp-i18n.php b/Includes/LknPaymentEredeForGivewpI8n.php
similarity index 92%
rename from includes/class-payment-erede-for-givewp-i18n.php
rename to Includes/LknPaymentEredeForGivewpI8n.php
index c61f8f1..974326a 100644
--- a/includes/class-payment-erede-for-givewp-i18n.php
+++ b/Includes/LknPaymentEredeForGivewpI8n.php
@@ -1,5 +1,7 @@
*/
-class Payment_Erede_For_Givewp_i18n {
+class LknPaymentEredeForGivewpI8n {
/**
* Load the plugin text domain for translation.
*
@@ -37,4 +39,4 @@ public function load_plugin_textdomain(): void {
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
);
}
-}
+}
\ No newline at end of file
diff --git a/includes/class-payment-erede-for-givewp-loader.php b/Includes/LknPaymentEredeForGivewpLoader.php
similarity index 96%
rename from includes/class-payment-erede-for-givewp-loader.php
rename to Includes/LknPaymentEredeForGivewpLoader.php
index 1968e4b..af3ab92 100644
--- a/includes/class-payment-erede-for-givewp-loader.php
+++ b/Includes/LknPaymentEredeForGivewpLoader.php
@@ -1,121 +1,123 @@
-
- */
-class Payment_Erede_For_Givewp_Loader {
- /**
- * The array of actions registered with WordPress.
- *
- * @since 1.0.0
- * @access protected
- * @var array $actions The actions registered with WordPress to fire when the plugin loads.
- */
- protected $actions;
-
- /**
- * The array of filters registered with WordPress.
- *
- * @since 1.0.0
- * @access protected
- * @var array $filters The filters registered with WordPress to fire when the plugin loads.
- */
- protected $filters;
-
- /**
- * Initialize the collections used to maintain the actions and filters.
- *
- * @since 1.0.0
- */
- public function __construct() {
- $this->actions = array();
- $this->filters = array();
- }
-
- /**
- * Add a new action to the collection to be registered with WordPress.
- *
- * @since 1.0.0
- * @param string $hook The name of the WordPress action that is being registered.
- * @param object $component A reference to the instance of the object on which the action is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
- */
- public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void {
- $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
- }
-
- /**
- * Add a new filter to the collection to be registered with WordPress.
- *
- * @since 1.0.0
- * @param string $hook The name of the WordPress filter that is being registered.
- * @param object $component A reference to the instance of the object on which the filter is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
- */
- public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void {
- $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
- }
-
- /**
- * A utility function that is used to register the actions and hooks into a single
- * collection.
- *
- * @since 1.0.0
- * @access private
- * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
- * @param string $hook The name of the WordPress filter that is being registered.
- * @param object $component A reference to the instance of the object on which the filter is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority The priority at which the function should be fired.
- * @param int $accepted_args The number of arguments that should be passed to the $callback.
- * @return array The collection of actions and filters registered with WordPress.
- */
- private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
- $hooks[] = array(
- 'hook' => $hook,
- 'component' => $component,
- 'callback' => $callback,
- 'priority' => $priority,
- 'accepted_args' => $accepted_args
- );
-
- return $hooks;
- }
-
- /**
- * Register the filters and actions with WordPress.
- *
- * @since 1.0.0
- */
- public function run(): void {
- foreach ( $this->filters as $hook ) {
- add_filter( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] );
- }
-
- foreach ( $this->actions as $hook ) {
- add_action( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] );
- }
- }
-}
+
+ */
+class LknPaymentEredeForGivewpLoader {
+ /**
+ * The array of actions registered with WordPress.
+ *
+ * @since 1.0.0
+ * @access protected
+ * @var array $actions The actions registered with WordPress to fire when the plugin loads.
+ */
+ protected $actions;
+
+ /**
+ * The array of filters registered with WordPress.
+ *
+ * @since 1.0.0
+ * @access protected
+ * @var array $filters The filters registered with WordPress to fire when the plugin loads.
+ */
+ protected $filters;
+
+ /**
+ * Initialize the collections used to maintain the actions and filters.
+ *
+ * @since 1.0.0
+ */
+ public function __construct() {
+ $this->actions = array();
+ $this->filters = array();
+ }
+
+ /**
+ * Add a new action to the collection to be registered with WordPress.
+ *
+ * @since 1.0.0
+ * @param string $hook The name of the WordPress action that is being registered.
+ * @param object $component A reference to the instance of the object on which the action is defined.
+ * @param string $callback The name of the function definition on the $component.
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
+ */
+ public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void {
+ $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
+ }
+
+ /**
+ * Add a new filter to the collection to be registered with WordPress.
+ *
+ * @since 1.0.0
+ * @param string $hook The name of the WordPress filter that is being registered.
+ * @param object $component A reference to the instance of the object on which the filter is defined.
+ * @param string $callback The name of the function definition on the $component.
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
+ */
+ public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ): void {
+ $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
+ }
+
+ /**
+ * A utility function that is used to register the actions and hooks into a single
+ * collection.
+ *
+ * @since 1.0.0
+ * @access private
+ * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
+ * @param string $hook The name of the WordPress filter that is being registered.
+ * @param object $component A reference to the instance of the object on which the filter is defined.
+ * @param string $callback The name of the function definition on the $component.
+ * @param int $priority The priority at which the function should be fired.
+ * @param int $accepted_args The number of arguments that should be passed to the $callback.
+ * @return array The collection of actions and filters registered with WordPress.
+ */
+ private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
+ $hooks[] = array(
+ 'hook' => $hook,
+ 'component' => $component,
+ 'callback' => $callback,
+ 'priority' => $priority,
+ 'accepted_args' => $accepted_args
+ );
+
+ return $hooks;
+ }
+
+ /**
+ * Register the filters and actions with WordPress.
+ *
+ * @since 1.0.0
+ */
+ public function run(): void {
+ foreach ( $this->filters as $hook ) {
+ add_filter( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] );
+ }
+
+ foreach ( $this->actions as $hook ) {
+ add_action( $hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args'] );
+ }
+ }
+}
diff --git a/includes/index.php b/Includes/index.php
similarity index 100%
rename from includes/index.php
rename to Includes/index.php
diff --git a/includes/logs/index.php b/Includes/logs/index.php
similarity index 100%
rename from includes/logs/index.php
rename to Includes/logs/index.php
diff --git a/LICENSE b/LICENSE
index f288702..3877ae0 100755
--- a/LICENSE
+++ b/LICENSE
@@ -1,674 +1,674 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/Public/LknPaymentEredeForGivewpCreditGateway.php b/Public/LknPaymentEredeForGivewpCreditGateway.php
new file mode 100644
index 0000000..87f7149
--- /dev/null
+++ b/Public/LknPaymentEredeForGivewpCreditGateway.php
@@ -0,0 +1,450 @@
+credit_card_form($formId, $args);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function createPayment(Donation $donation, $gatewayData): GatewayCommand {
+ try {
+ // Set the configs values
+ $configs = LknPaymentEredeForGivewpHelper::get_configs('credit');
+ $logname = gmdate('d.m.Y-H.i.s') . '-credit';
+ $withoutAuth3DS = $configs['withoutAuth3DS'];
+
+ $donation->firstName = sanitize_text_field($donation->firstName);
+ $donation->lastName = sanitize_text_field($donation->lastName);
+ $donation->email = sanitize_email($donation->email);
+
+ // Donation informations.
+ $donPrice = $donation->amount->formatToDecimal();
+
+ $cardNum = preg_replace('/\D/', '', sanitize_text_field($gatewayData['paymentCardNum']));
+ $CardCVC = $gatewayData['paymentCardCVC'];
+ $CardName = sanitize_text_field($gatewayData['paymentCardName']);
+ $CardExp = $gatewayData['paymentCardExp'];
+
+ // 3DS.
+ $userAgent = $gatewayData['paymentUserAgent'];
+ $colorDepth = $gatewayData['paymentColorDepth'];
+ $lang = $gatewayData['paymentLanguage'];
+ $height = $gatewayData['paymentHeight'];
+ $width = $gatewayData['paymentWidth'];
+ $timezone = $gatewayData['paymentTimezoneOffset'];
+
+ //Separando mes e ano
+ $expDate = explode('/', $CardExp);
+ $cardExpiryMonth = trim($expDate[0]);
+ $cardExpiryYear = trim($expDate[1]);
+
+ $headers = array(
+ 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ),
+ 'Content-Type' => 'application/json'
+ );
+
+ $currencyCode = give_get_currency($donation->formId, $donation);
+
+ $payment_id = $donation->id;
+ $amount = $donPrice;
+ $amount = number_format($amount, 2, '', '');
+
+ // Construir a URL com parâmetros
+ $redirect_url_sucess = add_query_arg(
+ array(
+ 'doacao_id' => $payment_id,
+ 'status' => 'success'
+ ),
+ home_url()
+ );
+
+ $redirect_url_fail = add_query_arg(
+ array(
+ 'doacao_id' => $payment_id,
+ 'status' => 'failure'
+ ),
+ home_url()
+ );
+
+ if ('enabled' == $withoutAuth3DS) {
+ $body = array(
+ 'capture' => true,
+ 'kind' => 'credit',
+ 'reference' => $payment_id,
+ 'amount' => $amount,
+ 'cardholderName' => $CardName,
+ 'cardNumber' => $cardNum,
+ 'expirationMonth' => $cardExpiryMonth,
+ 'expirationYear' => $cardExpiryYear,
+ 'securityCode' => $CardCVC,
+ 'softDescriptor' => $configs['description'],
+ 'subscription' => false,
+ 'origin' => 1,
+ 'distributorAffiliation' => 0,
+ 'storageCard' => '0',
+ 'transactionCredentials' => array(
+ 'credentialId' => '01'
+ )
+ );
+ } else {
+ $body = array(
+ 'capture' => false,
+ 'kind' => 'credit',
+ 'reference' => 'order' . $payment_id,
+ 'amount' => $amount,
+ 'cardholderName' => $CardName,
+ 'cardNumber' => $cardNum,
+ 'expirationMonth' => $cardExpiryMonth,
+ 'expirationYear' => $cardExpiryYear,
+ 'securityCode' => $CardCVC,
+ 'softDescriptor' => $configs['description'],
+ 'threeDSecure' => array(
+ 'embedded' => true,
+ 'onFailure' => 'decline',
+ 'userAgent' => $userAgent,
+ 'device' => array(
+ 'colorDepth' => $colorDepth,
+ 'deviceType3ds' => 'BROWSER',
+ 'javaEnabled' => false,
+ 'language' => $lang,
+ 'screenHeight' => $height,
+ 'screenWidth' => $width,
+ 'timeZoneOffset' => $timezone
+ )
+ ),
+ 'urls' => array(
+ array(
+ 'kind' => 'threeDSecureSuccess',
+ 'url' => $redirect_url_sucess
+ ),
+ array(
+ 'kind' => 'threeDSecureFailure',
+ 'url' => $redirect_url_fail
+ )
+ )
+ );
+ }
+
+ $body = apply_filters('lkn_erede_credit_body', $body, $currencyCode, $donation);
+
+ $response = wp_remote_post($configs['api_url'], array(
+ 'headers' => $headers,
+ 'body' => wp_json_encode($body)
+ ));
+
+ if ('enabled' === $configs['debug']) {
+ LknPaymentEredeForGivewpHelper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(json_decode(wp_remote_retrieve_body($response)), true), $logname);
+ }
+
+ $response = json_decode(wp_remote_retrieve_body($response));
+
+ $arrMetaData = array(
+ 'status' => $response->returnCode ?? '500',
+ 'message' => $response->returnMessage ?? 'Error on processing payment',
+ 'transaction_id' => $response->tid ?? '0',
+ 'capture' => $body['capture']
+ );
+
+ if ('enabled' === $configs['debug']) {
+ $arrMetaData['log'] = $logname;
+ }
+
+ give_update_payment_meta($payment_id, 'lkn_erede_response', wp_json_encode($arrMetaData));
+
+ switch ($response->returnCode) {
+ case '00':
+
+ $donation->status = DonationStatus::COMPLETE();
+ $donation->save();
+
+ return new PaymentComplete($payment_id);
+ exit;
+
+ case '220':
+
+ $paymentsToVerify = give_get_option('lkn_erede_3ds_payments_pending', '');
+
+ if (empty($paymentsToVerify)) {
+ $paymentsToVerify = array();
+ } else {
+ $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true);
+ }
+
+ $paymentsToVerify[] = array('id' => $payment_id, 'count' => '0');
+ $paymentsToVerify = base64_encode(wp_json_encode($paymentsToVerify));
+ give_update_option('lkn_erede_3ds_payments_pending', $paymentsToVerify);
+
+ $donation->status = DonationStatus::PENDING();
+ $donation->save();
+
+ return new RedirectOffsite($response->threeDSecure->url);
+ exit;
+
+ default:
+ $errorMessage = $response->returnMessage ?? 'Error on processing payment';
+
+ $donation->status = DonationStatus::FAILED();
+ $donation->save();
+
+ DonationNote::create(array(
+ 'donationId' => $donation->id,
+ 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage)
+ ));
+
+ throw new PaymentGatewayException($errorMessage);
+ }
+ } catch (Exception $e) {
+ $errorMessage = $response->returnMessage ?? 'Error on processing payment';
+
+ $donation->status = DonationStatus::FAILED();
+ $donation->save();
+
+ DonationNote::create(array(
+ 'donationId' => $donation->id,
+ 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage)
+ ));
+
+ throw new PaymentGatewayException($errorMessage);
+ }
+ }
+
+ /* ========== FORM RENDER ========== */
+
+ /**
+ * Function that build the donation form
+ *
+ * @param int $form_id - the form identificator
+ *
+ * @param array $args - list of additional arguments
+ *
+ * @return mixed
+ */
+ final public static function credit_card_form($form_id, $args) {
+ $configs = LknPaymentEredeForGivewpHelper::get_configs('credit');
+
+ ob_start();
+
+ do_action('give_before_cc_fields', $form_id); ?>
+
+
+
+debit_card_form($formId, $args);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function createPayment(Donation $donation, $gatewayData): GatewayCommand {
+ try {
+ // Set the configs values
+ $configs = LknPaymentEredeForGivewpHelper::get_configs('debit-3ds');
+ $logname = gmdate('d.m.Y-H.i.s') . '-debit-3ds';
+
+ // Donation informations.
+ $donation->firstName = sanitize_text_field($donation->firstName);
+ $donation->lastName = sanitize_text_field($donation->lastName);
+ $donation->email = sanitize_email($donation->email);
+ $donPrice = $donation->amount->formatToDecimal();
+
+ // Card informations.
+ $cardNum = preg_replace('/\D/', '', sanitize_text_field($gatewayData['paymentCardNum']));
+ $CardCVC = $gatewayData['paymentCardCVC'];
+ $CardName = sanitize_text_field($gatewayData['paymentCardName']);
+ $CardExp = $gatewayData['paymentCardExp'];
+
+ // 3DS.
+ $userAgent = $gatewayData['paymentUserAgent'];
+ $colorDepth = $gatewayData['paymentColorDepth'];
+ $lang = $gatewayData['paymentLanguage'];
+ $height = $gatewayData['paymentHeight'];
+ $width = $gatewayData['paymentWidth'];
+ $timezone = $gatewayData['paymentTimezoneOffset'];
+
+ //Separando mes e ano.
+ $expDate = explode('/', $CardExp);
+ $cardExpiryMonth = trim($expDate[0]);
+ $cardExpiryYear = trim($expDate[1]);
+
+ $headers = array(
+ 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ),
+ 'Content-Type' => 'application/json'
+ );
+
+ $currencyCode = give_get_currency($donation->formId, $donation);
+ $payment_id = $donation->id;
+
+ $amount = $donPrice;
+ $amount = number_format($amount, 2, '', '');
+
+ // Construir a URL com parâmetros
+ $redirect_url_sucess = add_query_arg(
+ array(
+ 'doacao_id' => $payment_id,
+ 'status' => 'success'
+ ),
+ home_url()
+ );
+
+ $redirect_url_fail = add_query_arg(
+ array(
+ 'doacao_id' => $payment_id,
+ 'status' => 'failure'
+ ),
+ home_url()
+ );
+
+ $body = array(
+ 'capture' => true,
+ 'kind' => 'debit',
+ 'reference' => 'order' . $payment_id,
+ 'amount' => $amount,
+ 'cardholderName' => $CardName,
+ 'cardNumber' => $cardNum,
+ 'expirationMonth' => $cardExpiryMonth,
+ 'expirationYear' => $cardExpiryYear,
+ 'securityCode' => $CardCVC,
+ 'softDescriptor' => $configs['description'],
+ 'threeDSecure' => array(
+ 'embedded' => true,
+ 'onFailure' => 'decline',
+ 'userAgent' => $userAgent,
+ 'device' => array(
+ 'colorDepth' => $colorDepth,
+ 'deviceType3ds' => 'BROWSER',
+ 'javaEnabled' => false,
+ 'language' => $lang,
+ 'screenHeight' => $height,
+ 'screenWidth' => $width,
+ 'timeZoneOffset' => $timezone
+ )
+ ),
+ 'urls' => array(
+ array(
+ 'kind' => 'threeDSecureSuccess',
+ 'url' => $redirect_url_sucess
+ ),
+ array(
+ 'kind' => 'threeDSecureFailure',
+ 'url' => $redirect_url_fail
+ )
+ )
+ );
+
+ $body = apply_filters('lkn_erede_debit_3ds_body', $body, $currencyCode, $donation);
+
+ $response = wp_remote_post($configs['api_url'], array(
+ 'headers' => $headers,
+ 'body' => wp_json_encode($body)
+ ));
+
+ if ('enabled' === $configs['debug']) {
+ LknPaymentEredeForGivewpHelper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(wp_remote_retrieve_body($response), true), $logname);
+ }
+
+ $response = json_decode(wp_remote_retrieve_body($response));
+
+ $arrMetaData = array(
+ 'status' => $response->returnCode ?? '500',
+ 'message' => $response->returnMessage ?? 'Error on processing payment',
+ 'transaction_id' => $response->tid ?? '0',
+ 'capture' => $body['capture']
+ );
+
+ if ('enabled' === $configs['debug']) {
+ $arrMetaData['log'] = $logname;
+ }
+
+ give_update_payment_meta($payment_id, 'lkn_erede_response', wp_json_encode($arrMetaData));
+
+ switch ($response->returnCode) {
+ case '200':
+
+ $donation->status = DonationStatus::COMPLETE();
+ $donation->save();
+
+ return new PaymentComplete($payment_id);
+ exit;
+
+ case '220':
+
+ $paymentsToVerify = give_get_option('lkn_erede_3ds_payments_pending', '');
+
+ if (empty($paymentsToVerify)) {
+ $paymentsToVerify = array();
+ } else {
+ $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true);
+ }
+
+ $paymentsToVerify[] = array('id' => $payment_id, 'count' => '0');
+ $paymentsToVerify = base64_encode(wp_json_encode($paymentsToVerify));
+ give_update_option('lkn_erede_3ds_payments_pending', $paymentsToVerify);
+
+ $donation->status = DonationStatus::PENDING();
+ $donation->save();
+
+ return new RedirectOffsite($response->threeDSecure->url);
+ exit;
+
+ default:
+ $errorMessage = $response->returnMessage ?? 'Error on processing payment';
+
+ $donation->status = DonationStatus::FAILED();
+ $donation->save();
+
+ DonationNote::create(array(
+ 'donationId' => $donation->id,
+ 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage)
+ ));
+
+ throw new PaymentGatewayException($errorMessage);
+ }
+ } catch (Exception $e) {
+ $errorMessage = $response->returnMessage ?? 'Error on processing payment';
+
+ $donation->status = DonationStatus::FAILED();
+ $donation->save();
+
+ DonationNote::create(array(
+ 'donationId' => $donation->id,
+ 'content' => sprintf(esc_html('Falha na doação. Razão: %s'), $errorMessage)
+ ));
+
+ throw new PaymentGatewayException($errorMessage);
+ }
+ }
+
+ /* ========== FORM RENDER ========== */
+
+ /**
+ * Function that build the donation form
+ *
+ * @param int $form_id - the form identificator
+ *
+ * @param array $args - list of additional arguments
+ *
+ * @return mixed
+ */
+ final public static function debit_card_form($form_id, $args) {
+ $configs = LknPaymentEredeForGivewpHelper::get_configs('debit-3ds');
+
+ ob_start();
+
+ do_action('give_before_cc_fields', $form_id); ?>
+
+
+
+
- */
-class Payment_Erede_For_Givewp_Public {
- /**
- * The ID of this plugin.
- *
- * @since 1.0.0
- * @access private
- * @var string $plugin_name The ID of this plugin.
- */
- private $plugin_name;
-
- /**
- * The version of this plugin.
- *
- * @since 1.0.0
- * @access private
- * @var string $version The current version of this plugin.
- */
- private $version;
-
- /**
- * Initialize the class and set its properties.
- *
- * @since 1.0.0
- * @param string $plugin_name The name of the plugin.
- * @param string $version The version of this plugin.
- */
- public function __construct( $plugin_name, $version ) {
- $this->plugin_name = $plugin_name . '_public';
- $this->version = $version;
- }
-
- /**
- * Register the stylesheets for the public-facing side of the site.
- *
- * @since 1.0.0
- */
- public function enqueue_styles(): void {
- /**
- * This function is provided for demonstration purposes only.
- *
- * An instance of this class should be passed to the run() function
- * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined
- * in that particular class.
- *
- * The Payment_Erede_For_Givewp_Loader will then create the relationship
- * between the defined hooks and the functions defined in this
- * class.
- */
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/payment-erede-for-givewp-public.css', array(), $this->version, 'all' );
- }
-
- /**
- * Register the JavaScript for the public-facing side of the site.
- *
- * @since 1.0.0
- */
- public function enqueue_scripts(): void {
- /**
- * This function is provided for demonstration purposes only.
- *
- * An instance of this class should be passed to the run() function
- * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined
- * in that particular class.
- *
- * The Payment_Erede_For_Givewp_Loader will then create the relationship
- * between the defined hooks and the functions defined in this
- * class.
- */
- wp_register_script( $this->plugin_name . '_debit_3ds', plugin_dir_url( __FILE__ ) . 'js/payment-erede-for-givewp-debit-3ds.js', array('jquery'), $this->version, false );
-
- if (give_is_gateway_active('lkn_erede_debit_3ds')) {
- wp_enqueue_script( $this->plugin_name . '_debit_3ds');
- }
- }
-
- public function payment_form_credit($form_id, $args): void {
- load_template(
- plugin_dir_path(__FILE__) . 'partials/payment-erede-for-givewp-public-display-credit.php',
- true,
- array(
- 'form_id' => $form_id,
- 'settings' => $args,
- 'billing_details' => Payment_Erede_For_Givewp_Helper::get_billing_fields_opt()
- )
- );
- }
-
- public function payment_form_debit_3ds($form_id, $args): void {
- load_template(
- plugin_dir_path(__FILE__) . 'partials/payment-erede-for-givewp-public-display-debit-3ds.php',
- true,
- array(
- 'form_id' => $form_id,
- 'settings' => $args,
- 'billing_details' => Payment_Erede_For_Givewp_Helper::get_billing_fields_opt()
- )
- );
- }
-}
+
+ */
+class LknPaymentEredeForGivewpPublic {
+ /**
+ * The ID of this plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $plugin_name The ID of this plugin.
+ */
+ private $plugin_name;
+
+ /**
+ * The version of this plugin.
+ *
+ * @since 1.0.0
+ * @access private
+ * @var string $version The current version of this plugin.
+ */
+ private $version;
+
+ /**
+ * Initialize the class and set its properties.
+ *
+ * @since 1.0.0
+ * @param string $plugin_name The name of the plugin.
+ * @param string $version The version of this plugin.
+ */
+ public function __construct( $plugin_name, $version ) {
+ $this->plugin_name = $plugin_name . '_public';
+ $this->version = $version;
+ }
+
+ /**
+ * Register the stylesheets for the public-facing side of the site.
+ *
+ * @since 1.0.0
+ */
+ public function enqueue_styles(): void {
+ /**
+ * This function is provided for demonstration purposes only.
+ *
+ * An instance of this class should be passed to the run() function
+ * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined
+ * in that particular class.
+ *
+ * The Payment_Erede_For_Givewp_Loader will then create the relationship
+ * between the defined hooks and the functions defined in this
+ * class.
+ */
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/payment-erede-for-givewp-public.css', array(), $this->version, 'all' );
+ }
+
+ /**
+ * Register the JavaScript for the public-facing side of the site.
+ *
+ * @since 1.0.0
+ */
+ public function enqueue_scripts(): void {
+ /**
+ * This function is provided for demonstration purposes only.
+ *
+ * An instance of this class should be passed to the run() function
+ * defined in Payment_Erede_For_Givewp_Loader as all of the hooks are defined
+ * in that particular class.
+ *
+ * The Payment_Erede_For_Givewp_Loader will then create the relationship
+ * between the defined hooks and the functions defined in this
+ * class.
+ */
+ }
+}
diff --git a/public/css/payment-erede-for-givewp-public.css b/Public/css/payment-erede-for-givewp-public.css
similarity index 100%
rename from public/css/payment-erede-for-givewp-public.css
rename to Public/css/payment-erede-for-givewp-public.css
diff --git a/public/index.php b/Public/index.php
similarity index 100%
rename from public/index.php
rename to Public/index.php
diff --git a/Public/js/plugin-credit-script.js b/Public/js/plugin-credit-script.js
new file mode 100644
index 0000000..1b1ace5
--- /dev/null
+++ b/Public/js/plugin-credit-script.js
@@ -0,0 +1,344 @@
+function lknCreditSet3DSvalue() {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const language = window.navigator.language.slice(0, 2);
+ const height = screen.height;
+ const width = screen.width;
+ const colorDepth = window.screen.colorDepth;
+ const userAgent = navigator.userAgent;
+ const date = new Date();
+ const timezoneOffset = date.getTimezoneOffset();
+ form?.setAttribute('data-payment-language', language);
+ form?.setAttribute('data-payment-height', String(height));
+ form?.setAttribute('data-payment-width', String(width));
+ form?.setAttribute('data-payment-colorDepth', String(colorDepth));
+ form?.setAttribute('data-payment-userAgent', userAgent);
+ form?.setAttribute('data-payment-date', date.toISOString());
+ form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset));
+}
+
+// Máscara para número de cartão de crédito
+function lknCreditCardMask(inputHTML) {
+ let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+ cardNumber = cardNumber.slice(0, 16);
+ const cardNumberArr = cardNumber.split('');
+ const resultArr = [];
+
+ // Aplicar máscara ao número do cartão de crédito
+ for (let i = 0; i < cardNumberArr.length; i++) {
+ resultArr.push(cardNumberArr[i]);
+
+ // Adicionar espaços a cada 4 dígitos
+ if ((i + 1) % 4 === 0 && i < 15) {
+ resultArr.push(' ');
+ }
+ }
+ inputHTML.target.value = resultArr.join('');
+}
+
+// Formatar entrada para apenas números
+function lknFormatNumbers(inputHTML) {
+ inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+}
+
+function lknCVVMask(inputHTML) {
+ let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+
+ // Limitar o CVV a 4 dígitos
+ if (cvv.length > 4) {
+ cvv = cvv.slice(0, 4);
+ }
+ inputHTML.target.value = cvv;
+}
+function lknNameValidation(inputHTML) {
+ let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços
+
+ inputHTML.target.value = name;
+}
+
+// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano
+function lknApplyDateMask(inputHTML) {
+ let currentDate = new Date(); // Obter a data atual
+ let currentYear = currentDate.getFullYear();
+ let currentMonth = currentDate.getMonth() + 1;
+ let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos
+ let maskedValue = '';
+
+ // Limitar o comprimento máximo do valor
+ value = value.slice(0, 6);
+ for (let i = 0; i < value.length; i++) {
+ if (i === 2) {
+ // Adicionar barra após os dois primeiros caracteres (mês)
+ maskedValue += ' / ';
+ }
+
+ // Validar o mês (deve ser entre 01 e 12)
+ if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ break;
+ }
+
+ // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6)
+ maskedValue += value[i];
+ }
+
+ // Validar o ano (deve ser igual ou posterior ao ano atual)
+ if (maskedValue.length === 9) {
+ const inputYear = parseInt(maskedValue.slice(5, 9));
+ if (inputYear < currentYear) {
+ maskedValue = ''; // Limpar o valor se o ano for inválido
+ } else if (inputYear === currentYear) {
+ // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual
+ const inputMonth = parseInt(maskedValue.slice(0, 2));
+ if (inputMonth < currentMonth) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ }
+ }
+ }
+
+ inputHTML.target.value = maskedValue;
+}
+function lknSetBorderColorOninput(inputHTML) {
+ inputHTML.style.borderColor = '#666';
+ inputHTML.setAttribute('aria-invalid', 'false');
+}
+function lknSetBorderIfEmpty(elementId) {
+ const element = document.getElementById(elementId);
+ if (element && !element.value.trim()) {
+ element.style.borderColor = 'red';
+ element.setAttribute('aria-invalid', 'true');
+ }
+}
+function lknSetDataCard(values) {
+ // Obter referência para todos os campos de entrada
+ const cardNumElement = document.getElementById('card_number');
+ const cardCVCElement = document.getElementById('card_cvc');
+ const cardNameElement = document.getElementById('give-card-name-field');
+ const cardExpirationElement = document.getElementById('card_expiry');
+
+ // Verificar se os elementos existem antes de acessar seus valores
+ if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) {
+ throw new Error('Um ou mais campos de cartão não encontrados.');
+ }
+
+ // Obter os valores dos campos de entrada
+ const cardNum = cardNumElement.value;
+ const cardCVC = cardCVCElement.value;
+ const cardName = cardNameElement.value;
+ const cardExpiration = cardExpirationElement.value;
+
+ // Verificar se algum campo está vazio
+ if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') {
+ // Definir a borda como vermelha para os campos vazios
+ lknSetBorderIfEmpty('card_number');
+ lknSetBorderIfEmpty('card_cvc');
+ lknSetBorderIfEmpty('give-card-name-field');
+ lknSetBorderIfEmpty('card_expiry');
+ throw new Error('Por favor, preencha todos os campos obrigatórios.');
+ } else {
+ // Todos os campos estão preenchidos, atribuir valores ao objeto 'values'
+ values.paymentCardNum = cardNum;
+ values.paymentCardCVC = cardCVC;
+ values.paymentCardName = cardName;
+ values.paymentCardExp = cardExpiration;
+ }
+}
+function lknCreditGet3DSvalue(values) {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const paymentLanguage = form?.getAttribute('data-payment-language');
+ const paymentHeight = form?.getAttribute('data-payment-height');
+ const paymentWidth = form?.getAttribute('data-payment-width');
+ const paymentColorDepth = form?.getAttribute('data-payment-colorDepth');
+ const paymentUserAgent = form?.getAttribute('data-payment-userAgent');
+ const paymentDate = form?.getAttribute('data-payment-date');
+ const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset');
+
+ // Verifica se as informações estão presentes antes de usá-las
+ if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) {
+ values.paymentLanguage = paymentLanguage;
+ values.paymentHeight = paymentHeight;
+ values.paymentWidth = paymentWidth;
+ values.paymentColorDepth = paymentColorDepth;
+ values.paymentUserAgent = paymentUserAgent;
+ values.paymentDate = paymentDate;
+ values.paymentTimezoneOffset = paymentTimezoneOffset;
+ } else {
+ throw new Error('Dados do 3DS não inseridos');
+ }
+}
+const lkn_erede_credit = {
+ id: 'lkn_erede_credit',
+ async initialize() {},
+ async beforeCreatePayment(values) {
+ lknSetDataCard(values);
+ lknCreditGet3DSvalue(values);
+ if (values.firstname === 'error') {
+ throw new Error('Gateway failed');
+ }
+ return {
+ ...values
+ };
+ },
+ async afterCreatePayment(response) {},
+ Fields() {
+ setTimeout(() => {
+ lknCreditSet3DSvalue(); // Chamar a função após o atraso de 1 segundo
+ }, 1000);
+ function isSSL() {
+ return window.location.protocol === 'https:';
+ }
+
+ // retorna no front as mensagens de erro
+ function lknPrintFrontendNotice(title, message) {
+ return /*#__PURE__*/React.createElement("div", {
+ className: "error-notice"
+ }, /*#__PURE__*/React.createElement("strong", null, title), " ", message);
+ }
+ if (!isSSL()) {
+ return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).');
+ } else {
+ return /*#__PURE__*/React.createElement("fieldset", {
+ className: "give-do-validate",
+ id: "give_dc_fields"
+ }, /*#__PURE__*/React.createElement("legend", {
+ style: {
+ fontSize: 'large'
+ }
+ }, "Informa\xE7\xF5es de cart\xE3o de cr\xE9dito"), /*#__PURE__*/React.createElement("div", {
+ id: "give_secure_site_wrapper"
+ }, /*#__PURE__*/React.createElement("span", {
+ class: "give-icon padlock"
+ }), /*#__PURE__*/React.createElement("span", {
+ style: {
+ display: 'block',
+ padding: '20px',
+ textAlign: 'center'
+ }
+ }, "Doa\xE7\xE3o Segura por Criptografia SSL")), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-number-wrap",
+ class: "form-row form-row-two-thirds form-row-responsive give-lkn-cielo-api-cc-field-wrap"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "card_number",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "N\xFAmero do cart\xE3o", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip hint--top hint--medium hint--bounce",
+ "aria-label": "Normalmente possui 16 digitos na frente do seu cart\xE3o de cr\xE9dito.",
+ rel: "tooltip"
+ }, /*#__PURE__*/React.createElement("i", {
+ class: "give-icon give-icon-question"
+ }))), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknFormatNumbers(e), lknCreditCardMask(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ autocomplete: "off",
+ name: "card_number",
+ id: "card_number",
+ class: "card-number give-input required",
+ placeholder: "N\xFAmero do cart\xE3o",
+ "aria-required": "true"
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-expiration-wrap",
+ class: "card-expiration form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "give-card-expiration-field",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "Expira\xE7\xE3o", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip give-icon give-icon-question",
+ "data-tooltip": "A data de expira\xE7\xE3o do cart\xE3o de cr\xE9dito, geralmente na frente do cart\xE3o."
+ })), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknApplyDateMask(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ autocomplete: "off",
+ name: "card_expiry",
+ id: "card_expiry",
+ class: "card-expiry give-input required",
+ placeholder: "MM / AAAA",
+ "aria-required": "true"
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-name-wrap",
+ class: "form-row form-row-two-thirds form-row-responsive"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "give-card-name-field",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "Nome do t\xEDtular do cart\xE3o", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip give-icon give-icon-question",
+ "data-tooltip": "O nome do titular da conta do cart\xE3o de cr\xE9dito."
+ })), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknNameValidation(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ autocomplete: "off",
+ id: "give-card-name-field",
+ name: "card_name",
+ class: "card-name give-input required",
+ placeholder: "Nome do titular do cart\xE3o",
+ "aria-required": "true"
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-cvc-wrap",
+ class: "form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "give-card-cvc-field",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "CVV", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip give-icon give-icon-question",
+ "data-tooltip": "S\xE3o os 3 ou 4 d\xEDgitos que est\xE3o atr\xE1s do seu cart\xE3o de cr\xE9dito."
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-cvc-field",
+ class: "input empty give-lkn-cielo-api-cc-field give-lkn-cielo-api-card-cvc-field"
+ }), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknCVVMask(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ size: "4",
+ maxlength: "4",
+ autocomplete: "off",
+ name: "card_cvc",
+ id: "card_cvc",
+ class: "give-input required",
+ placeholder: "CVV",
+ "aria-required": "true"
+ })));
+ }
+ }
+};
+window.givewp.gateways.register(lkn_erede_credit);
\ No newline at end of file
diff --git a/Public/js/plugin-credit-script.tsx b/Public/js/plugin-credit-script.tsx
new file mode 100644
index 0000000..acd0954
--- /dev/null
+++ b/Public/js/plugin-credit-script.tsx
@@ -0,0 +1,319 @@
+function lknCreditSet3DSvalue() {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const language = window.navigator.language.slice(0, 2)
+ const height = screen.height
+ const width = screen.width
+ const colorDepth = window.screen.colorDepth
+ const userAgent = navigator.userAgent
+ const date = new Date()
+ const timezoneOffset = date.getTimezoneOffset()
+
+ form?.setAttribute('data-payment-language', language);
+ form?.setAttribute('data-payment-height', String(height));
+ form?.setAttribute('data-payment-width', String(width));
+ form?.setAttribute('data-payment-colorDepth', String(colorDepth));
+ form?.setAttribute('data-payment-userAgent', userAgent);
+ form?.setAttribute('data-payment-date', date.toISOString());
+ form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset));
+}
+
+// Máscara para número de cartão de crédito
+function lknCreditCardMask(inputHTML) {
+ let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+ cardNumber = cardNumber.slice(0, 16);
+ const cardNumberArr = cardNumber.split('');
+ const resultArr = [];
+
+ // Aplicar máscara ao número do cartão de crédito
+ for (let i = 0; i < cardNumberArr.length; i++) {
+ resultArr.push(cardNumberArr[i]);
+
+ // Adicionar espaços a cada 4 dígitos
+ if ((i + 1) % 4 === 0 && i < 15) {
+ resultArr.push(' ');
+ }
+ }
+
+ inputHTML.target.value = resultArr.join('');
+}
+
+// Formatar entrada para apenas números
+function lknFormatNumbers(inputHTML) {
+ inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+}
+
+function lknCVVMask(inputHTML) {
+ let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+
+ // Limitar o CVV a 4 dígitos
+ if (cvv.length > 4) {
+ cvv = cvv.slice(0, 4);
+ }
+
+ inputHTML.target.value = cvv;
+}
+
+function lknNameValidation(inputHTML) {
+ let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços
+
+ inputHTML.target.value = name;
+}
+
+// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano
+function lknApplyDateMask(inputHTML) {
+ let currentDate = new Date(); // Obter a data atual
+ let currentYear = currentDate.getFullYear();
+ let currentMonth = currentDate.getMonth() + 1;
+
+ let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos
+ let maskedValue = '';
+
+ // Limitar o comprimento máximo do valor
+ value = value.slice(0, 6);
+
+ for (let i = 0; i < value.length; i++) {
+ if (i === 2) {
+ // Adicionar barra após os dois primeiros caracteres (mês)
+ maskedValue += ' / ';
+ }
+
+ // Validar o mês (deve ser entre 01 e 12)
+ if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ break;
+ }
+
+ // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6)
+ maskedValue += value[i];
+ }
+
+ // Validar o ano (deve ser igual ou posterior ao ano atual)
+ if (maskedValue.length === 9) {
+ const inputYear = parseInt(maskedValue.slice(5, 9));
+ if (inputYear < currentYear) {
+ maskedValue = ''; // Limpar o valor se o ano for inválido
+ } else if (inputYear === currentYear) {
+ // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual
+ const inputMonth = parseInt(maskedValue.slice(0, 2));
+ if (inputMonth < currentMonth) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ }
+ }
+ }
+
+ inputHTML.target.value = maskedValue;
+}
+
+function lknSetBorderColorOninput(inputHTML) {
+ inputHTML.style.borderColor = '#666';
+ inputHTML.setAttribute('aria-invalid', 'false')
+}
+
+function lknSetBorderIfEmpty(elementId) {
+ const element = document.getElementById(elementId);
+ if (element && !element.value.trim()) {
+ element.style.borderColor = 'red';
+ element.setAttribute('aria-invalid', 'true');
+ }
+}
+
+function lknSetDataCard(values) {
+ // Obter referência para todos os campos de entrada
+ const cardNumElement = document.getElementById('card_number');
+ const cardCVCElement = document.getElementById('card_cvc');
+ const cardNameElement = document.getElementById('give-card-name-field');
+ const cardExpirationElement = document.getElementById('card_expiry');
+
+ // Verificar se os elementos existem antes de acessar seus valores
+ if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) {
+ throw new Error('Um ou mais campos de cartão não encontrados.');
+ }
+
+ // Obter os valores dos campos de entrada
+ const cardNum = cardNumElement.value;
+ const cardCVC = cardCVCElement.value;
+ const cardName = cardNameElement.value;
+ const cardExpiration = cardExpirationElement.value;
+
+ // Verificar se algum campo está vazio
+ if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') {
+ // Definir a borda como vermelha para os campos vazios
+ lknSetBorderIfEmpty('card_number');
+ lknSetBorderIfEmpty('card_cvc');
+ lknSetBorderIfEmpty('give-card-name-field');
+ lknSetBorderIfEmpty('card_expiry');
+ throw new Error('Por favor, preencha todos os campos obrigatórios.');
+ } else {
+ // Todos os campos estão preenchidos, atribuir valores ao objeto 'values'
+ values.paymentCardNum = cardNum;
+ values.paymentCardCVC = cardCVC;
+ values.paymentCardName = cardName;
+ values.paymentCardExp = cardExpiration;
+ }
+}
+
+function lknCreditGet3DSvalue(values) {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const paymentLanguage = form?.getAttribute('data-payment-language');
+ const paymentHeight = form?.getAttribute('data-payment-height');
+ const paymentWidth = form?.getAttribute('data-payment-width');
+ const paymentColorDepth = form?.getAttribute('data-payment-colorDepth');
+ const paymentUserAgent = form?.getAttribute('data-payment-userAgent');
+ const paymentDate = form?.getAttribute('data-payment-date');
+ const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset');
+
+ // Verifica se as informações estão presentes antes de usá-las
+ if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) {
+ values.paymentLanguage = paymentLanguage
+ values.paymentHeight = paymentHeight
+ values.paymentWidth = paymentWidth
+ values.paymentColorDepth = paymentColorDepth
+ values.paymentUserAgent = paymentUserAgent
+ values.paymentDate = paymentDate
+ values.paymentTimezoneOffset = paymentTimezoneOffset
+ }else {
+ throw new Error('Dados do 3DS não inseridos');
+ }
+}
+
+const lkn_erede_credit = {
+ id: 'lkn_erede_credit',
+ async initialize() {
+ },
+ async beforeCreatePayment(values) {
+
+ lknSetDataCard(values);
+ lknCreditGet3DSvalue(values);
+
+ if (values.firstname === 'error') {
+ throw new Error('Gateway failed');
+ }
+
+ return {
+ ...values
+ };
+ },
+ async afterCreatePayment(response) {
+ },
+ Fields() {
+ setTimeout(() => {
+ lknCreditSet3DSvalue(); // Chamar a função após o atraso de 1 segundo
+ }, 1000);
+
+ function isSSL() {
+ return window.location.protocol === 'https:';
+ }
+
+ // retorna no front as mensagens de erro
+ function lknPrintFrontendNotice(title, message) {
+ return (
+
+ {title} {message}
+
+ )
+ }
+
+ if (!isSSL()) {
+ return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).');
+ } else {
+ return (
+
+ )
+ }
+ },
+};
+
+window.givewp.gateways.register(lkn_erede_credit);
\ No newline at end of file
diff --git a/Public/js/plugin-debit-script.js b/Public/js/plugin-debit-script.js
new file mode 100644
index 0000000..29aa903
--- /dev/null
+++ b/Public/js/plugin-debit-script.js
@@ -0,0 +1,346 @@
+function lknSet3DSvalue() {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const language = window.navigator.language.slice(0, 2);
+ const height = screen.height;
+ const width = screen.width;
+ const colorDepth = window.screen.colorDepth;
+ const userAgent = navigator.userAgent;
+ const date = new Date();
+ const timezoneOffset = date.getTimezoneOffset();
+ form?.setAttribute('data-payment-language', language);
+ form?.setAttribute('data-payment-height', String(height));
+ form?.setAttribute('data-payment-width', String(width));
+ form?.setAttribute('data-payment-colorDepth', String(colorDepth));
+ form?.setAttribute('data-payment-userAgent', userAgent);
+ form?.setAttribute('data-payment-date', date.toISOString());
+ form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset));
+}
+
+// Máscara para número de cartão de débito
+function lknDebitCardMask(inputHTML) {
+ let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+ cardNumber = cardNumber.slice(0, 16);
+ const cardNumberArr = cardNumber.split('');
+ const resultArr = [];
+
+ // Aplicar máscara ao número do cartão de débito
+ for (let i = 0; i < cardNumberArr.length; i++) {
+ resultArr.push(cardNumberArr[i]);
+
+ // Adicionar espaços a cada 4 dígitos
+ if ((i + 1) % 4 === 0 && i < 15) {
+ resultArr.push(' ');
+ }
+ }
+ inputHTML.target.value = resultArr.join('');
+}
+
+// Formatar entrada para apenas números
+function lknFormatNumbers(inputHTML) {
+ inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+}
+
+function lknCVVMask(inputHTML) {
+ let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+
+ // Limitar o CVV a 4 dígitos
+ if (cvv.length > 4) {
+ cvv = cvv.slice(0, 4);
+ }
+ inputHTML.target.value = cvv;
+}
+function lknNameValidation(inputHTML) {
+ let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços
+
+ inputHTML.target.value = name;
+}
+
+// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano
+function lknApplyDateMask(inputHTML) {
+ let currentDate = new Date(); // Obter a data atual
+ let currentYear = currentDate.getFullYear();
+ let currentMonth = currentDate.getMonth() + 1;
+ let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos
+ let maskedValue = '';
+
+ // Limitar o comprimento máximo do valor
+ value = value.slice(0, 6);
+ for (let i = 0; i < value.length; i++) {
+ if (i === 2) {
+ // Adicionar barra após os dois primeiros caracteres (mês)
+ maskedValue += ' / ';
+ }
+
+ // Validar o mês (deve ser entre 01 e 12)
+ if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ break;
+ }
+
+ // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6)
+ maskedValue += value[i];
+ }
+
+ // Validar o ano (deve ser igual ou posterior ao ano atual)
+ if (maskedValue.length === 9) {
+ const inputYear = parseInt(maskedValue.slice(5, 9));
+ if (inputYear < currentYear) {
+ maskedValue = ''; // Limpar o valor se o ano for inválido
+ } else if (inputYear === currentYear) {
+ // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual
+ const inputMonth = parseInt(maskedValue.slice(0, 2));
+ if (inputMonth < currentMonth) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ }
+ }
+ }
+
+ inputHTML.target.value = maskedValue;
+}
+function lknSetBorderColorOninput(inputHTML) {
+ inputHTML.style.borderColor = '#666';
+ inputHTML.setAttribute('aria-invalid', 'false');
+}
+function lknSetBorderIfEmpty(elementId) {
+ const element = document.getElementById(elementId);
+ if (element && !element.value.trim()) {
+ element.style.borderColor = 'red';
+ element.setAttribute('aria-invalid', 'true');
+ }
+}
+function lknSetDataCard(values) {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+
+ // Obter referência para todos os campos de entrada
+ const cardNumElement = document.getElementById('card_number');
+ const cardCVCElement = document.getElementById('card_cvc');
+ const cardNameElement = document.getElementById('give-card-name-field');
+ const cardExpirationElement = document.getElementById('card_expiry');
+
+ // Verificar se os elementos existem antes de acessar seus valores
+ if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) {
+ throw new Error('Um ou mais campos de cartão não encontrados.');
+ }
+
+ // Obter os valores dos campos de entrada
+ const cardNum = cardNumElement.value;
+ const cardCVC = cardCVCElement.value;
+ const cardName = cardNameElement.value;
+ const cardExpiration = cardExpirationElement.value;
+
+ // Verificar se algum campo está vazio
+ if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') {
+ // Definir a borda como vermelha para os campos vazios
+ lknSetBorderIfEmpty('card_number');
+ lknSetBorderIfEmpty('card_cvc');
+ lknSetBorderIfEmpty('give-card-name-field');
+ lknSetBorderIfEmpty('card_expiry');
+ throw new Error('Por favor, preencha todos os campos obrigatórios.');
+ } else {
+ // Todos os campos estão preenchidos, atribuir valores ao objeto 'values'
+ values.paymentCardNum = cardNum;
+ values.paymentCardCVC = cardCVC;
+ values.paymentCardName = cardName;
+ values.paymentCardExp = cardExpiration;
+ }
+}
+function lknGet3DSvalue(values) {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const paymentLanguage = form?.getAttribute('data-payment-language');
+ const paymentHeight = form?.getAttribute('data-payment-height');
+ const paymentWidth = form?.getAttribute('data-payment-width');
+ const paymentColorDepth = form?.getAttribute('data-payment-colorDepth');
+ const paymentUserAgent = form?.getAttribute('data-payment-userAgent');
+ const paymentDate = form?.getAttribute('data-payment-date');
+ const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset');
+
+ // Verifica se as informações estão presentes antes de usá-las
+ if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) {
+ values.paymentLanguage = paymentLanguage;
+ values.paymentHeight = paymentHeight;
+ values.paymentWidth = paymentWidth;
+ values.paymentColorDepth = paymentColorDepth;
+ values.paymentUserAgent = paymentUserAgent;
+ values.paymentDate = paymentDate;
+ values.paymentTimezoneOffset = paymentTimezoneOffset;
+ } else {
+ throw new Error('Dados do 3DS não inseridos');
+ }
+}
+const lkn_erede_debit_3ds = {
+ id: 'lkn_erede_debit_3ds',
+ async initialize() {},
+ async beforeCreatePayment(values) {
+ lknSetDataCard(values);
+ lknGet3DSvalue(values);
+ if (values.firstname === 'error') {
+ throw new Error('Gateway failed');
+ }
+ return {
+ ...values
+ };
+ },
+ async afterCreatePayment(response) {},
+ Fields() {
+ setTimeout(() => {
+ lknSet3DSvalue(); // Chamar a função após o atraso de 1 segundo
+ }, 1000);
+ function isSSL() {
+ return window.location.protocol === 'https:';
+ }
+
+ // retorna no front as mensagens de erro
+ function lknPrintFrontendNotice(title, message) {
+ return /*#__PURE__*/React.createElement("div", {
+ className: "error-notice"
+ }, /*#__PURE__*/React.createElement("strong", null, title), " ", message);
+ }
+ if (!isSSL()) {
+ return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).');
+ } else {
+ return /*#__PURE__*/React.createElement("fieldset", {
+ className: "give-do-validate",
+ id: "give_dc_fields"
+ }, /*#__PURE__*/React.createElement("legend", {
+ style: {
+ fontSize: 'large'
+ }
+ }, "Informa\xE7\xF5es de cart\xE3o de d\xE9bito"), /*#__PURE__*/React.createElement("div", {
+ id: "give_secure_site_wrapper"
+ }, /*#__PURE__*/React.createElement("span", {
+ class: "give-icon padlock"
+ }), /*#__PURE__*/React.createElement("span", {
+ style: {
+ display: 'block',
+ padding: '20px',
+ textAlign: 'center'
+ }
+ }, "Doa\xE7\xE3o Segura por Criptografia SSL")), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-number-wrap",
+ class: "form-row form-row-two-thirds form-row-responsive give-lkn-cielo-api-cc-field-wrap"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "card_number",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "N\xFAmero do cart\xE3o", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip hint--top hint--medium hint--bounce",
+ "aria-label": "Normalmente possui 16 digitos na frente do seu cart\xE3o de d\xE9bito.",
+ rel: "tooltip"
+ }, /*#__PURE__*/React.createElement("i", {
+ class: "give-icon give-icon-question"
+ }))), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknFormatNumbers(e), lknDebitCardMask(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ autocomplete: "off",
+ name: "card_number",
+ id: "card_number",
+ class: "card-number give-input required",
+ placeholder: "N\xFAmero do cart\xE3o",
+ "aria-required": "true"
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-expiration-wrap",
+ class: "card-expiration form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "give-card-expiration-field",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "Expira\xE7\xE3o", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip give-icon give-icon-question",
+ "data-tooltip": "A data de expira\xE7\xE3o do cart\xE3o de d\xE9bito, geralmente na frente do cart\xE3o."
+ })), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknApplyDateMask(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ autocomplete: "off",
+ name: "card_expiry",
+ id: "card_expiry",
+ class: "card-expiry give-input required",
+ placeholder: "MM / AAAA",
+ "aria-required": "true"
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-name-wrap",
+ class: "form-row form-row-two-thirds form-row-responsive"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "give-card-name-field",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "Nome do t\xEDtular do cart\xE3o", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip give-icon give-icon-question",
+ "data-tooltip": "O nome do titular da conta do cart\xE3o de d\xE9bito."
+ })), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknNameValidation(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ autocomplete: "off",
+ id: "give-card-name-field",
+ name: "card_name",
+ class: "card-name give-input required",
+ placeholder: "Nome do titular do cart\xE3o",
+ "aria-required": "true"
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-cvc-wrap",
+ class: "form-row form-row-one-third form-row-responsive give-lkn-cielo-api-cc-field-wrap"
+ }, /*#__PURE__*/React.createElement("span", {
+ for: "give-card-cvc-field",
+ class: "give-label",
+ style: {
+ display: 'block',
+ padding: '10 0'
+ }
+ }, "CVV", /*#__PURE__*/React.createElement("span", {
+ class: "give-required-indicator",
+ style: {
+ color: 'red'
+ }
+ }, " *"), /*#__PURE__*/React.createElement("span", {
+ class: "give-tooltip give-icon give-icon-question",
+ "data-tooltip": "S\xE3o os 3 ou 4 d\xEDgitos que est\xE3o atr\xE1s do seu cart\xE3o de d\xE9bito."
+ })), /*#__PURE__*/React.createElement("div", {
+ id: "give-card-cvc-field",
+ class: "input empty give-lkn-cielo-api-cc-field give-lkn-cielo-api-card-cvc-field"
+ }), /*#__PURE__*/React.createElement("input", {
+ onInput: e => {
+ lknCVVMask(e), lknSetBorderColorOninput(e.target);
+ },
+ type: "text",
+ size: "4",
+ maxlength: "4",
+ autocomplete: "off",
+ name: "card_cvc",
+ id: "card_cvc",
+ class: "give-input required",
+ placeholder: "CVV",
+ "aria-required": "true"
+ })));
+ }
+ }
+};
+window.givewp.gateways.register(lkn_erede_debit_3ds);
\ No newline at end of file
diff --git a/Public/js/plugin-debit-script.tsx b/Public/js/plugin-debit-script.tsx
new file mode 100644
index 0000000..8cb2ab5
--- /dev/null
+++ b/Public/js/plugin-debit-script.tsx
@@ -0,0 +1,321 @@
+function lknSet3DSvalue() {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const language = window.navigator.language.slice(0, 2)
+ const height = screen.height
+ const width = screen.width
+ const colorDepth = window.screen.colorDepth
+ const userAgent = navigator.userAgent
+ const date = new Date()
+ const timezoneOffset = date.getTimezoneOffset()
+
+ form?.setAttribute('data-payment-language', language);
+ form?.setAttribute('data-payment-height', String(height));
+ form?.setAttribute('data-payment-width', String(width));
+ form?.setAttribute('data-payment-colorDepth', String(colorDepth));
+ form?.setAttribute('data-payment-userAgent', userAgent);
+ form?.setAttribute('data-payment-date', date.toISOString());
+ form?.setAttribute('data-payment-timezoneOffset', String(timezoneOffset));
+}
+
+// Máscara para número de cartão de débito
+function lknDebitCardMask(inputHTML) {
+ let cardNumber = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+ cardNumber = cardNumber.slice(0, 16);
+ const cardNumberArr = cardNumber.split('');
+ const resultArr = [];
+
+ // Aplicar máscara ao número do cartão de débito
+ for (let i = 0; i < cardNumberArr.length; i++) {
+ resultArr.push(cardNumberArr[i]);
+
+ // Adicionar espaços a cada 4 dígitos
+ if ((i + 1) % 4 === 0 && i < 15) {
+ resultArr.push(' ');
+ }
+ }
+
+ inputHTML.target.value = resultArr.join('');
+}
+
+// Formatar entrada para apenas números
+function lknFormatNumbers(inputHTML) {
+ inputHTML.target.value = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+}
+
+function lknCVVMask(inputHTML) {
+ let cvv = inputHTML.target.value.replace(/\D/gmi, ''); // Remover caracteres não numéricos
+
+ // Limitar o CVV a 4 dígitos
+ if (cvv.length > 4) {
+ cvv = cvv.slice(0, 4);
+ }
+
+ inputHTML.target.value = cvv;
+}
+
+function lknNameValidation(inputHTML) {
+ let name = inputHTML.target.value.replace(/[^A-Za-z\s]/g, ''); // Remover caracteres que não sejam letras ou espaços
+
+ inputHTML.target.value = name;
+}
+
+// Função para aplicar máscara "XX / XXXX" para mês e ano, com validação de mês e ano
+function lknApplyDateMask(inputHTML) {
+ let currentDate = new Date(); // Obter a data atual
+ let currentYear = currentDate.getFullYear();
+ let currentMonth = currentDate.getMonth() + 1;
+
+ let value = inputHTML.target.value.replace(/\D/g, ''); // Remover caracteres não numéricos
+ let maskedValue = '';
+
+ // Limitar o comprimento máximo do valor
+ value = value.slice(0, 6);
+
+ for (let i = 0; i < value.length; i++) {
+ if (i === 2) {
+ // Adicionar barra após os dois primeiros caracteres (mês)
+ maskedValue += ' / ';
+ }
+
+ // Validar o mês (deve ser entre 01 e 12)
+ if (i === 2 && (value.slice(0, 2) < '01' || value.slice(0, 2) > '12')) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ break;
+ }
+
+ // Adicionar apenas números para os caracteres de mês (do índice 0 ao 1) e ano (do índice 3 ao 6)
+ maskedValue += value[i];
+ }
+
+ // Validar o ano (deve ser igual ou posterior ao ano atual)
+ if (maskedValue.length === 9) {
+ const inputYear = parseInt(maskedValue.slice(5, 9));
+ if (inputYear < currentYear) {
+ maskedValue = ''; // Limpar o valor se o ano for inválido
+ } else if (inputYear === currentYear) {
+ // Se o ano for igual ao atual, validar o mês para garantir que seja igual ou posterior ao mês atual
+ const inputMonth = parseInt(maskedValue.slice(0, 2));
+ if (inputMonth < currentMonth) {
+ maskedValue = ''; // Limpar o valor se o mês for inválido
+ }
+ }
+ }
+
+ inputHTML.target.value = maskedValue;
+}
+
+function lknSetBorderColorOninput(inputHTML) {
+ inputHTML.style.borderColor = '#666';
+ inputHTML.setAttribute('aria-invalid', 'false')
+}
+
+function lknSetBorderIfEmpty(elementId) {
+ const element = document.getElementById(elementId);
+ if (element && !element.value.trim()) {
+ element.style.borderColor = 'red';
+ element.setAttribute('aria-invalid', 'true');
+ }
+}
+
+function lknSetDataCard(values) {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+
+ // Obter referência para todos os campos de entrada
+ const cardNumElement = document.getElementById('card_number');
+ const cardCVCElement = document.getElementById('card_cvc');
+ const cardNameElement = document.getElementById('give-card-name-field');
+ const cardExpirationElement = document.getElementById('card_expiry');
+
+ // Verificar se os elementos existem antes de acessar seus valores
+ if (!cardNumElement || !cardCVCElement || !cardNameElement || !cardExpirationElement) {
+ throw new Error('Um ou mais campos de cartão não encontrados.');
+ }
+
+ // Obter os valores dos campos de entrada
+ const cardNum = cardNumElement.value;
+ const cardCVC = cardCVCElement.value;
+ const cardName = cardNameElement.value;
+ const cardExpiration = cardExpirationElement.value;
+
+ // Verificar se algum campo está vazio
+ if (cardNum.trim() === '' || cardCVC.trim() === '' || cardName.trim() === '' || cardExpiration.trim() === '') {
+ // Definir a borda como vermelha para os campos vazios
+ lknSetBorderIfEmpty('card_number');
+ lknSetBorderIfEmpty('card_cvc');
+ lknSetBorderIfEmpty('give-card-name-field');
+ lknSetBorderIfEmpty('card_expiry');
+ throw new Error('Por favor, preencha todos os campos obrigatórios.');
+ } else {
+ // Todos os campos estão preenchidos, atribuir valores ao objeto 'values'
+ values.paymentCardNum = cardNum;
+ values.paymentCardCVC = cardCVC;
+ values.paymentCardName = cardName;
+ values.paymentCardExp = cardExpiration;
+ }
+}
+
+function lknGet3DSvalue(values) {
+ const form = document.querySelector('button[type="submit"]')?.closest('form');
+ const paymentLanguage = form?.getAttribute('data-payment-language');
+ const paymentHeight = form?.getAttribute('data-payment-height');
+ const paymentWidth = form?.getAttribute('data-payment-width');
+ const paymentColorDepth = form?.getAttribute('data-payment-colorDepth');
+ const paymentUserAgent = form?.getAttribute('data-payment-userAgent');
+ const paymentDate = form?.getAttribute('data-payment-date');
+ const paymentTimezoneOffset = form?.getAttribute('data-payment-timezoneOffset');
+
+ // Verifica se as informações estão presentes antes de usá-las
+ if (paymentLanguage && paymentHeight && paymentWidth && paymentColorDepth && paymentUserAgent && paymentDate && paymentTimezoneOffset) {
+ values.paymentLanguage = paymentLanguage
+ values.paymentHeight = paymentHeight
+ values.paymentWidth = paymentWidth
+ values.paymentColorDepth = paymentColorDepth
+ values.paymentUserAgent = paymentUserAgent
+ values.paymentDate = paymentDate
+ values.paymentTimezoneOffset = paymentTimezoneOffset
+ }else {
+ throw new Error('Dados do 3DS não inseridos');
+ }
+}
+
+const lkn_erede_debit_3ds = {
+ id: 'lkn_erede_debit_3ds',
+ async initialize() {
+ },
+ async beforeCreatePayment(values) {
+
+ lknSetDataCard(values);
+ lknGet3DSvalue(values);
+
+ if (values.firstname === 'error') {
+ throw new Error('Gateway failed');
+ }
+
+ return {
+ ...values
+ };
+ },
+ async afterCreatePayment(response) {
+ },
+ Fields() {
+ setTimeout(() => {
+ lknSet3DSvalue(); // Chamar a função após o atraso de 1 segundo
+ }, 1000);
+
+ function isSSL() {
+ return window.location.protocol === 'https:';
+ }
+
+ // retorna no front as mensagens de erro
+ function lknPrintFrontendNotice(title, message) {
+ return (
+
+ {title} {message}
+
+ )
+ }
+
+ if (!isSSL()) {
+ return lknPrintFrontendNotice('Erro:', 'Doação desabilitada por falta de SSL (HTTPS).');
+ } else {
+ return (
+
+ )
+ }
+ },
+};
+
+window.givewp.gateways.register(lkn_erede_debit_3ds);
\ No newline at end of file
diff --git a/README.md b/README.md
index aaa9042..1d3a854 100755
--- a/README.md
+++ b/README.md
@@ -1,51 +1,51 @@
-# payment-erede-for-givewp
-Cartão de crédito e débito para GiveWP utilizando E-Rede https://www.linknacional.com.br/wordpress/givewp/
-
-## Descrição
-
-Apresentando o plugin Payment Gateway E-Rede for GiveWP – sua solução perfeita para processar com segurança pagamentos com cartão de crédito e débito em seus esforços de arrecadação de fundos com tecnologia WordPress. Este plugin robusto amplia a funcionalidade do GiveWP, o plugin líder de gerenciamento de doações, integrando perfeitamente a API E-Rede como um método de pagamento confiável.
-
-Características principais:
-
-1. **Integração sem esforço**: Este plugin integra facilmente os poderosos recursos de processamento de pagamentos do E-Rede em seus formulários de doação GiveWP, fornecendo aos seus apoiadores uma opção de pagamento conveniente e segura.
-
-2. **Transações Seguras**: Garanta tranquilidade aos seus doadores com as robustas medidas de segurança do E-Rede, protegendo todas as transações e protegendo os dados confidenciais do titular do cartão.
-
-3. **Configuração fácil de usar**: Configurar o E-Rede como um gateway de pagamento para seus formulários GiveWP é muito fácil. Nosso assistente de configuração intuitivo orienta você durante o processo, garantindo uma integração rápida e descomplicada.
-
-4. **Experiência de doação transparente**: os doadores agora podem contribuir de forma integrada, escolhendo entre uma variedade de métodos de pagamento, incluindo cartões de crédito e débito. O plugin oferece uma experiência de checkout tranquila e familiar.
-
-Dê aos seus doadores a conveniência e segurança que eles merecem enquanto gerencia perfeitamente seus esforços de arrecadação de fundos com o plugin Payment Gateway E-Rede for GiveWP. Eleve sua experiência de doações on-line e veja suas campanhas de arrecadação de fundos prosperarem.
-
-**Dependências**
-
-O plugin Payment Gateway E-Rede for GiveWP depende do [plugin GiveWP](https://wordpress.org/plugins/give/), certifique-se de que o GiveWP esteja instalado e configurado corretamente.
-
-Este plugin requer uma [conta E-Rede](https://developer.userede.com.br/) ativa para processamento de pagamentos.
-
-**Instruções do usuário**
-
-1. Acesse o menu de configurações do GiveWP;
-
-2. Procure pela aba ‘Gateways de pagamento’;
-
-3. Ative a forma de pagamento com cartão de crédito ou débito para seus formulários de doação;
-
-4. Salvar;
-
-5. Acesse a aba E-Rede API - Cartão de crédito ou E-Rede API - Cartão de débito 3DS;
-
-6. Preencha o formulário com suas credenciais do E-Rede;
-
-7. Salve.
-
-## Instalação
-
-1. Carregue `payment-erede-for-givewp.zip` para o diretório `/wp-content/plugins/`;
-2. Ative o plugin através do menu ‘Plugins’ do WordPress.
-
-## Perguntas frequentes
-
-### Como posso obter minhas credenciais de produção do E-Rede?
-
-Para obter suas credenciais de produção do E-Rede você precisará seguir [este guia](https://developer.userede.com.br/e-rede#documentacao-credenciamento).
+# payment-erede-for-givewp
+Cartão de crédito e débito para GiveWP utilizando E-Rede https://www.linknacional.com.br/wordpress/givewp/
+
+## Descrição
+
+Apresentando o plugin Payment Gateway E-Rede for GiveWP – sua solução perfeita para processar com segurança pagamentos com cartão de crédito e débito em seus esforços de arrecadação de fundos com tecnologia WordPress. Este plugin robusto amplia a funcionalidade do GiveWP, o plugin líder de gerenciamento de doações, integrando perfeitamente a API E-Rede como um método de pagamento confiável.
+
+Características principais:
+
+1. **Integração sem esforço**: Este plugin integra facilmente os poderosos recursos de processamento de pagamentos do E-Rede em seus formulários de doação GiveWP, fornecendo aos seus apoiadores uma opção de pagamento conveniente e segura.
+
+2. **Transações Seguras**: Garanta tranquilidade aos seus doadores com as robustas medidas de segurança do E-Rede, protegendo todas as transações e protegendo os dados confidenciais do titular do cartão.
+
+3. **Configuração fácil de usar**: Configurar o E-Rede como um gateway de pagamento para seus formulários GiveWP é muito fácil. Nosso assistente de configuração intuitivo orienta você durante o processo, garantindo uma integração rápida e descomplicada.
+
+4. **Experiência de doação transparente**: os doadores agora podem contribuir de forma integrada, escolhendo entre uma variedade de métodos de pagamento, incluindo cartões de crédito e débito. O plugin oferece uma experiência de checkout tranquila e familiar.
+
+Dê aos seus doadores a conveniência e segurança que eles merecem enquanto gerencia perfeitamente seus esforços de arrecadação de fundos com o plugin Payment Gateway E-Rede for GiveWP. Eleve sua experiência de doações on-line e veja suas campanhas de arrecadação de fundos prosperarem.
+
+**Dependências**
+
+O plugin Payment Gateway E-Rede for GiveWP depende do [plugin GiveWP](https://wordpress.org/plugins/give/), certifique-se de que o GiveWP esteja instalado e configurado corretamente.
+
+Este plugin requer uma [conta E-Rede](https://developer.userede.com.br/) ativa para processamento de pagamentos.
+
+**Instruções do usuário**
+
+1. Acesse o menu de configurações do GiveWP;
+
+2. Procure pela aba ‘Gateways de pagamento’;
+
+3. Ative a forma de pagamento com cartão de crédito ou débito para seus formulários de doação;
+
+4. Salvar;
+
+5. Acesse a aba E-Rede API - Cartão de crédito ou E-Rede API - Cartão de débito 3DS;
+
+6. Preencha o formulário com suas credenciais do E-Rede;
+
+7. Salve.
+
+## Instalação
+
+1. Carregue `payment-erede-for-givewp.zip` para o diretório `/wp-content/plugins/`;
+2. Ative o plugin através do menu ‘Plugins’ do WordPress.
+
+## Perguntas frequentes
+
+### Como posso obter minhas credenciais de produção do E-Rede?
+
+Para obter suas credenciais de produção do E-Rede você precisará seguir [este guia](https://developer.userede.com.br/e-rede#documentacao-credenciamento).
diff --git a/README.txt b/README.txt
index 0622d63..a7f3304 100644
--- a/README.txt
+++ b/README.txt
@@ -1,84 +1,90 @@
-=== Payment Gateway E-Rede for GiveWP ===
-Contributors: linknacional
-Donate link: https://www.linknacional.com.br/wordpress/plugins/
-Tags: payment, donation, givewp, credit, debit, card
-Requires at least: 5.7
-Requires PHP: 7.4
-Tested up to: 6.3
-Stable tag: 1.0.2
-License: GPLv3 or later
-License URI: http://www.gnu.org/licenses/gpl-3.0.html
-
-Credit and debit card payment using E-Rede
-
-== Description ==
-
-Introducing the Payment Gateway E-Rede for GiveWP plugin – your seamless solution for securely processing credit and debit card payments within your WordPress-powered fundraising efforts. This robust plugin extends the functionality of GiveWP, the leading donations management plugin, by seamlessly integrating E-Rede API as a trusted payment method.
-
-Key Features:
-
-1. **Effortless Integration**: This plugin effortlessly integrates E-Rede's powerful payment processing capabilities into your GiveWP donation forms, providing your supporters with a convenient and secure payment option.
-
-2. **Secure Transactions**: Ensure peace of mind for your donors with E-Rede's robust security measures, safeguarding every transaction and protecting sensitive cardholder data.
-
-3. **User-Friendly Setup**: Setting up E-Rede as a payment gateway for your GiveWP forms is a breeze. Our intuitive configuration wizard guides you through the process, ensuring quick and hassle-free integration.
-
-4. **Seamless Donation Experience**: Donors can now contribute seamlessly, choosing from a range of payment methods including credit and debit cards. The plugin provides a smooth and familiar checkout experience.
-
-Give your donors the convenience and security they deserve while seamlessly managing your fundraising efforts with the Payment Gateway E-Rede for GiveWP plugin. Elevate your online donations experience and watch your fundraising campaigns thrive.
-
-**Dependencies**
-
-Payment Gateway E-Rede for GiveWP plugin is dependent on [GiveWP plugin](https://wordpress.org/plugins/give/), please make sure GiveWP is installed and properly configured.
-
-This plugin requires an active [E-Rede account](https://developer.userede.com.br/) for payment processing.
-
-**User instructions**
-
-1. Go to GiveWP settings menu;
-
-2. Search for the 'Payment gateways' tab;
-
-3. Activate the credit or debit card payment method for your donation forms;
-
-4. Save;
-
-5. Go to the E-Rede API - Credit card or E-Rede API - Debit card 3DS tab;
-
-6. Fill the form with your E-Rede credentials;
-
-7. Save.
-
-== Installation ==
-
-1. Upload `payment-erede-for-givewp.zip` to the `/wp-content/plugins/` directory;
-2. Activate the plugin through the 'Plugins' menu in WordPress.
-
-== Frequently Asked Questions ==
-
-= How can I get my E-Rede production credentials? =
-
-To get your E-Rede production credentials you will need to follow [this guide](https://developer.userede.com.br/e-rede#documentacao-credenciamento).
-
-== Screenshots ==
-
-1. None
-
-== Changelog ==
-
-= 1.0.2 =
-**22/09/2023**
-* Fix a bug in translation.
-
-= 1.0.1 =
-**20/09/2023**
-* Fix a bug with front-end inputs.
-
-= 1.0.0 =
-**04/09/2023**
-* Plugin launch.
-
-== Upgrade Notice ==
-
-= 1.0.0 =
-* Plugin launch.
+=== Payment Gateway E-Rede for GiveWP ===
+Contributors: linknacional
+Donate link: https://www.linknacional.com.br/wordpress/plugins/
+Tags: payment, donation, givewp, credit, debit, card
+Requires at least: 5.7
+Requires PHP: 7.4
+Tested up to: 6.3
+Stable tag: 2.0.0
+License: GPLv3 or later
+License URI: http://www.gnu.org/licenses/gpl-3.0.html
+
+Credit and debit card payment using E-Rede
+
+== Description ==
+
+Introducing the Payment Gateway E-Rede for GiveWP plugin – your seamless solution for securely processing credit and debit card payments within your WordPress-powered fundraising efforts. This robust plugin extends the functionality of GiveWP, the leading donations management plugin, by seamlessly integrating E-Rede API as a trusted payment method.
+
+Key Features:
+
+1. **Effortless Integration**: This plugin effortlessly integrates E-Rede's powerful payment processing capabilities into your GiveWP donation forms, providing your supporters with a convenient and secure payment option.
+
+2. **Secure Transactions**: Ensure peace of mind for your donors with E-Rede's robust security measures, safeguarding every transaction and protecting sensitive cardholder data.
+
+3. **User-Friendly Setup**: Setting up E-Rede as a payment gateway for your GiveWP forms is a breeze. Our intuitive configuration wizard guides you through the process, ensuring quick and hassle-free integration.
+
+4. **Seamless Donation Experience**: Donors can now contribute seamlessly, choosing from a range of payment methods including credit and debit cards. The plugin provides a smooth and familiar checkout experience.
+
+Give your donors the convenience and security they deserve while seamlessly managing your fundraising efforts with the Payment Gateway E-Rede for GiveWP plugin. Elevate your online donations experience and watch your fundraising campaigns thrive.
+
+**Dependencies**
+
+Payment Gateway E-Rede for GiveWP plugin is dependent on [GiveWP plugin](https://wordpress.org/plugins/give/), please make sure GiveWP is installed and properly configured.
+
+This plugin requires an active [E-Rede account](https://developer.userede.com.br/) for payment processing.
+
+**User instructions**
+
+1. Go to GiveWP settings menu;
+
+2. Search for the 'Payment gateways' tab;
+
+3. Activate the credit or debit card payment method for your donation forms;
+
+4. Save;
+
+5. Go to the E-Rede API - Credit card or E-Rede API - Debit card 3DS tab;
+
+6. Fill the form with your E-Rede credentials;
+
+7. Save.
+
+== Installation ==
+
+1. Upload `payment-erede-for-givewp.zip` to the `/wp-content/plugins/` directory;
+2. Activate the plugin through the 'Plugins' menu in WordPress.
+
+== Frequently Asked Questions ==
+
+= How can I get my E-Rede production credentials? =
+
+To get your E-Rede production credentials you will need to follow [this guide](https://developer.userede.com.br/e-rede#documentacao-credenciamento).
+
+== Screenshots ==
+
+1. None
+
+== Changelog ==
+
+= 2.0.0 =
+**14/05/2024**
+* Added compatibility with GiveWP 3.0.0 template.
+* General plugin optimizations.
+* Addition of 3DS 2.0 for credit card payments.
+
+= 1.0.2 =
+**22/09/2023**
+* Fix a bug in translation.
+
+= 1.0.1 =
+**20/09/2023**
+* Fix a bug with front-end inputs.
+
+= 1.0.0 =
+**04/09/2023**
+* Plugin launch.
+
+== Upgrade Notice ==
+
+= 1.0.0 =
+* Plugin launch.
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..9e2f467
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,23 @@
+{
+ "name": "lkn/payment-erede-for-givewp",
+ "type": "project",
+ "license": "Proprietary",
+ "autoload": {
+ "psr-4": {
+ "Lkn\\PaymentEredeForGivewp\\Includes\\": "Includes/",
+ "Lkn\\PaymentEredeForGivewp\\Admin\\": "Admin/",
+ "Lkn\\PaymentEredeForGivewp\\PublicView\\": "Public/"
+ }
+ },
+ "authors": [
+ {
+ "name": "Link Nacional",
+ "email": "ticket@linknacional.com"
+ }
+ ],
+ "minimum-stability": "stable",
+ "require-dev": {
+ "phan/phan": "5.4.1"
+ },
+ "require": {}
+}
\ No newline at end of file
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000..31d6cbe
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,1742 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "b3dd06a1ba5ace6fe8abbd242caeae61",
+ "packages": [],
+ "packages-dev": [
+ {
+ "name": "composer/pcre",
+ "version": "3.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8",
+ "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.3",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "symfony/phpunit-bridge": "^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/3.1.3"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-03-19T10:26:25+00:00"
+ },
+ {
+ "name": "composer/semver",
+ "version": "3.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/semver.git",
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.4",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Semver\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nils Adermann",
+ "email": "naderman@naderman.de",
+ "homepage": "http://www.naderman.de"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ },
+ {
+ "name": "Rob Bast",
+ "email": "rob.bast@gmail.com",
+ "homepage": "http://robbast.nl"
+ }
+ ],
+ "description": "Semver library that offers utilities, version constraint parsing and validation.",
+ "keywords": [
+ "semantic",
+ "semver",
+ "validation",
+ "versioning"
+ ],
+ "support": {
+ "irc": "ircs://irc.libera.chat:6697/composer",
+ "issues": "https://github.com/composer/semver/issues",
+ "source": "https://github.com/composer/semver/tree/3.4.0"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-08-31T09:50:34+00:00"
+ },
+ {
+ "name": "composer/xdebug-handler",
+ "version": "3.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/xdebug-handler.git",
+ "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/4f988f8fdf580d53bdb2d1278fe93d1ed5462255",
+ "reference": "4f988f8fdf580d53bdb2d1278fe93d1ed5462255",
+ "shasum": ""
+ },
+ "require": {
+ "composer/pcre": "^1 || ^2 || ^3",
+ "php": "^7.2.5 || ^8.0",
+ "psr/log": "^1 || ^2 || ^3"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Composer\\XdebugHandler\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "John Stevenson",
+ "email": "john-stevenson@blueyonder.co.uk"
+ }
+ ],
+ "description": "Restarts a process without Xdebug.",
+ "keywords": [
+ "Xdebug",
+ "performance"
+ ],
+ "support": {
+ "irc": "ircs://irc.libera.chat:6697/composer",
+ "issues": "https://github.com/composer/xdebug-handler/issues",
+ "source": "https://github.com/composer/xdebug-handler/tree/3.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-03-26T18:29:49+00:00"
+ },
+ {
+ "name": "doctrine/deprecations",
+ "version": "1.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/deprecations.git",
+ "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
+ "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/coding-standard": "^9",
+ "phpstan/phpstan": "1.4.10 || 1.10.15",
+ "phpstan/phpstan-phpunit": "^1.0",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "psalm/plugin-phpunit": "0.18.4",
+ "psr/log": "^1 || ^2 || ^3",
+ "vimeo/psalm": "4.30.0 || 5.12.0"
+ },
+ "suggest": {
+ "psr/log": "Allows logging deprecations via PSR-3 logger implementation"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
+ "homepage": "https://www.doctrine-project.org/",
+ "support": {
+ "issues": "https://github.com/doctrine/deprecations/issues",
+ "source": "https://github.com/doctrine/deprecations/tree/1.1.3"
+ },
+ "time": "2024-01-30T19:34:25+00:00"
+ },
+ {
+ "name": "felixfbecker/advanced-json-rpc",
+ "version": "v3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git",
+ "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447",
+ "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447",
+ "shasum": ""
+ },
+ "require": {
+ "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
+ "php": "^7.1 || ^8.0",
+ "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.0 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "AdvancedJsonRpc\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "ISC"
+ ],
+ "authors": [
+ {
+ "name": "Felix Becker",
+ "email": "felix.b@outlook.com"
+ }
+ ],
+ "description": "A more advanced JSONRPC implementation",
+ "support": {
+ "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues",
+ "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1"
+ },
+ "time": "2021-06-11T22:34:44+00:00"
+ },
+ {
+ "name": "microsoft/tolerant-php-parser",
+ "version": "v0.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/microsoft/tolerant-php-parser.git",
+ "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/microsoft/tolerant-php-parser/zipball/6a965617cf484355048ac6d2d3de7b6ec93abb16",
+ "reference": "6a965617cf484355048ac6d2d3de7b6ec93abb16",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5.15"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Microsoft\\PhpParser\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Rob Lourens",
+ "email": "roblou@microsoft.com"
+ }
+ ],
+ "description": "Tolerant PHP-to-AST parser designed for IDE usage scenarios",
+ "support": {
+ "issues": "https://github.com/microsoft/tolerant-php-parser/issues",
+ "source": "https://github.com/microsoft/tolerant-php-parser/tree/v0.1.1"
+ },
+ "time": "2021-07-16T21:28:12+00:00"
+ },
+ {
+ "name": "netresearch/jsonmapper",
+ "version": "v4.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/cweiske/jsonmapper.git",
+ "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0",
+ "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-reflection": "*",
+ "ext-spl": "*",
+ "php": ">=7.1"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0 || ~10.0",
+ "squizlabs/php_codesniffer": "~3.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "JsonMapper": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "OSL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Christian Weiske",
+ "email": "cweiske@cweiske.de",
+ "homepage": "http://github.com/cweiske/jsonmapper/",
+ "role": "Developer"
+ }
+ ],
+ "description": "Map nested JSON structures onto PHP classes",
+ "support": {
+ "email": "cweiske@cweiske.de",
+ "issues": "https://github.com/cweiske/jsonmapper/issues",
+ "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1"
+ },
+ "time": "2024-01-31T06:18:54+00:00"
+ },
+ {
+ "name": "phan/phan",
+ "version": "5.4.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phan/phan.git",
+ "reference": "fef40178a952bcfcc3f69b76989dd613c3d5c759"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phan/phan/zipball/fef40178a952bcfcc3f69b76989dd613c3d5c759",
+ "reference": "fef40178a952bcfcc3f69b76989dd613c3d5c759",
+ "shasum": ""
+ },
+ "require": {
+ "composer/semver": "^1.4|^2.0|^3.0",
+ "composer/xdebug-handler": "^2.0|^3.0",
+ "ext-filter": "*",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "felixfbecker/advanced-json-rpc": "^3.0.4",
+ "microsoft/tolerant-php-parser": "0.1.1",
+ "netresearch/jsonmapper": "^1.6.0|^2.0|^3.0|^4.0",
+ "php": "^7.2.0|^8.0.0",
+ "sabre/event": "^5.1.3",
+ "symfony/console": "^3.2|^4.0|^5.0|^6.0",
+ "symfony/polyfill-mbstring": "^1.11.0",
+ "symfony/polyfill-php80": "^1.20.0",
+ "tysonandre/var_representation_polyfill": "^0.0.2|^0.1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5.0"
+ },
+ "suggest": {
+ "ext-ast": "Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.16+ is recommended.",
+ "ext-iconv": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8",
+ "ext-igbinary": "Improves performance of polyfill when ext-ast is unavailable",
+ "ext-mbstring": "Either iconv or mbstring is needed to ensure issue messages are valid utf-8",
+ "ext-tokenizer": "Needed for fallback/polyfill parser support and file/line-based suppressions.",
+ "ext-var_representation": "Suggested for converting values to strings in issue messages"
+ },
+ "bin": [
+ "phan",
+ "phan_client",
+ "tocheckstyle"
+ ],
+ "type": "project",
+ "autoload": {
+ "psr-4": {
+ "Phan\\": "src/Phan"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Tyson Andre"
+ },
+ {
+ "name": "Rasmus Lerdorf"
+ },
+ {
+ "name": "Andrew S. Morrison"
+ }
+ ],
+ "description": "A static analyzer for PHP",
+ "keywords": [
+ "analyzer",
+ "php",
+ "static"
+ ],
+ "support": {
+ "issues": "https://github.com/phan/phan/issues",
+ "source": "https://github.com/phan/phan/tree/5.4.1"
+ },
+ "time": "2022-08-26T00:49:07+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-common",
+ "version": "2.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+ "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
+ "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-2.x": "2.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+ "homepage": "http://www.phpdoc.org",
+ "keywords": [
+ "FQSEN",
+ "phpDocumentor",
+ "phpdoc",
+ "reflection",
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
+ "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
+ },
+ "time": "2020-06-27T09:03:43+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-docblock",
+ "version": "5.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+ "reference": "298d2febfe79d03fe714eb871d5538da55205b1a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/298d2febfe79d03fe714eb871d5538da55205b1a",
+ "reference": "298d2febfe79d03fe714eb871d5538da55205b1a",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/deprecations": "^1.1",
+ "ext-filter": "*",
+ "php": "^7.4 || ^8.0",
+ "phpdocumentor/reflection-common": "^2.2",
+ "phpdocumentor/type-resolver": "^1.7",
+ "phpstan/phpdoc-parser": "^1.7",
+ "webmozart/assert": "^1.9.1"
+ },
+ "require-dev": {
+ "mockery/mockery": "~1.3.5",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan": "^1.8",
+ "phpstan/phpstan-mockery": "^1.1",
+ "phpstan/phpstan-webmozart-assert": "^1.2",
+ "phpunit/phpunit": "^9.5",
+ "vimeo/psalm": "^5.13"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ },
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+ "support": {
+ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.0"
+ },
+ "time": "2024-04-09T21:13:58+00:00"
+ },
+ {
+ "name": "phpdocumentor/type-resolver",
+ "version": "1.8.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/TypeResolver.git",
+ "reference": "153ae662783729388a584b4361f2545e4d841e3c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c",
+ "reference": "153ae662783729388a584b4361f2545e4d841e3c",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/deprecations": "^1.0",
+ "php": "^7.3 || ^8.0",
+ "phpdocumentor/reflection-common": "^2.0",
+ "phpstan/phpdoc-parser": "^1.13"
+ },
+ "require-dev": {
+ "ext-tokenizer": "*",
+ "phpbench/phpbench": "^1.2",
+ "phpstan/extension-installer": "^1.1",
+ "phpstan/phpstan": "^1.8",
+ "phpstan/phpstan-phpunit": "^1.1",
+ "phpunit/phpunit": "^9.5",
+ "rector/rector": "^0.13.9",
+ "vimeo/psalm": "^4.25"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-1.x": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
+ "support": {
+ "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2"
+ },
+ "time": "2024-02-23T11:10:43+00:00"
+ },
+ {
+ "name": "phpstan/phpdoc-parser",
+ "version": "1.28.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpdoc-parser.git",
+ "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb",
+ "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "doctrine/annotations": "^2.0",
+ "nikic/php-parser": "^4.15",
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^1.5",
+ "phpstan/phpstan-phpunit": "^1.1",
+ "phpstan/phpstan-strict-rules": "^1.0",
+ "phpunit/phpunit": "^9.5",
+ "symfony/process": "^5.2"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "PHPStan\\PhpDocParser\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPDoc parser with support for nullable, intersection and generic types",
+ "support": {
+ "issues": "https://github.com/phpstan/phpdoc-parser/issues",
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0"
+ },
+ "time": "2024-04-03T18:51:33+00:00"
+ },
+ {
+ "name": "psr/container",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Container\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
+ "keywords": [
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
+ ],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/2.0.2"
+ },
+ "time": "2021-11-05T16:47:00+00:00"
+ },
+ {
+ "name": "psr/log",
+ "version": "3.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/log/tree/3.0.0"
+ },
+ "time": "2021-07-14T16:46:02+00:00"
+ },
+ {
+ "name": "sabre/event",
+ "version": "5.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabre-io/event.git",
+ "reference": "d7da22897125d34d7eddf7977758191c06a74497"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497",
+ "reference": "d7da22897125d34d7eddf7977758191c06a74497",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "friendsofphp/php-cs-fixer": "~2.17.1",
+ "phpstan/phpstan": "^0.12",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "lib/coroutine.php",
+ "lib/Loop/functions.php",
+ "lib/Promise/functions.php"
+ ],
+ "psr-4": {
+ "Sabre\\Event\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Evert Pot",
+ "email": "me@evertpot.com",
+ "homepage": "http://evertpot.com/",
+ "role": "Developer"
+ }
+ ],
+ "description": "sabre/event is a library for lightweight event-based programming",
+ "homepage": "http://sabre.io/event/",
+ "keywords": [
+ "EventEmitter",
+ "async",
+ "coroutine",
+ "eventloop",
+ "events",
+ "hooks",
+ "plugin",
+ "promise",
+ "reactor",
+ "signal"
+ ],
+ "support": {
+ "forum": "https://groups.google.com/group/sabredav-discuss",
+ "issues": "https://github.com/sabre-io/event/issues",
+ "source": "https://github.com/fruux/sabre-event"
+ },
+ "time": "2021-11-04T06:51:17+00:00"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v6.4.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "a2708a5da5c87d1d0d52937bdeac625df659e11f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/a2708a5da5c87d1d0d52937bdeac625df659e11f",
+ "reference": "a2708a5da5c87d1d0d52937bdeac625df659e11f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "symfony/deprecation-contracts": "^2.5|^3",
+ "symfony/polyfill-mbstring": "~1.0",
+ "symfony/service-contracts": "^2.5|^3",
+ "symfony/string": "^5.4|^6.0|^7.0"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<5.4",
+ "symfony/dotenv": "<5.4",
+ "symfony/event-dispatcher": "<5.4",
+ "symfony/lock": "<5.4",
+ "symfony/process": "<5.4"
+ },
+ "provide": {
+ "psr/log-implementation": "1.0|2.0|3.0"
+ },
+ "require-dev": {
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^5.4|^6.0|^7.0",
+ "symfony/dependency-injection": "^5.4|^6.0|^7.0",
+ "symfony/event-dispatcher": "^5.4|^6.0|^7.0",
+ "symfony/http-foundation": "^6.4|^7.0",
+ "symfony/http-kernel": "^6.4|^7.0",
+ "symfony/lock": "^5.4|^6.0|^7.0",
+ "symfony/messenger": "^5.4|^6.0|^7.0",
+ "symfony/process": "^5.4|^6.0|^7.0",
+ "symfony/stopwatch": "^5.4|^6.0|^7.0",
+ "symfony/var-dumper": "^5.4|^6.0|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Eases the creation of beautiful and testable command line interfaces",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "cli",
+ "command-line",
+ "console",
+ "terminal"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/console/tree/v6.4.6"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-03-29T19:07:53+00:00"
+ },
+ {
+ "name": "symfony/deprecation-contracts",
+ "version": "v3.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/deprecation-contracts.git",
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
+ "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.4-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "files": [
+ "function.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "A generic function and convention to trigger deprecation notices",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-05-23T14:45:45+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.29.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4",
+ "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-ctype": "*"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-29T20:11:03+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-grapheme",
+ "version": "v1.29.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f",
+ "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's grapheme_* functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "grapheme",
+ "intl",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-29T20:11:03+00:00"
+ },
+ {
+ "name": "symfony/polyfill-intl-normalizer",
+ "version": "v1.29.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d",
+ "reference": "bc45c394692b948b4d383a08d7753968bed9a83d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "suggest": {
+ "ext-intl": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for intl's Normalizer class and related functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "intl",
+ "normalizer",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-29T20:11:03+00:00"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.29.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "provide": {
+ "ext-mbstring": "*"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-29T20:11:03+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php80",
+ "version": "v1.29.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php80.git",
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1"
+ },
+ "type": "library",
+ "extra": {
+ "thanks": {
+ "name": "symfony/polyfill",
+ "url": "https://github.com/symfony/polyfill"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Php80\\": ""
+ },
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Ion Bazan",
+ "email": "ion.bazan@gmail.com"
+ },
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-01-29T20:11:03+00:00"
+ },
+ {
+ "name": "symfony/service-contracts",
+ "version": "v3.4.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/service-contracts.git",
+ "reference": "11bbf19a0fb7b36345861e85c5768844c552906e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/11bbf19a0fb7b36345861e85c5768844c552906e",
+ "reference": "11bbf19a0fb7b36345861e85c5768844c552906e",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "psr/container": "^1.1|^2.0"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.4-dev"
+ },
+ "thanks": {
+ "name": "symfony/contracts",
+ "url": "https://github.com/symfony/contracts"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Contracts\\Service\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Test/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Generic abstractions related to writing services",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "abstractions",
+ "contracts",
+ "decoupling",
+ "interfaces",
+ "interoperability",
+ "standards"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/service-contracts/tree/v3.4.2"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-12-19T21:51:00+00:00"
+ },
+ {
+ "name": "symfony/string",
+ "version": "v6.4.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/string.git",
+ "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/string/zipball/4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9",
+ "reference": "4e465a95bdc32f49cf4c7f07f751b843bbd6dcd9",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-intl-grapheme": "~1.0",
+ "symfony/polyfill-intl-normalizer": "~1.0",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "conflict": {
+ "symfony/translation-contracts": "<2.5"
+ },
+ "require-dev": {
+ "symfony/error-handler": "^5.4|^6.0|^7.0",
+ "symfony/http-client": "^5.4|^6.0|^7.0",
+ "symfony/intl": "^6.2|^7.0",
+ "symfony/translation-contracts": "^2.5|^3.0",
+ "symfony/var-exporter": "^5.4|^6.0|^7.0"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "Resources/functions.php"
+ ],
+ "psr-4": {
+ "Symfony\\Component\\String\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "grapheme",
+ "i18n",
+ "string",
+ "unicode",
+ "utf-8",
+ "utf8"
+ ],
+ "support": {
+ "source": "https://github.com/symfony/string/tree/v6.4.4"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2024-02-01T13:16:41+00:00"
+ },
+ {
+ "name": "tysonandre/var_representation_polyfill",
+ "version": "0.1.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/TysonAndre/var_representation_polyfill.git",
+ "reference": "e9116c2c352bb0835ca428b442dde7767c11ad32"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/TysonAndre/var_representation_polyfill/zipball/e9116c2c352bb0835ca428b442dde7767c11ad32",
+ "reference": "e9116c2c352bb0835ca428b442dde7767c11ad32",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": "^7.2.0|^8.0.0"
+ },
+ "provide": {
+ "ext-var_representation": "*"
+ },
+ "require-dev": {
+ "phan/phan": "^5.4.1",
+ "phpunit/phpunit": "^8.5.0"
+ },
+ "suggest": {
+ "ext-var_representation": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "0.1.3-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/var_representation.php"
+ ],
+ "psr-4": {
+ "VarRepresentation\\": "src/VarRepresentation"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Tyson Andre"
+ }
+ ],
+ "description": "Polyfill for var_representation: convert a variable to a string in a way that fixes the shortcomings of var_export",
+ "keywords": [
+ "var_export",
+ "var_representation"
+ ],
+ "support": {
+ "issues": "https://github.com/TysonAndre/var_representation_polyfill/issues",
+ "source": "https://github.com/TysonAndre/var_representation_polyfill/tree/0.1.3"
+ },
+ "time": "2022-08-31T12:59:22+00:00"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.11.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozarts/assert.git",
+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991",
+ "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<0.12.20",
+ "vimeo/psalm": "<4.6.1 || 4.6.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5.13"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.10-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "support": {
+ "issues": "https://github.com/webmozarts/assert/issues",
+ "source": "https://github.com/webmozarts/assert/tree/1.11.0"
+ },
+ "time": "2022-06-03T18:03:27+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": [],
+ "platform-dev": [],
+ "plugin-api-version": "2.6.0"
+}
diff --git a/includes/class-payment-erede-for-givewp.php b/includes/class-payment-erede-for-givewp.php
deleted file mode 100644
index dd912c8..0000000
--- a/includes/class-payment-erede-for-givewp.php
+++ /dev/null
@@ -1,667 +0,0 @@
-
- */
-class Payment_Erede_For_Givewp {
- /**
- * The loader that's responsible for maintaining and registering all hooks that power
- * the plugin.
- *
- * @since 1.0.0
- * @access protected
- * @var Payment_Erede_For_Givewp_Loader $loader Maintains and registers all hooks for the plugin.
- */
- protected $loader;
-
- /**
- * The unique identifier of this plugin.
- *
- * @since 1.0.0
- * @access protected
- * @var string $plugin_name The string used to uniquely identify this plugin.
- */
- protected $plugin_name;
-
- /**
- * The current version of the plugin.
- *
- * @since 1.0.0
- * @access protected
- * @var string $version The current version of the plugin.
- */
- protected $version;
-
- /**
- * Define the core functionality of the plugin.
- *
- * Set the plugin name and the plugin version that can be used throughout the plugin.
- * Load the dependencies, define the locale, and set the hooks for the admin area and
- * the public-facing side of the site.
- *
- * @since 1.0.0
- */
- public function __construct() {
- if ( defined( 'PAYMENT_EREDE_FOR_GIVEWP_VERSION' ) ) {
- $this->version = PAYMENT_EREDE_FOR_GIVEWP_VERSION;
- } else {
- $this->version = '1.0.0';
- }
- $this->plugin_name = 'payment-erede-for-givewp';
-
- $this->load_dependencies();
- $this->set_locale();
- $this->define_admin_hooks();
- $this->define_public_hooks();
- $this->schedule_events();
- }
-
- public function schedule_events() : void {
- if ( ! wp_next_scheduled( 'lkn_payment_erede_cron_delete_logs' ) ) {
- wp_schedule_event( time() + 604800, 'weekly', 'lkn_payment_erede_cron_delete_logs' );
- }
-
- if ( ! wp_next_scheduled( 'lkn_payment_erede_cron_verify_payment' ) ) {
- wp_schedule_event( time() + 60, 'every_minute', 'lkn_payment_erede_cron_verify_payment' );
- }
- }
-
- public function verify_payment() :bool {
- $paymentsToVerify = give_get_option('lkn_erede_debit_3ds_payments_pending', '');
-
- if (empty($paymentsToVerify)) {
- $paymentsToVerify = array();
- } else {
- $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true);
- }
-
- $paymentCounter = count($paymentsToVerify);
-
- if ($paymentCounter > 0) {
- $configs = Payment_Erede_For_Givewp_Helper::get_configs('debit-3ds');
- $authorization = base64_encode( $configs['pv'] . ':' . $configs['token'] );
- $paymentsToValidate = array();
- $logname = date('d.m.Y-H.i.s') . '-debit-3ds-verification';
-
- $headers = array(
- 'Authorization' => 'Basic ' . $authorization,
- 'Content-Type' => 'application/json'
- );
-
- for ($c = 0; $c < $paymentCounter; $c++) {
- $responseRaw = wp_remote_get($configs['api_url'] . '?reference=' . $paymentsToVerify[$c]['id'], array(
- 'headers' => $headers
- ));
-
- $response = json_decode(wp_remote_retrieve_body($responseRaw));
-
- if ('enabled' === $configs['debug']) {
- Payment_Erede_For_Givewp_Helper::log('VERIFY PAYMENT - [Raw header]: ' . var_export(wp_remote_retrieve_headers($responseRaw) . \PHP_EOL . ' [INFO]: ' . var_export($paymentsToVerify, true), true) . \PHP_EOL . ' [BODY]: ' . var_export($response, true), $logname);
- }
-
- switch ($response->returnCode) {
- case '00':
- give_update_payment_status($paymentsToVerify[$c]['id'], 'publish');
-
- break;
- case '78':
- $counter = (int) ($paymentsToVerify[$c]['count']);
- $counter++;
-
- if ($counter > 5) {
- give_update_payment_status($paymentsToVerify[$c]['id'], 'failed');
- } else {
- $paymentsToValidate[] = array('id' => $paymentsToVerify[$c]['id'], 'count' => $counter);
- }
-
- break;
-
- default:
- give_update_payment_status($paymentsToVerify[$c]['id'], 'failed');
-
- break;
- }
- }
-
- if (count($paymentsToValidate) > 0) {
- $paymentsToValidate = base64_encode(json_encode($paymentsToValidate));
-
- give_update_option('lkn_erede_debit_3ds_payments_pending', $paymentsToValidate);
- } else {
- give_update_option('lkn_erede_debit_3ds_payments_pending', '');
- }
- }
-
- return true;
- }
-
- /**
- * Load the required dependencies for this plugin.
- *
- * Include the following files that make up the plugin:
- *
- * - Payment_Erede_For_Givewp_Loader. Orchestrates the hooks of the plugin.
- * - Payment_Erede_For_Givewp_i18n. Defines internationalization functionality.
- * - Payment_Erede_For_Givewp_Admin. Defines all hooks for the admin area.
- * - Payment_Erede_For_Givewp_Public. Defines all hooks for the public side of the site.
- *
- * Create an instance of the loader which will be used to register the hooks
- * with WordPress.
- *
- * @since 1.0.0
- * @access private
- */
- private function load_dependencies(): void {
- /**
- * The class responsible for plugin updater
- */
- include_once plugin_dir_path( __DIR__ ) . 'includes/plugin-updater/plugin-update-checker.php';
-
- /**
- * The class responsible for orchestrating the actions and filters of the
- * core plugin.
- */
- require_once plugin_dir_path( __DIR__ ) . 'includes/class-payment-erede-for-givewp-loader.php';
-
- /**
- * The class responsible for defining internationalization functionality
- * of the plugin.
- */
- require_once plugin_dir_path( __DIR__ ) . 'includes/class-payment-erede-for-givewp-i18n.php';
-
- /**
- * The class responsible for defining helpers functions
- */
- require_once plugin_dir_path( __DIR__ ) . 'includes/class-payment-erede-for-givewp-helper.php';
-
- /**
- * The class responsible for defining all actions that occur in the admin area.
- */
- require_once plugin_dir_path( __DIR__ ) . 'admin/class-payment-erede-for-givewp-admin.php';
-
- /**
- * The class responsible for defining all actions that occur in the public-facing
- * side of the site.
- */
- require_once plugin_dir_path( __DIR__ ) . 'public/class-payment-erede-for-givewp-public.php';
-
- $this->loader = new Payment_Erede_For_Givewp_Loader();
- }
-
- /**
- * Define the locale for this plugin for internationalization.
- *
- * Uses the Payment_Erede_For_Givewp_i18n class in order to set the domain and to register the hook
- * with WordPress.
- *
- * @since 1.0.0
- * @access private
- */
- private function set_locale(): void {
- $plugin_i18n = new Payment_Erede_For_Givewp_i18n();
-
- $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
- }
-
- public function process_debit_3ds_api_payment($payment_data) : void {
- // Set the configs values
- $configs = Payment_Erede_For_Givewp_Helper::get_configs('debit-3ds');
-
- // Validate nonce.
- give_validate_nonce($payment_data['gateway_nonce'], 'give-gateway');
-
- // Make sure we don't have any left over errors present.
- give_clear_errors();
-
- // Any errors?
- $errors = give_get_errors();
-
- if ($errors) {
- give_send_back_to_checkout('?payment-mode=' . $payment_data['post_data']['give-gateway'] . '&error-msg=Erro interno no processamento do pagamento, contate o suporte');
-
- exit;
- }
-
- // Setup the payment details.
- $payment_array = array(
- 'price' => $payment_data['price'],
- 'give_form_title' => $payment_data['post_data']['give-form-title'],
- 'give_form_id' => (int) ($payment_data['post_data']['give-form-id']),
- 'give_price_id' => isset($payment_data['post_data']['give-price-id']) ? $payment_data['post_data']['give-price-id'] : '',
- 'date' => $payment_data['date'],
- 'user_email' => $payment_data['user_email'],
- 'purchase_key' => $payment_data['purchase_key'],
- 'currency' => give_get_currency($payment_data['post_data']['give-form-id'], $payment_data),
- 'user_info' => $payment_data['user_info'],
- 'status' => 'pending',
- 'gateway' => 'lkn_erede_debit_3ds',
- );
-
- $headers = array(
- 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ),
- 'Content-Type' => 'application/json'
- );
-
- $currencyCode = give_get_currency($payment_data['post_data']['give-form-id'], $payment_data);
- $payment_id = give_insert_payment($payment_array);
- $amount = number_format($payment_data['price'], 2, '', '');
- $userAgent = $payment_data['post_data']['lkn_erede_debit_3ds_user_agent'];
- $colorDepth = $payment_data['post_data']['lkn_erede_debit_3ds_device_color'];
- $lang = $payment_data['post_data']['lkn_erede_debit_3ds_lang'];
- $height = $payment_data['post_data']['lkn_erede_debit_3ds_device_height'];
- $width = $payment_data['post_data']['lkn_erede_debit_3ds_device_width'];
- $timezone = $payment_data['post_data']['lkn_erede_debit_3ds_timezone'];
- $logname = date('d.m.Y-H.i.s') . '-debit-3ds';
-
- $card = array();
- $splitDate = explode('/', $payment_data['post_data']['lkn_erede_debit_3ds_card_expiry']);
- $card['expMonth'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[0]));
- $card['expYear'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[1]));
- $card['number'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_debit_3ds_card_number']));
- $card['cvv'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_debit_3ds_card_cvc']));
- $card['name'] = sanitize_text_field($payment_data['post_data']['lkn_erede_debit_3ds_card_name']);
-
- $body = array(
- 'capture' => true,
- 'kind' => 'debit',
- 'reference' => $payment_id,
- 'amount' => $amount,
- 'cardholderName' => $card['name'],
- 'cardNumber' => $card['number'],
- 'expirationMonth' => $card['expMonth'],
- 'expirationYear' => $card['expYear'],
- 'securityCode' => $card['cvv'],
- 'softDescriptor' => $configs['description'],
- 'threeDSecure' => array(
- 'embedded' => true,
- 'onFailure' => 'decline',
- 'userAgent' => $userAgent,
- 'device' => array(
- 'colorDepth' => $colorDepth,
- 'deviceType3ds' => 'BROWSER',
- 'javaEnabled' => false,
- 'language' => $lang,
- 'screenHeight' => $height,
- 'screenWidth' => $width,
- 'timeZoneOffset' => $timezone
- )
- ),
- 'urls' => array(
- array(
- 'kind' => 'threeDSecureSuccess',
- 'url' => give_get_success_page_uri()
- ),
- array(
- 'kind' => 'threeDSecureFailure',
- 'url' => give_get_failed_transaction_uri()
- )
- )
- );
-
- $body = apply_filters('lkn_erede_debit_3ds_body', $body, $currencyCode, $payment_data);
-
- $response = wp_remote_post($configs['api_url'], array(
- 'headers' => $headers,
- 'body' => json_encode($body)
- ));
-
- if ('enabled' === $configs['debug']) {
- Payment_Erede_For_Givewp_Helper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(wp_remote_retrieve_body($response), true), $logname);
- }
-
- $response = json_decode(wp_remote_retrieve_body($response));
-
- $arrMetaData = array(
- 'status' => $response->returnCode ?? '500',
- 'message' => $response->returnMessage ?? 'Error on processing payment',
- 'transaction_id' => $response->tid ?? '0',
- 'capture' => $body['capture']
- );
-
- if ('enabled' === $configs['debug']) {
- $arrMetaData['log'] = $logname;
- }
-
- give_update_payment_meta($payment_id, 'lkn_erede_response', json_encode($arrMetaData));
-
- switch ($response->returnCode) {
- case '200':
- give_update_payment_status($payment_id, 'publish');
-
- give_send_to_success_page();
-
- exit;
- case '220':
- $paymentsToVerify = give_get_option('lkn_erede_debit_3ds_payments_pending', '');
-
- if (empty($paymentsToVerify)) {
- $paymentsToVerify = array();
- } else {
- $paymentsToVerify = json_decode(base64_decode($paymentsToVerify, true), true);
- }
-
- $paymentsToVerify[] = array('id' => $payment_id, 'count' => '0');
- $paymentsToVerify = base64_encode(json_encode($paymentsToVerify));
- give_update_option('lkn_erede_debit_3ds_payments_pending', $paymentsToVerify);
-
- wp_redirect($response->threeDSecure->url);
-
- exit;
-
- default:
- give_update_payment_status($payment_id, 'failed');
-
- wp_redirect(give_get_failed_transaction_uri());
-
- exit;
- }
- }
-
- public function process_credit_api_payment($payment_data): void {
- // Set the configs values
- $configs = Payment_Erede_For_Givewp_Helper::get_configs('credit');
-
- // Validate nonce.
- give_validate_nonce($payment_data['gateway_nonce'], 'give-gateway');
-
- // Make sure we don't have any left over errors present.
- give_clear_errors();
-
- // Any errors?
- $errors = give_get_errors();
-
- if ($errors) {
- give_send_back_to_checkout('?payment-mode=' . $payment_data['post_data']['give-gateway'] . '&error-msg=Erro interno no processamento do pagamento, contate o suporte');
-
- exit;
- }
-
- // Setup the payment details.
- $payment_array = array(
- 'price' => $payment_data['price'],
- 'give_form_title' => $payment_data['post_data']['give-form-title'],
- 'give_form_id' => (int) ($payment_data['post_data']['give-form-id']),
- 'give_price_id' => isset($payment_data['post_data']['give-price-id']) ? $payment_data['post_data']['give-price-id'] : '',
- 'date' => $payment_data['date'],
- 'user_email' => $payment_data['user_email'],
- 'purchase_key' => $payment_data['purchase_key'],
- 'currency' => give_get_currency($payment_data['post_data']['give-form-id'], $payment_data),
- 'user_info' => $payment_data['user_info'],
- 'status' => 'pending',
- 'gateway' => 'lkn_erede_credit',
- );
-
- $headers = array(
- 'Authorization' => 'Basic ' . base64_encode( $configs['pv'] . ':' . $configs['token'] ),
- 'Content-Type' => 'application/json'
- );
-
- $currencyCode = give_get_currency($payment_data['post_data']['give-form-id'], $payment_data);
- $payment_id = give_insert_payment($payment_array);
- $amount = number_format($payment_data['price'], 2, '', '');
- $logname = date('d.m.Y-H.i.s') . '-credit';
-
- $card = array();
- $splitDate = explode('/', $payment_data['post_data']['lkn_erede_credit_card_expiry']);
- $card['expMonth'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[0]));
- $card['expYear'] = preg_replace('/\D/', '', sanitize_text_field($splitDate[1]));
- $card['number'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_credit_card_number']));
- $card['cvv'] = preg_replace('/\D/', '', sanitize_text_field($payment_data['post_data']['lkn_erede_credit_card_cvc']));
- $card['name'] = sanitize_text_field($payment_data['post_data']['lkn_erede_credit_card_name']);
-
- $body = array(
- 'capture' => true,
- 'kind' => 'credit',
- 'reference' => $payment_id,
- 'amount' => $amount,
- 'cardholderName' => $card['name'],
- 'cardNumber' => $card['number'],
- 'expirationMonth' => $card['expMonth'],
- 'expirationYear' => $card['expYear'],
- 'securityCode' => $card['cvv'],
- 'softDescriptor' => $configs['description'],
- 'subscription' => false,
- 'origin' => 1,
- 'distributorAffiliation' => 0,
- 'storageCard' => '0',
- 'transactionCredentials' => array(
- 'credentialId' => '01'
- )
- );
-
- $body = apply_filters('lkn_erede_credit_body', $body, $currencyCode, $payment_data);
-
- $response = wp_remote_post($configs['api_url'], array(
- 'headers' => $headers,
- 'body' => json_encode($body)
- ));
-
- if ('enabled' === $configs['debug']) {
- Payment_Erede_For_Givewp_Helper::log('[Raw header]: ' . var_export(wp_remote_retrieve_headers($response), true) . \PHP_EOL . ' [Raw body]: ' . var_export(wp_remote_retrieve_body($response), true), $logname);
- }
-
- $response = json_decode(wp_remote_retrieve_body($response));
-
- $arrMetaData = array(
- 'status' => $response->returnCode ?? '500',
- 'message' => $response->returnMessage ?? 'Error on processing payment',
- 'transaction_id' => $response->tid ?? '0',
- 'capture' => $body['capture']
- );
-
- if ('enabled' === $configs['debug']) {
- $arrMetaData['log'] = $logname;
- }
-
- give_update_payment_meta($payment_id, 'lkn_erede_response', json_encode($arrMetaData));
-
- switch ($response->returnCode) {
- case '00':
- give_update_payment_status($payment_id, 'publish');
-
- give_send_to_success_page();
-
- exit;
-
- default:
- give_update_payment_status($payment_id, 'failed');
-
- wp_redirect(give_get_failed_transaction_uri());
-
- exit;
- }
- }
-
- public function define_row_meta($plugin_meta, $plugin_file) :array {
- if ( ! defined(PAYMENT_EREDE_FOR_GIVEWP_BASENAME) && ! is_plugin_active(PAYMENT_EREDE_FOR_GIVEWP_BASENAME)) {
- return $plugin_meta;
- }
-
- $new_meta_links['setting'] = sprintf(
- '%2$s',
- admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways'),
- __('Settings', 'give')
- );
-
- return array_merge($plugin_meta, $new_meta_links);
- }
-
- public function check_environment() : bool {
- // Flag to check whether deactivate plugin or not.
- $is_deactivate_plugin = false;
-
- // Load plugin helper functions.
- if ( ! function_exists('deactivate_plugins') || ! function_exists('is_plugin_active')) {
- require_once ABSPATH . '/wp-admin/includes/plugin.php';
- }
-
- if (
- defined('GIVE_VERSION')
- && version_compare(GIVE_VERSION, PAYMENT_EREDE_FOR_GIVEWP_MIN_GIVE_VERSION, '<')
- ) {
- // Min. Give. plugin version.
-
- // Show admin notice.
- add_action('admin_notices', array('Payment_Erede_For_Givewp', 'givewp_dependency_notice'));
-
- $is_deactivate_plugin = true;
- }
-
- $is_give_active = defined('GIVE_PLUGIN_BASENAME') ? is_plugin_active(GIVE_PLUGIN_BASENAME) : false;
-
- if ( ! $is_give_active) {
- add_action('admin_notices', array('Payment_Erede_For_Givewp', 'givewp_dependency_notice'));
-
- $is_deactivate_plugin = true;
- }
-
- // Don't let this plugin activate.
- if ($is_deactivate_plugin) {
- // Deactivate plugin.
- deactivate_plugins(PAYMENT_EREDE_FOR_GIVEWP_BASENAME);
-
- if (isset($_GET['activate'])) {
- unset($_GET['activate']);
- }
- return false;
- }
-
- return true;
- }
-
- public static function givewp_dependency_notice(): void {
- // Admin notice.
- $message = sprintf(
- '