我的 currency_code 是美元,但在捐赠后转换为 PHP 我的问题是当我将它插入我的数据库时,插入的是美元,而不是转换后的 PHP 值。例如:我捐赠了 10 美元是否相当于 450 PHP,我如何在我的数据库中插入 450?
最佳答案
我认为您的代码的问题不在于 Paypal API,而是变量的设置。
$donation = $_POST["donation"]; // this is sample return value $converted_donation = convent_donation($donation); // function that convert USD to PHP you are inserting the $donation variable I guess, that's why your data is wrong
反正你可以把paypal api里的货币代码设置成PHP直接插入你的数据库,不用转换
$config["currency_code"] = 'PHP';
关于paypal - 如何在PayPal中获取转换后的钱的值(value),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34529424/