http:// mywebsiteurl / process-payment /?order-id = 138
这是我的网址,我需要处理 the payment using woocommerce payment gateway .
如果调用此网址,我想初始化付款 .
Below is my full code:
<?php
$orderId = $_GET['order-id'];
// // Process Payment
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
var_dump($available_gateways['stripe_ideal']); //not null i am getting some texts printed on the screen.
$available_gateways['stripe_ideal']->process_payment($orderId);
?>
运行此代码,我得到一个空白的白色屏幕 . 该页面未重定向到条带网站 .
Note: 我用商店页面测试了配置,并且工作正常 . 它重定向我的条纹页面 .
1 回答
以下是我的最终代码 . 一旦调用了process_payment,它将为您提供一个URL,我们需要使用javascript location.href将客户重定向到该URL .
该重定向网址将导致用户将授权付款的条带页面 .