【发布时间】:2018-01-26 04:20:17
【问题描述】:
我正在尝试捕获已使用 PayPal 按钮授权的 PayPal 交易。我正在尝试使用 CyberSource 简单订单 API 来执行此操作。我只有 3 条似乎从 PayPal 按钮返回的信息是:payerID、paymentID 和 paymentToken。我尝试了几种将其交给 Simple Order API 的方法,但总是在响应中得到带有 DECLINE 消息的 102 代码。 Cybersource 的日志系统表明这是因为The following request field(s) is either invalid or missing: request_token。
我是否需要通过网络资源进行整个交易 - 授权和捕获?或者我可以通过什么方式获取 paypal 生成的按钮并授权交易,然后通过 CyberSource 捕获?
这是 CyberSource SOAPI 请求的代码 sn-p:
RequestMessage request = new RequestMessage
{
merchantID = WebConfigurationManager.AppSettings["cybs.merchantID"]
, payPalDoCaptureService = new PayPalDoCaptureService {
run = "true"
, invoiceNumber = orders
, paypalAuthorizationId = authId
, paypalAuthorizationRequestToken = requestToken
, completeType = "Complete" }
, clientApplication = "MyClient Application"
, clientApplicationVersion = "2.0"
, clientApplicationUser = userName
, clientEnvironment = WebConfigurationManager.AppSettings["Tier"]
, merchantReferenceCode = orders
, customerID = OrderConstants.CustomerNumber
, merchantDefinedData = new MerchantDefinedData { field1 = "Customer #: " + OrderConstants.CustomerNumber, field2 = orders }
, purchaseTotals = new PurchaseTotals { currency = "usd", grandTotalAmount = total, taxAmount = taxtotal }
, item = items.ToArray()
};
ReplyMessage reply = new ReplyMessage();
try
{
reply = SoapClient.RunTransaction(request);
}
catch (Exception ex)
{
reply.decision = "SYSTEM ERROR";
reply.additionalData = string.Format("Error processing request. Exception message: {0}", ex.Message);
}
【问题讨论】: