我用c#调用进程DoReferenceTransaction (SOAP)。它运行良好,数据到达,DoReferenceTransactionResponseType
的结果没有错误。但DoReferenceTransactionResponseDetails
的细节永远是空的。
是否有启用的变量来填充响应的详细信息?我在DoReferenceTransactionResponseDetails.Any
中发现了一个xml字符串,但为什么我应该从xml中排除数据,如果它在DoReferenceTransactionResponseDetails
中?
我必须有TransactionID
从贝宝。
请求示例:
request = new DoReferenceTransactionReq();
request.DoReferenceTransactionRequest = new DoReferenceTransactionRequestType();
request.DoReferenceTransactionRequest.Version = "98.0";
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails = new DoReferenceTransactionRequestDetailsType();
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails.PaymentAction = PaymentActionCodeType.Sale;
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails.PaymentType = MerchantPullPaymentCodeType.Any;
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails.PaymentDetails = new PaymentDetailsType();
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails.PaymentDetails.OrderTotal = new BasicAmountType();
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails.PaymentDetails.OrderTotal.Value = "100";
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails.PaymentDetails.OrderTotal.currencyID = CurrencyCodeType.CHF;
request.DoReferenceTransactionRequest.DoReferenceTransactionRequestDetails.ReferenceID = "XXXX";
DoReferenceTransactionResponseType response = service.DoReferenceTransaction(request);
上层请求的响应
交易已成功处理,我可以在paypal沙箱的页面概述中看到。
您应该得到一个返回值的响应。它不应该是零。例如,我正在传递以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:ns2="urn:ebay:api:PayPalAPI">
<SOAP-ENV:Header>
<ns2:RequesterCredentials>
<ns1:Credentials>
<ns1:Username>%Username%</ns1:Username>
<ns1:Password>%Password%</ns1:Password>
<ns1:Signature>%Signature%</ns1:Signature>
</ns1:Credentials>
</ns2:RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:DoReferenceTransactionReq>
<ns2:DoReferenceTransactionRequest>
<ns1:Version>84.0</ns1:Version>
<ns1:DoReferenceTransactionRequestDetails>
<ns1:ReferenceID>1A381834JN903220E</ns1:ReferenceID>
<ns1:PaymentAction>Sale</ns1:PaymentAction>
<ns1:PaymentType>Any</ns1:PaymentType>
<ns1:PaymentDetails>
<ns1:OrderTotal currencyID="USD">10.00</ns1:OrderTotal>
<ns1:PaymentAction>Sale</ns1:PaymentAction>
</ns1:PaymentDetails>
<ns1:IPAddress>10.243.180.150</ns1:IPAddress>
</ns1:DoReferenceTransactionRequestDetails>
</ns2:DoReferenceTransactionRequest>
</ns2:DoReferenceTransactionReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我在API响应中得到以下内容:
Array
(
[name] => DoReferenceTransactionResponse
[elements] => Array
(
[0] => Array
(
[name] => Timestamp
[text] => 2013-04-25T13:22:14Z
)
[1] => Array
(
[name] => Ack
[text] => Success
)
[2] => Array
(
[name] => CorrelationID
[text] => 748fcba0bc2e7
)
[3] => Array
(
[name] => Version
[text] => 84.0
)
[4] => Array
(
[name] => Build
[text] => 5650305
)
[5] => Array
(
[name] => DoReferenceTransactionResponseDetails
[elements] => Array
(
[0] => Array
(
[name] => Amount
[text] => 10.00
)
[1] => Array
(
[name] => AVSCode
[text] => X
)
[2] => Array
(
[name] => CVV2Code
[text] => M
)
[3] => Array
(
[name] => TransactionID
[text] => 2PR97363S20425407
)
)
)
)
)