当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。