我正在为WooCommerce创建一个自定义支付网关,但我正在努力显示管理区域的设置。
我遵循了如下教程:
https://docs.woocommerce.com/document/payment-gateway-api/
https://docs.woocommerce.com/document/settings-api/
https://rudrastyh.com/woocommerce/payment-gateway-plugin.html。
然而,在我的例子中,当我转到我的支付网关的设置页面时,admin_options从未被调用过。
支付网关在支付方式列表中。它也可以在前台显示为可选的支付方式。
在扩展WC_Payment_Gateway的类中,我已经将
public function admin_options() {
echo 'TEST';
die();
}其他方法,比如构造函数,init_form_fields都被调用了,所以至少有一部分是工作的。
任何关于可能发生的事情或如何解决这个问题的想法都是非常受欢迎的。
发布于 2020-08-27 04:14:06
$ allowed...making ->id包含一些大写的letters....it似乎并不是小写的,它解决了这个问题。
我被这篇文章中#Vishal的回答触发了:
WordPress Plugin WooCommerce, Custom Payment Gateway Settings Not Saving
https://stackoverflow.com/questions/63604821
复制相似问题