如何与集成PayPal API
在一个ASP.NET Core
应用程序?我尝试了各种库,但没有一个与ASP.NET Core
... 兼容......我该怎么做?
我在我的asp.net网站上集成了Paypal,它在某些计算机上完美运行,而其他计算机则不然.
编辑:发现问题,但寻找解决方案
问题是如下:
事情似乎工作正常,我可以用paypal支付,然后当它调用GetExpressCheckoutDetails时,它返回10411错误 ' 此快速结账会话已过期'
我用以下代码调用GetExpressCheckoutDetails:
public bool GetDetails(string token, ref NVPCodec decoder, ref string retMsg)
{
if (bSandbox)
{
pendpointurl = pendpointurl_SB;
host = host_SB;
SetCredentials(APIUsername_SB, APIPassword_SB, APISignature_SB);
}
NVPCodec encoder = new NVPCodec();
encoder["METHOD"] = "GetExpressCheckoutDetails";
encoder["TOKEN"] = token;
string pStrrequestforNvp = encoder.Encode();
string pStresponsenvp = HttpCall(pStrrequestforNvp);
decoder = new NVPCodec();
decoder.Decode(pStresponsenvp);
string strAck = decoder["ACK"].ToLower();
if (strAck != null && (strAck == "success" || strAck == "successwithwarning"))
{
return true;
}
else …
Run Code Online (Sandbox Code Playgroud)