我正在构建自定义支付网关插件,提交下单后将具有iframe信用卡表格,我必须在javascript中绑定事件并在woocommerce中处理付款
public function process_payment( $order_id ) {
echo ' <script>
var success = function (response) {
// redirect to url and process the payment if succes
}
var failure = function (response) {
// redirect to url and process the payment if failure
}
submitallinfo(firstname,lats,etc);
</script>';
}