カスタム getaway のコールバック関数で無効な XML タグを防ぐにはどうすればよいですか?
$h = fopen("banks/Mybank/log.txt", 'a');
fwrite($h, 'ConfirmRequest: '.print_r($_REQUEST['ConfirmRequest'],true)."\n");
fclose($h);
出力は次のとおりです。
ConfirmRequest: <ConfirmRequest><TransactionId> Cool Attitude #89</TransactionId><PaymentId>327600020200</PaymentId><PaymentDate>02.10.2013 23:41:26</PaymentDate><Amount>7000</Amount><CardType>VISA!472291******9871</CardType><Status>N</Status><Reason>Declined by merchant</Reason></ConfirmRequest>
結果は同じです
$_REQUEST['ConfirmRequest'];
と
$this->resuest->request['ConfirmRequest'];
==========================
gloomy.penguin に多大な感謝を!教えてください、私はここで何が間違っていましたか?
if(
!openssl_verify(
'ConfirmRequest='.$ConfirmRequest,
base64_decode($signature),
openssl_get_publickey($cert)
)
)
die("signature error");
$parser = xml_parser_create('');
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
xml_parse_into_struct($parser, $ConfirmRequest, $vals);
xml_parser_free($parser);
foreach ($vals as $data)
{
if ($data['tag']=='STATUS')
$Status=$data['value'];
if ($data['tag']=='PAYMENTID')
$PaymentId=$data['value'];
if ($data['tag']=='PAYMENTDATE')
$PaymentDate=$data['value'];
if ($data['tag']=='TRANSACTIONID')
$TransactionId=$data['value'];
if ($data['tag']=='AMOUNT')
$Amount=$data['value'];
if ($data['tag']=='REASON')
$Reason=$data['value'];
if ($data['tag']=='CARDTYPE')
$CardType=$data['value'];
}
$sta = fopen("banks/MyBank/status.txt", 'a');
fwrite($sta, .print_r($data)."\n");
fclose($sta);
出力値は「1」です...