Submit
Path:
~
/
home
/
getwphos
/
public_html
/
BenjaminMarc-Struktur
/
wp-content
/
plugins
/
woocommerce
/
includes
/
File Content:
class-wc-payment-gateways.php
<?php /** * WooCommerce Payment Gateways * * Loads payment gateways via hooks for use in the store. * * @version 2.2.0 * @package WooCommerce\Classes\Payment */ defined( 'ABSPATH' ) || exit; /** * Payment gateways class. */ class WC_Payment_Gateways { /** * Payment gateway classes. * * @var array */ public $payment_gateways = array(); /** * The single instance of the class. * * @var WC_Payment_Gateways * @since 2.1.0 */ protected static $_instance = null; /** * Main WC_Payment_Gateways Instance. * * Ensures only one instance of WC_Payment_Gateways is loaded or can be loaded. * * @since 2.1 * @return WC_Payment_Gateways Main instance */ public static function instance() { if ( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } /** * Cloning is forbidden. * * @since 2.1 */ public function __clone() { wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woocommerce' ), '2.1' ); } /** * Unserializing instances of this class is forbidden. * * @since 2.1 */ public function __wakeup() { wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '2.1' ); } /** * Initialize payment gateways. */ public function __construct() { $this->init(); } /** * Load gateways and hook in functions. */ public function init() { $load_gateways = array( 'WC_Gateway_BACS', 'WC_Gateway_Cheque', 'WC_Gateway_COD', ); if ( $this->should_load_paypal_standard() ) { $load_gateways[] = 'WC_Gateway_Paypal'; } // Filter. $load_gateways = apply_filters( 'woocommerce_payment_gateways', $load_gateways ); // Get sort order option. $ordering = (array) get_option( 'woocommerce_gateway_order' ); $order_end = 999; // Load gateways in order. foreach ( $load_gateways as $gateway ) { if ( is_string( $gateway ) && class_exists( $gateway ) ) { $gateway = new $gateway(); } // Gateways need to be valid and extend WC_Payment_Gateway. if ( ! is_a( $gateway, 'WC_Payment_Gateway' ) ) { continue; } if ( isset( $ordering[ $gateway->id ] ) && is_numeric( $ordering[ $gateway->id ] ) ) { // Add in position. $this->payment_gateways[ $ordering[ $gateway->id ] ] = $gateway; } else { // Add to end of the array. $this->payment_gateways[ $order_end ] = $gateway; $order_end++; } } ksort( $this->payment_gateways ); } /** * Get gateways. * * @return array */ public function payment_gateways() { $_available_gateways = array(); if ( count( $this->payment_gateways ) > 0 ) { foreach ( $this->payment_gateways as $gateway ) { $_available_gateways[ $gateway->id ] = $gateway; } } return $_available_gateways; } /** * Get array of registered gateway ids * * @since 2.6.0 * @return array of strings */ public function get_payment_gateway_ids() { return wp_list_pluck( $this->payment_gateways, 'id' ); } /** * Get available gateways. * * @return array */ public function get_available_payment_gateways() { $_available_gateways = array(); foreach ( $this->payment_gateways as $gateway ) { if ( $gateway->is_available() ) { if ( ! is_add_payment_method_page() ) { $_available_gateways[ $gateway->id ] = $gateway; } elseif ( $gateway->supports( 'add_payment_method' ) || $gateway->supports( 'tokenization' ) ) { $_available_gateways[ $gateway->id ] = $gateway; } } } return array_filter( (array) apply_filters( 'woocommerce_available_payment_gateways', $_available_gateways ), array( $this, 'filter_valid_gateway_class' ) ); } /** * Callback for array filter. Returns true if gateway is of correct type. * * @since 3.6.0 * @param object $gateway Gateway to check. * @return bool */ protected function filter_valid_gateway_class( $gateway ) { return $gateway && is_a( $gateway, 'WC_Payment_Gateway' ); } /** * Set the current, active gateway. * * @param array $gateways Available payment gateways. */ public function set_current_gateway( $gateways ) { // Be on the defensive. if ( ! is_array( $gateways ) || empty( $gateways ) ) { return; } $current_gateway = false; if ( WC()->session ) { $current = WC()->session->get( 'chosen_payment_method' ); if ( $current && isset( $gateways[ $current ] ) ) { $current_gateway = $gateways[ $current ]; } } if ( ! $current_gateway ) { $current_gateway = current( $gateways ); } // Ensure we can make a call to set_current() without triggering an error. if ( $current_gateway && is_callable( array( $current_gateway, 'set_current' ) ) ) { $current_gateway->set_current(); } } /** * Save options in admin. */ public function process_admin_options() { $gateway_order = isset( $_POST['gateway_order'] ) ? wc_clean( wp_unslash( $_POST['gateway_order'] ) ) : ''; // WPCS: input var ok, CSRF ok. $order = array(); if ( is_array( $gateway_order ) && count( $gateway_order ) > 0 ) { $loop = 0; foreach ( $gateway_order as $gateway_id ) { $order[ esc_attr( $gateway_id ) ] = $loop; $loop++; } } update_option( 'woocommerce_gateway_order', $order ); } /** * Determines if PayPal Standard should be loaded. * * @since 5.5.0 * @return bool Whether PayPal Standard should be loaded or not. */ protected function should_load_paypal_standard() { $paypal = new WC_Gateway_Paypal(); return $paypal->should_load(); } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
abstracts
---
0755
admin
---
0755
blocks
---
0755
cli
---
0755
customizer
---
0755
data-stores
---
0755
emails
---
0755
export
---
0755
gateways
---
0755
import
---
0755
integrations
---
0755
interfaces
---
0755
legacy
---
0755
libraries
---
0755
log-handlers
---
0755
payment-tokens
---
0755
queue
---
0755
react-admin
---
0755
rest-api
---
0755
shipping
---
0755
shortcodes
---
0755
theme-support
---
0755
tracks
---
0755
traits
---
0755
walkers
---
0755
wccom-site
---
0755
widgets
---
0755
class-wc-ajax.php
116708 bytes
0644
class-wc-api.php
5106 bytes
0644
class-wc-auth.php
12880 bytes
0644
class-wc-autoloader.php
2810 bytes
0644
class-wc-background-emailer.php
4685 bytes
0644
class-wc-background-updater.php
3535 bytes
0644
class-wc-breadcrumb.php
9722 bytes
0644
class-wc-cache-helper.php
11047 bytes
0644
class-wc-cart-fees.php
3492 bytes
0644
class-wc-cart-session.php
16454 bytes
0644
class-wc-cart-totals.php
28927 bytes
0644
class-wc-cart.php
67036 bytes
0644
class-wc-checkout.php
47512 bytes
0644
class-wc-cli.php
1737 bytes
0644
class-wc-comments.php
16241 bytes
0644
class-wc-countries.php
49688 bytes
0644
class-wc-coupon.php
34816 bytes
0644
class-wc-customer-download-log.php
3452 bytes
0644
class-wc-customer-download.php
10702 bytes
0644
class-wc-customer.php
30004 bytes
0644
class-wc-data-exception.php
1321 bytes
0644
class-wc-data-store.php
6752 bytes
0644
class-wc-datetime.php
2310 bytes
0644
class-wc-deprecated-action-hooks.php
7042 bytes
0644
class-wc-deprecated-filter-hooks.php
7518 bytes
0644
class-wc-discounts.php
33735 bytes
0644
class-wc-download-handler.php
26080 bytes
0644
class-wc-emails.php
22995 bytes
0644
class-wc-embed.php
4284 bytes
0644
class-wc-form-handler.php
45236 bytes
0644
class-wc-frontend-scripts.php
27081 bytes
0644
class-wc-geo-ip.php
31140 bytes
0644
class-wc-geolite-integration.php
2036 bytes
0644
class-wc-geolocation.php
10693 bytes
0644
class-wc-https.php
4439 bytes
0644
class-wc-install.php
80882 bytes
0644
class-wc-integrations.php
1308 bytes
0644
class-wc-log-levels.php
2600 bytes
0644
class-wc-logger.php
8976 bytes
0644
class-wc-meta-data.php
2260 bytes
0644
class-wc-order-factory.php
8695 bytes
0644
class-wc-order-item-coupon.php
4175 bytes
0644
class-wc-order-item-fee.php
8972 bytes
0644
class-wc-order-item-meta.php
5942 bytes
0644
class-wc-order-item-product.php
13453 bytes
0644
class-wc-order-item-shipping.php
7969 bytes
0644
class-wc-order-item-tax.php
6644 bytes
0644
class-wc-order-item.php
11547 bytes
0644
class-wc-order-query.php
2615 bytes
0644
class-wc-order-refund.php
5762 bytes
0644
class-wc-order.php
69147 bytes
0644
class-wc-payment-gateways.php
5545 bytes
0644
class-wc-payment-tokens.php
6390 bytes
0644
class-wc-post-data.php
20973 bytes
0644
class-wc-post-types.php
28870 bytes
0644
class-wc-privacy-background-process.php
1707 bytes
0644
class-wc-privacy-erasers.php
13938 bytes
0644
class-wc-privacy-exporters.php
15044 bytes
0644
class-wc-privacy.php
16205 bytes
0644
class-wc-product-attribute.php
7137 bytes
0644
class-wc-product-download.php
12373 bytes
0644
class-wc-product-external.php
4955 bytes
0644
class-wc-product-factory.php
3668 bytes
0644
class-wc-product-grouped.php
5349 bytes
0644
class-wc-product-query.php
2231 bytes
0644
class-wc-product-simple.php
1938 bytes
0644
class-wc-product-variable.php
22513 bytes
0644
class-wc-product-variation.php
17271 bytes
0644
class-wc-query.php
33387 bytes
0644
class-wc-rate-limiter.php
4100 bytes
0644
class-wc-regenerate-images-request.php
7923 bytes
0644
class-wc-regenerate-images.php
15555 bytes
0644
class-wc-register-wp-admin-settings.php
5171 bytes
0644
class-wc-rest-authentication.php
20448 bytes
0644
class-wc-rest-exception.php
276 bytes
0644
class-wc-session-handler.php
14209 bytes
0644
class-wc-shipping-rate.php
5638 bytes
0644
class-wc-shipping-zone.php
13392 bytes
0644
class-wc-shipping-zones.php
4106 bytes
0644
class-wc-shipping.php
11846 bytes
0644
class-wc-shortcodes.php
17648 bytes
0644
class-wc-structured-data.php
17899 bytes
0644
class-wc-tax.php
37969 bytes
0644
class-wc-template-loader.php
21908 bytes
0644
class-wc-tracker.php
36953 bytes
0644
class-wc-validation.php
5875 bytes
0644
class-wc-webhook.php
30871 bytes
0644
class-woocommerce.php
37810 bytes
0644
wc-account-functions.php
13271 bytes
0644
wc-attribute-functions.php
21102 bytes
0644
wc-cart-functions.php
17776 bytes
0644
wc-conditional-functions.php
14178 bytes
0644
wc-core-functions.php
82151 bytes
0644
wc-coupon-functions.php
2819 bytes
0644
wc-deprecated-functions.php
33485 bytes
0644
wc-formatting-functions.php
45578 bytes
0644
wc-notice-functions.php
7971 bytes
0644
wc-order-functions.php
37957 bytes
0644
wc-order-item-functions.php
5153 bytes
0644
wc-page-functions.php
7099 bytes
0644
wc-product-functions.php
49914 bytes
0644
wc-rest-functions.php
11185 bytes
0644
wc-stock-functions.php
13866 bytes
0644
wc-template-functions.php
121869 bytes
0644
wc-template-hooks.php
12681 bytes
0644
wc-term-functions.php
21155 bytes
0644
wc-update-functions.php
80757 bytes
0644
wc-user-functions.php
29180 bytes
0644
wc-webhook-functions.php
5731 bytes
0644
wc-widget-functions.php
2063 bytes
0644
N4ST4R_ID | Naxtarrr