我正在使用 recurly webhook 更新联系人,但 XML 始终为空,这是我尝试过的:
$xmlString = file_get_contents('php://input');
$dom = new DomDocument();
$dom->loadXML($xmlString);
但是,当我查看文件时,它始终为空:
$rsn = $dom->getElementsByTagName('successful_payment_notification');
if($rsn->length != 0){
//.. do something
}
但我注意到 $dom 始终为空,这是 XML 重复发送的内容:
<?xml version="1.0" encoding="UTF-8"?>
<successful_payment_notification>
<account>
<account_code>89728427a3caa0b21b2ds31223c0fad6f443b82</account_code>
<first_name>Michael</first_name>
<last_name>Scott</last_name>
<company_name nil="true"></company_name>
<phone nil="true"></phone>
</account>
<transaction>
<id>467fc116288ab89c8d7c954bbca565a8</id>
<invoice_id>467fc11613dcd438d4410c4ca0bc03e8</invoice_id>
<invoice_number_prefix></invoice_number_prefix>
<invoice_number type="integer">1379</invoice_number>
<test type="boolean">false</test>
<voidable type="boolean">false</voidable>
<refundable type="boolean">true</refundable>
</transaction>
</successful_payment_notification>
allow_url_fopen 已打开,不确定是什么原因造成的,我正在使用 AWS Lightsail 和 Bitnami。