Adyen Soap付款请求 [英] Adyen Soap Payment request

查看:110
本文介绍了Adyen Soap付款请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在努力提交定期付款请求的Adyen支付提供商,但我不断收到内部服务器错误作为对此声明的回复:requests.GetResponse()我不知道我在代码中做错了什么有人可以帮助我,我尝试了他们的支持,他们告诉我检查支持网站网站上我做的文章,发现没有任何帮助我的问题,下面是我正在使用的代码。

 公共 功能 ChargeSubscriber( ByVal  ShopperReference 作为 字符串 ByVal  shopperEmail < span class =code-keyword>作为 字符串 ByVal  sid 作为 字符串 ByVal  UserName 作为 字符串 ByVal 金额正如 字符串 ByVal 货币 As  字符串 ByVal 密码作为 < span class =code-keyword>字符串, ByVal  merchantaccount  As  字符串作为 字符串 
Dim res As String = 1
如果 currency<> JPY 然后
金额=金额* 100
结束 如果
Dim xml As String = <?xml version =1.0?>< soap:Envelope xmlns: soap =http://schemas.xmlsoap.org/soap/envelope/xmlns:xsd =http://www.w3.org/2001/XMLSchemaxmlns:xsi =http:/ /www.w3.org/2001/XMLSchema-instance\"\"><soap:Body><ns1:authorise xmlns:ns1 =http://payment.services.adyen.com>< ns1:paymentRequest>< amount xmlns =http://payment.services.adyen.com>< currency xmlns =http://common.services.adyen.com>&货币与 < / currency>< value xmlns =http://common.services.adyen.com >&金额和金额 < / value>< / amount>< ns1:merchantAccount>&商人帐户& < / ns1:merchantAccount>< ns1:reference> RecurringPayment-0001< / ns1:reference>< ns1 :shopperEmail>& shopperEmail& < / ns1:shopperEmail>< ns1:shopperReference>&购物者参考& < / ns1:shopperReference>< ns1:selectedRecurringDetailReference> LATEST< / ns1:selectedRecurringDetailReference>< ns1:recurring> ;< NS1:合同> RECURRING< / NS1:合同>< / NS1:重复>< NS1:shopperInteraction> ContAuth< / NS1:shopperInteraction>< / NS1:paymentRequest>< / NS1:授权>< / soap:Body>< / soap:Envelope>
Dim requests As HttpWebRequest = WebRequest.Create( https://pal-test.adyen.com/pal/servlet/soap /付款
requests.Credentials = NetworkCredential(用户名,密码)
requests.Method = POST
requests.Headers.Add( SOAPAction http://tempuri.org/submitRecurring
Dim data()作为 字节 = Encoding.UTF8.GetBytes(xml)
requests.ContentLength = data.Length
requests.ContentType = text / xml; charset = utf-8
Dim requestStream As Stream = requests.GetRequestStream ()
requestStream.Write(data, 0 ,data.Length)
Dim webresp As HttpWebResponse = requests.GetResponse()
Dim 答案 As Stream = webresp.GetResponseStream()
Dim AnswerS As StreamReader = StreamReader(答案)

Dim doc As System.Xml.XmlDocument = System.Xml.XmlDocument()
Dim rest 作为 字符串 = AnswerS.ReadToEnd()
doc.LoadXml(rest)


' resultCode()
返回 IIf(doc.GetElementsByTagName( resultCode)( 0 )。InnerText = 授权 1 , - 1)
结束 功能

解决方案

永远不会,接受来自不安全网站的代码来处理与真钱有关的事情。

你不知道是谁给你代码,你不知道它做了什么,你不知道它放置了在没有将详细信息传递给任何第三方的情况下,正确地进入相应的账户。



返回他们的技术支持并与他们交谈 - 他们得到报酬是为了提供支持(由你,当你开始工作,因为他们采取了所有资金的削减)如果他们不提供支持,那么找到另一个支付服务。但是,不要在随机网站上寻求详细的帮助 - 欺诈的范围太大了。请记住,如果您的行为被视为疏忽,您本人可能要对任何损失承担责任 - 从公共论坛获取您的代码肯定会是!


对于任何面对同样的问题,解决方案非常简单。

只需保存在线提供的wsdl文件,然后右键单击解决方案,然后选择添加服务参考。单击高级选择添加Web引用将完整路径放入已保存的wsld。然后建立你的网站。

你将拥有你需要的所有功能作为一个例子我试图使用httpwebrequest和soap可以用这些线完成:

< pre lang =vb> 如果 currency<> JPY 然后
金额=金额* 100
结束 如果
Dim _Payment 作为 AdyenPayment.Payment = AdyenPayment.Payment()
Dim _paymentRequest As AdyenPayment.PaymentRequest = AdyenPayment.PaymentRequest()
_paymentRequest.amount = AdyenPayment.Amount()
_paymentRequest.amount.currency = currency
_paymentRequest.amount.value = amount
_paymentRequest.merchantAccount = merchantaccount
_paymentRequest.recurring = New < /跨度> AdyenPayment.Recurring()
_paymentRequest.recurring.contract = RECURRING
_paymentRequest.selectedRecurringDetailReference = 最新
_paymentRequest.shopperEmail = shopperEmail
_paymentRequest。 shopperReference = ShopperReference
_paymentRequest.shopperInteraction = ContAuth
_paymentRequest.reference =引用
_Payment.Credentials = NetworkCredential(用户名,密码)
Dim _PaymentResult 作为 AdyenPayment.PaymentResult = _Payment.authorise(_paymentRequest)


Hi I'm working on Adyen payment provider trying to submit a recurring payment request but i keep getting internal server error as response on this statement: requests.GetResponse() i don't know what i doing wrong in the code if someone can help me i tried their support they told me to check the support site site for articles i did and found nothing that helps my issue, below is the code i'm using.

Public Function ChargeSubscriber(ByVal ShopperReference As String, ByVal shopperEmail As String, ByVal sid As String, ByVal UserName As String, ByVal amount As String, ByVal currency As String, ByVal Password As String, ByVal merchantaccount As String) As String
       Dim res As String = "1"
       If currency <> "JPY" Then
           amount = amount * 100
       End If
       Dim xml As String = "<?xml version=""1.0""?><soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""><soap:Body><ns1:authorise xmlns:ns1=""http://payment.services.adyen.com""><ns1:paymentRequest><amount xmlns=""http://payment.services.adyen.com""><currency xmlns=""http://common.services.adyen.com"">" & currency & "</currency><value xmlns=""http://common.services.adyen.com"">" & amount & "</value></amount><ns1:merchantAccount>" & merchantaccount & "</ns1:merchantAccount><ns1:reference>RecurringPayment-0001</ns1:reference><ns1:shopperEmail>" & shopperEmail & "</ns1:shopperEmail><ns1:shopperReference>" & ShopperReference & "</ns1:shopperReference><ns1:selectedRecurringDetailReference>LATEST</ns1:selectedRecurringDetailReference><ns1:recurring><ns1:contract>RECURRING</ns1:contract></ns1:recurring><ns1:shopperInteraction>ContAuth</ns1:shopperInteraction></ns1:paymentRequest></ns1:authorise></soap:Body></soap:Envelope>"
       Dim requests As HttpWebRequest = WebRequest.Create("https://pal-test.adyen.com/pal/servlet/soap/Payment")
       requests.Credentials = New NetworkCredential(UserName, Password)
       requests.Method = "POST"
       requests.Headers.Add("SOAPAction", "http://tempuri.org/submitRecurring")
       Dim data() As Byte = Encoding.UTF8.GetBytes(xml)
       requests.ContentLength = data.Length
       requests.ContentType = " text/xml; charset=utf-8"
       Dim requestStream As Stream = requests.GetRequestStream()
       requestStream.Write(data, 0, data.Length)
       Dim webresp As HttpWebResponse = requests.GetResponse()
       Dim Answer As Stream = webresp.GetResponseStream()
       Dim AnswerS As StreamReader = New StreamReader(Answer)

       Dim doc As System.Xml.XmlDocument = New System.Xml.XmlDocument()
       Dim rest As String = AnswerS.ReadToEnd()
       doc.LoadXml(rest)


       'resultCode()
       Return IIf(doc.GetElementsByTagName("resultCode")(0).InnerText = "Authorised", 1, -1)
   End Function

解决方案

Never, ever, accept code from a insecure website to handle anything to do with real money.
You do not know who is giving you the code, you do not know what it does, you do not know that it places the monies correctly into the appropriate account, without passing the details to any third parties.

Go back to their technical support and talk to them - they are paid to provide support (by you, when you get it working since they take a "cut" of all money going through) If they do not provide support, then find another payment service that will. But don;t ask for detailed help on "random" websites - the scope for fraud is far too large. And remember, you personally could be liable for any monies lost if your action is seen to be negligent - which getting your code from a public forum would most certainly be!


For anyone who's facing the same issue the solution turned out to be extremely simple.
Just save the wsdl file provided online anywhere on your pc then right click on the solution then choose add a service reference. Click advanced choose add web reference put the full path to the saved wsld. Then build ur website.
you will have all the functions you need as an example what i was attempting to do using httpwebrequest and soap can be done with these lines:

If currency <> "JPY" Then
            amount = amount * 100
        End If
        Dim _Payment As AdyenPayment.Payment = New AdyenPayment.Payment()
        Dim _paymentRequest As AdyenPayment.PaymentRequest = New AdyenPayment.PaymentRequest()
        _paymentRequest.amount = New AdyenPayment.Amount()
        _paymentRequest.amount.currency = currency
        _paymentRequest.amount.value = amount
        _paymentRequest.merchantAccount = merchantaccount
        _paymentRequest.recurring = New AdyenPayment.Recurring()
        _paymentRequest.recurring.contract = "RECURRING"
        _paymentRequest.selectedRecurringDetailReference = "LATEST"
        _paymentRequest.shopperEmail = shopperEmail
        _paymentRequest.shopperReference = ShopperReference
        _paymentRequest.shopperInteraction = "ContAuth"
        _paymentRequest.reference = reference
        _Payment.Credentials = New NetworkCredential(UserName, Password)
        Dim _PaymentResult As AdyenPayment.PaymentResult = _Payment.authorise(_paymentRequest)


这篇关于Adyen Soap付款请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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