我是 Laravel 的新手。这是我在 SmartpayS 控制器中的功能。我想在 iframe 中返回这个 url。$url = $item->nodeValue;
function processSmartpaySPayment($paymentType = false, $totalAmount = 0, $currency = false, $payingUserId = false, $quoteId = false, $clubMembershipQuotationId = false)
{
$callBackUrl = 'smartpays-payment/response/'.$quoteId;
if (!empty($payingUserId)) {
$customerDetails = $this->customerRepo->getCustomerDetails($payingUserId);
} else {
return false;
}
$testString = $this->smartPaySRepo->createSmartpaySPayment($paymentType, env('ENTERPRISE_ID'), 'DE02', 'ECommerce',env('AUTH_TYPE'), $totalAmount, $customerDetails, $currency, $callBackUrl, $quoteId, $clubMembershipQuotationId, env('STORE_RESULT_PAGE') );
$dom = new \DOMDocument();
$dom->formatOutput = TRUE;
$dom->preserveWhiteSpace = FALSE;
$dom->loadXml($testString);
foreach ($dom->getElementsByTagName('redirectURL') as $item) {
$url = $item->nodeValue;
}
return redirect($url);
}
----------
**********iframe is in the view.(paymentload.blade.php)*************
<iframe src="<?php echo $url; ?>" width="600px" height ="800px" ></iframe>
我试图加载 iframe。但它说“未定义的变量:url” 帮助我从控制器函数返回视图中的 iframe。
阿波罗的战车