我正在尝试实现 3d 安全。我有一个 xml,其中包含 3d secure.Like 所需的一些数据:
<CardinalMPI>
<MsgType>cmpi_lookup</MsgType>
<Version>1.7</Version>
<ProcessorId>xxx</ProcessorId>
<MerchantId>xxxxxx</MerchantId>
<TransactionPwd>xxxxxxxxxxx</TransactionPwd>
<TransactionType>C</TransactionType>
<Amount>56999</Amount>
<CurrencyCode>xxxxx</CurrencyCode>
<OrderNumber>xxxx</OrderNumber>
<CardNumber>xxx</CardNumber>
<CardExpMonth>xxx</CardExpMonth>
<CardExpYear>xxx</CardExpYear>
</CardinalMPI>
那么如何使用上述 xml 请求http://msgtest.bankserv.co.za/maps/txns.asp 并获得他们的回复?我尝试了 curl、Soap 等,但出现了错误。请帮我详细解答一些问题。
我已经尝试了以下代码。如果此代码不正确,请告诉我。
$writer = new XMLWriter();
$writer->openMemory();
$writer->startElement("CardinalMPI");
$writer->writeElement("MsgType","cmpi_lookup");
$writer->writeElement("Version","1.7");
$writer->writeElement("ProcessorId","xxxxx");
$writer->writeElement("MerchantId","xxxxxxx");
$writer->writeElement("TransactionPwd","xxxxx");
$writer->writeElement("TransactionType","C");
$writer->writeElement("Amount",$xxxx);
$writer->writeElement("CurrencyCode","xxxx");
$writer->writeElement("OrderNumber","xxxxxxxxxx");
$writer->writeElement("CardNumber","'xxxxxxxxx");
$writer->writeElement("CardExpMonth","xx");
$writer->writeElement("CardExpYear","xxxx");
$writer->endElement();
$writer->endElement();
$writer->endDocument();
$request = $writer->outputMemory(true);
$serviceArguments = array("validateRequest"=>"0","protocol"=>"v_xml","protocolVersion"=>"2.0","request"=> $request);
$client = new SoapClient("msgtest.bankserv.co.za/maps/txns.asp", array('local_cert'=> "certificate.pem"));
$result = $client->Execute($serviceArguments);
$xml=$result->ExecuteResult;
当我运行此代码时,我遇到了异常。