这是我的代码:
private void button1_Click(object sender, EventArgs e)
{
var process = new com.globalpay.certapia.GlobalPayments();
var response = process.ProcessCreditCard("xxxxxx", "xxxxxx", "Sale",
textBox1.Text, textBox2.Text, "", "", textBox3.Text, "",
"", "", "", "", "");
MessageBox.Show("RespMSG: " + response.RespMSG
+ "\nMessage: " + response.Message
+ "\nAuthCode: " + response.AuthCode
+ "\nPNRef: " + response.PNRef
+ "\nHostCode: " + response.HostCode
+ "\nCVResultTXT: " + response.GetCVResultTXT
+ "\nCommercialCard: " + response.GetCommercialCard
+ "\nExtData: " + response.ExtData);
}
输出如下:
在 ExtData 部分我很困惑,我不知道如何提取这些值,例如获取 CardType、BatchNum、MID、TransID 的值。
我怎么可能提取这些值?
任何建议或建议如何实现这一目标都会有很大帮助。谢谢!
基于 api 的文档:
<?xml version="1.0" encoding="utf-8" ?>
<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="GlobalPayments">
<Result>0</Result>
<RespMSG>Approved</RespMSG>
<Message>AP</Message>
<AuthCode>000014</AuthCode>
<PNRef>564286</PNRef>
<HostCode>0032</HostCode>
<GetCVResultTXT>Service Not Requested</GetCVResultTXT>
<GetCommercialCard>False</GetCommercialCard>
<ExtData>InvNum=1234567900,CardType=MasterCard,BatchNum=0011<BatchNum>0011
</BatchNum><ReceiptData><MID>4910354</MID><Trans_Id>MCC1421250315
</Trans_Id></ReceiptData></ExtData>
</Response>