ASP.NET中与PayGate的集成 [英] Integration with paygate in asp.net

查看:0
本文介绍了ASP.NET中与PayGate的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已将服务引用添加到我的项目中,该引用为

https://secure.paygate.co.za/payhost/process.trans?wsdl

My PaygateRef是Web服务引用名称(命名空间)

PaygateRef.SinglePaymentRequest1 PaygatePayment = new PaygateRef.SinglePaymentRequest1();
PaygateRef.CardPaymentRequestType Request = new PaygateRef.CardPaymentRequestType();
Request.Account = new PaygateRef.PayGateAccountType();
Request.Account.PayGateId = "000000000";   //my PaygateID
Request.Account.Password = "mypassword";       //my Encryption key

Request.Customer = new PaygateRef.PersonType();
Request.Customer.Title = "Mr";
Request.Customer.FirstName = "Rich";
Request.Customer.LastName = "Buyer";
Request.Customer.Mobile = new string[]{"0830000001"}; //My cell number

Request.CardIssueNumber = "500000000000008";//card number
Request.CardIssueDate = "012020";//january 2020
Request.CVV = "001";// card ccv

Request.Order = new PaygateRef.OrderType();
Request.Order.MerchantOrderId = "115422488465";//a random test orderID
Request.Order.Currency = PaygateRef.CurrencyType.ZAR;
Request.Order.Amount = 100;  //R1

PaygatePayment.SinglePaymentRequest = new PaygateRef.SinglePaymentRequest();
PaygatePayment.SinglePaymentRequest.Item = Request;

PaygateRef.PayHOST myPaygateinterface = new PaygateRef.PayHOSTClient();

myPaygateinterface.SinglePayment(PaygatePayment);


我收到的错误是

Validation error
我使用在其他站点上工作的多个卡进行了测试 而这个账号是在之前用PHP编写的网站上使用的,它在那里工作。
根据我的理解,Paygate端的一切设置都是正确的

我为什么收到此错误以及如何解决它?

编辑
我确实试过

Request.ItemsElementName = new PaygateRef.ItemsChoiceType[]
{
    PaygateRef.ItemsChoiceType.CardExpiryDate,
    PaygateRef.ItemsChoiceType.CardNumber
};

Request.Items = new string[] { "012020", "500000000000008" };

推荐答案

我能够通过更改卡详细信息的顺序来解决我的问题。在您的例子中,您已经将cardexpirydate放在了cardnumber之上。我颠倒了顺序,也确保了CVV是在卡片详细信息之后出现的。这将是您的代码。

Request.ItemsElementName = new PaygateRef.ItemsChoiceType[]
{
    PaygateRef.ItemsChoiceType.CardNumber,
    PaygateRef.ItemsChoiceType.CardExpiryDate

};

Request.Items = new string[] { "500000000000008", "012020" };

Request.CVV = "001";// card ccv

希望它能有所帮助!

我也没有使用cardissuedate或cardissuennumber,因为它们是可选的,我不需要。

此外,您还可以检查您获得的异常的详细信息节点。在详细信息节点中,将明确定义错误原因。

这篇关于ASP.NET中与PayGate的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆