我正在尝试处理脚本,根据需求,在获取xml查询后必须返回HTTP / 1.1 202的答案,但它返回200个答案,是否可以理解是什么原因?
<?php
if ( isset( $_POST['xml'] ) ) {
$respond = stripslashes( $_POST['xml'] );
$xml = simplexml_load_string($respond );
$cart = new Cart($xml->order_number);
$currency = new Currency( intval( $cart->id_currency ) );
if ($currency->iso_code != 'RUB')
exit;
$sign_bank = Configuration::get('shopexample_av_sign');
$shop_id = Configuration::get('shopexample_shop_id');
$signature = strtoupper( md5( strtoupper( md5($sign_bank) . md5( $shop_id . (string)$xml->order_number . (string)$xml->amount ) ) ) );
if ( $signature == $xml->signature ) {
$amount_paid = (int)$xml->amount / 100;
$avangard->validateOrder( $cart->id, _PS_OS_PAYMENT_, $amount_paid, $avangard->displayName, NULL, NULL );
$order = new Order( $avangard->currentOrder );
if ( $avangard->setStatus( $xml->ticket, $xml->status_desc ) )
unlink( dirname(__FILE__).'/'.INPUT_FILENAME );
header("HTTP/1.1 202 ACCEPTED");
}
}
else {
Tools::redirectLink(__PS_BASE_URI__.'order.php');
}
?>