WC_Gateway_Paypal_IPN_Handler::validate_currency( WC_Order $order, string $currency )

Check currency from IPN matches the order.


Description Description


Parameters Parameters

$order

(Required) Order object.

$currency

(Required) Currency code.


Top ↑

Source Source

File: includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php

	protected function validate_currency( $order, $currency ) {
		if ( $order->get_currency() !== $currency ) {
			WC_Gateway_Paypal::log( 'Payment error: Currencies do not match (sent "' . $order->get_currency() . '" | returned "' . $currency . '")' );

			/* translators: %s: currency code. */
			$order->update_status( 'on-hold', sprintf( __( 'Validation error: PayPal currencies do not match (code %s).', 'woocommerce' ), $currency ) );
			exit;
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.