"Validation error: PayPal currencies do not match" in WooCommerce

"Validation error: PayPal currencies do not match" in WooCommerce

使用 WooCommerce 和标准的 PayPal 网关接受付款。在沙盒模式下测试时,一切正常。当我们用真实交易进行实时测试时,付款没有问题,但在 WooCommerce 中有如下注释:

"Validation error: PayPal currencies do not match (code USD). Order status changed from Processing to On Hold."

我们商店中没有多种货币。一切都设置为美元。 PayPal 设置为接受不同货币的付款并自动转换它们。我们没有安装货币转换插件。我们仔细检查了 API 设置(它们是正确的),我们生成了新的 API 密钥并再次尝试,我们在启用和不启用 IPN 的情况下进行了尝试。

付款是通过 Paypal 完成的,但我们在订单备注中仍然收到此错误,并且状态更改为 On-Hold 而不是 "Processing"。

我们也无法在 WooCommerce 中通过 PayPal 处理退款,我们收到 "Refund Failed" 消息。不确定这是否相关,但我们也想弄清楚。

我找到了这个问题的临时解决方案

转到“plugins/woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php”并像这样注释两行(行号:176 和 177)

//$this->validate_currency( $order, $posted['mc_currency'] );
//$this->validate_amount( $order, $posted['mc_gross'] );

来源:https://www.kapadiya.net/wordpress/woocommerce-paypal-for-inr/