工作需要,做美国的在线支付系统,有两种模式,一种是PayPal支付,另一种是信用卡支付。PayPal支付将支付的表单数据提交到指定的IPN,由IPN处理并提供相应的页面,信用卡支付包括单个支付和包月的支付,包月支付既每个月自动的从账户上划钱,如果用户不取消,将一直支付下去。
这两种支付,都有测试环境,在测试环境上调通了,正式环境就可走通,具体的测试环境可自行上网查找。
两种的支付的关键就是如何向指定的网关提交数据,并接收网关返回的数据,提交的数据一种是表单,一种是xml,用到了一个很实用的方法,如下:
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
传递网关url和指定参数的字符串,就能将信息提交到网关,并返回结果信息。返回的结果,有的是字符串列表,按指定的字符截开,有的是返回一个特定的xml,,这里介绍一个在xml中,输入开始标记和结束标记就可以获取文本的方法,如下:
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
调用:
string refId = this.PraseResponseXml(xmlcode, "<refId>", "</refId>");
//xmlcode为xml格式的字符串
//xmlcode为xml格式的字符串
做过该方面的再复习下,没做过的学习下 。。。呵呵。。。