这是我使用 express server 4.13.4 设置的应用程序:
/**
* @param $order
* @return int
*/
public function gerOrderTotalInCents($order): int
{
return (int)round($order->info['total'] * 100);
}
/**
* @param $order
* @return array
*/
public function getCustomerInfo($order): array
{
$customer = array_filter([
'address_type' => 'billing',
'merchant_customer_id' => (string)$_SESSION['customer_id'],
'email_address' => $order->customer['email_address'],
'first_name' => $order->customer['firstname'],
'last_name' => $order->customer['lastname'],
'address' => trim($order->billing['street_address'])
. ' ' . trim($order->billing['suburb'])
. ' ' . trim($order->billing['postcode'])
. ' ' . trim($order->billing['city']),
'postal_code' => $order->billing['postcode'],
'country' => $order->billing['country']['iso_code_2'],
'phone_numbers' => [$order->customer['telephone']],
'user_agent' => $_SERVER['HTTP_USER_AGENT'],
'ip_address' => $_SESSION['customers_ip_address'],
'locale' => $_SESSION['languages_code'],
$this->isRequiredOrderLines() ? $this->getAdditionalCustomerInfo($order) : null
]);
if ($this->isRequiredOrderLines()) {
$customer = array_merge($customer, $this->getAdditionalCustomerInfo($order));
}
return $customer;
}
静态文件夹中的图像文件完美服务。但是当浏览器请求 WOFF 文件时,浏览器有时永远不会完成请求:
(其他两个 WOFF 服务正确)。所有文件都在正确的文件夹中。为什么会发生这种情况?