當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


PHP WHMCS FetchCurrencyExchangeRates用法及代碼示例

在更新貨幣匯率時執行。返回所有支持的自動更新貨幣

參數

變量 類型 注意
USD float
GBP float

響應

一組鍵 -> 值對,用於定義或覆蓋額外的匯率。匯率應適合歐元貨幣。

示例代碼

<?php

//Return an exchange rate for the XBT currency
add_hook('FetchCurrencyExchangeRates', 1, function($vars) {
    //Code here to fetch the the current exchange rate relative to EUR

    //Return exchange rate relative to 1 EUR
    return ['XBT' => 927.121,];
});

相關用法


注:本文由純淨天空篩選整理自whmcs.com大神的英文原創作品 FetchCurrencyExchangeRates。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。