近期有WooCommerce的项目中PayPal 报错如下:
“Transaction CancelledError MessageThis function is temporarily unavailable. Please try your payment again later by returning to eBay and clicking the My eBay button.”
分析错误原因是因为WooCommerce使用了网址: website.com?cancel_order=true&order=order_number&order_id=160 而Paypal不支持此种调用方式。
解决方案如下:
1. 找到并打开文件: wp-content\plugins\woocommerce\includes\gateways\paypal\includes\class-wc-gateway-paypal-request.php
2. 查找这一行代码
'cancel_return' => esc_url_raw( $order->get_cancel_order_url_raw() ),
替换为
'cancel_return' => urlencode( $order->get_cancel_order_url_raw() ),
搞定!
未经允许不得转载:哈勃私语 » WooCommerce中PayPal错误:“Transaction Cancelled解决方案
本文共540个字 创建时间:2017年11月22日12:03