设置快速结账方式

设置快速结账方式

本文介绍了设置快速结账方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误



ACK =失败& L_ERRORCODE0 = 81002& L_SHORTMESSAGE0 =未指定%20Method& L_LONGMESSAGE0 =方法%20指定%20is%20not%20Supported& L_SEVERITYCODE0 =错误



以下是我的代码





I am getting this error

ACK=Failure&L_ERRORCODE0=81002&L_SHORTMESSAGE0=Unspecified%20Method&L_LONGMESSAGE0=Method%20Specified%20is%20not%20Supported&L_SEVERITYCODE0=Error

below is my code


Dim PPUrl As String '= Convert.ToString(Application("PayPalPaymentUrl"))
       PPUrl = "https://api-3t.sandbox.paypal.com/nvp"

       Dim WP As New StringBuilder("<form name=""form2"" id=""form2"" action=""" & PPUrl & """ method=""POST"">")
       'Dim strGiftWrap As String
       With WP
           .Append("<p>Please wait while we redirect to the paypal payment page. Do not close this window...</p>")
           .Append("<input type=hidden name=""USER"" value=""rupesXXXXXX.gmail.com"">")
           .Append("<input type=hidden name=""PWD"" value=""G92XXXXXXXXXot;>")
           .Append("<input type=hidden name=""SIGNATURE"" value=""AFXXXXXXXXXXXpSSRl31ALeW-5U7xXWGiAR.27notFfpoWaN"">")
           .Append("<input type=hidden name=""VERSION"" value=""124"">")
           .Append("<input type=hidden name=""PAYMENTREQUEST_0_PAYMENTACTION""  value=""Sale""> ")
           .Append("<input type=hidden name=""PAYMENTREQUEST_0_AMT"" value='" & CurrentSession.Current.ShoppingBagValue & "'>")
           .Append("<input type=hidden name=""PAYMENTREQUEST_0_CURRENCYCODE"" value='" & CurrentSession.Current.ISOCurrencyCode & "'>")
           .Append("<input type=hidden name=""returnUrl""  value=""https://www.mysite.com/checkout/order-complete/""> ")
           .Append("<input type=hidden name=""cancelUrl""  value=""https://www.mysite.com/my-basket/""> ")

           .Append("<input type=submit name=""TOKEN"" value="""">")
           '.Append("<input type=hidden value="""" visible=""false"" id=""Submit"">")
           .Append("</form>")
           .Append("<script language=""javascript"">")
           .Append("document.form2.submit();")
           .Append("</script>")
       End With

       Dim responseFromServer As String = SendPostData(WP.ToString())


   End Sub
   Public Function SendPostData(ByVal site As String)

       Dim objRequest As HttpWebRequest
       Dim postData As String = site.ToString()
       Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
       objRequest = CType(WebRequest.Create("https://api-3t.sandbox.paypal.com/nvp"), HttpWebRequest)
       objRequest.Method = "GET"
       objRequest.ContentType = "application/x-www-form-urlencoded"
       objRequest.ContentLength = byteArray.Length

       Dim stream As Stream = objRequest.GetRequestStream()
       stream.Write(byteArray, 0, byteArray.Length)
       stream.Close()
       Dim Response As WebResponse = objRequest.GetResponse()
       Dim sr As New StreamReader(Response.GetResponseStream())
       Dim responseFromServer As String = sr.ReadToEnd()
       sr.Close()
       Response.Close()

       Return responseFromServer

推荐答案


这篇关于设置快速结账方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-15 12:29