【问题标题】:PayPal SOAP API - Version is not supportedPayPal SOAP API - 不支持版本
【发布时间】:2011-09-25 01:38:04
【问题描述】:

我使用 .Net 和 Visual Studio 2010。

我下载了 WSDL 并更正了 maxOccurs error,将 WSDL 添加为 Web 参考就可以了。

当我调用 SetExpressCheckout 时出现问题。错误只是说,不支持版本。我检查了 WSDL 的版本,即 76.0 - 并且应该是正确的 AFAIK。

正在使用的 Web 服务端点是这样的:https://api.sandbox.paypal.com/2.0/

我需要在哪里指定版本,还是使用的服务端点有误?

【问题讨论】:

标签: c# soap paypal


【解决方案1】:

如果有人有同样的问题,需要指定版本:

PayPalAPIAASoapBinding api = new PayPalAPIAASoapBinding();

// Service Provider's API Credentials
api.RequesterCredentials = new CustomSecurityHeaderType();
api.RequesterCredentials.Credentials = new UserIdPasswordType();
api.RequesterCredentials.Credentials.Username = this.Username;
api.RequesterCredentials.Credentials.Password = this.Password;
api.RequesterCredentials.Credentials.Signature = this.ApiSignature;

// The merchant's PayPal e-mail address (3rd party authentication)
api.RequesterCredentials.Credentials.Subject = this.CustomerId;

SetExpressCheckoutReq req = new SetExpressCheckoutReq();
req.SetExpressCheckoutRequest = new SetExpressCheckoutRequestType();
req.SetExpressCheckoutRequest.SetExpressCheckoutRequestDetails = new SetExpressCheckoutRequestDetailsType();
req.SetExpressCheckoutRequest.Version = "74.0";

目前 Sandbox 在 v 74.0 中运行,在 76.0 中运行。 PayPal 并不总是在其环境中运行相同的版本。

【讨论】:

  • 提示:获取任何沙盒和/或实时 PayPal 页面的来源,并在顶部附近找到评论块。这将显示您当前所在环境的最新版本。 (即网页版:76.0-1971782)
  • @Robert 谢谢,这在来回切换以及更新 WSDL 参考之后很有用。
  • 为我修复了版本错误。我猜想某处有一个版本参数,但无法抓住它。谢谢你!
猜你喜欢
  • 2016-05-21
  • 1970-01-01
  • 2021-06-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-26
  • 2021-07-22
  • 2017-08-28
相关资源
最近更新 更多