WordPress at Your Fingertips
function is not described

WC_Gateway_Paypal_IPN_Handler::validate_currency() protected WC 1.0

Check currency from IPN matches the order.

{} It's a method of the class: WC_Gateway_Paypal_IPN_Handler{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->validate_currency( $order, $currency );
$order(WC_Order) (required)
Order object.
$currency(string) (required)
Currency code.

Code of WC_Gateway_Paypal_IPN_Handler::validate_currency() WC 5.6.0

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;
	}
}