错误10009退款授权交易
问题描述:
我有一个贝宝交易,然后被授权然后被捕获。我想用的refundtransaction
.NET代码退还它,我有以下错误: You can not refund this type of transaction
错误10009退款授权交易
Public Function RefundTransactionCode(ByVal refundType__1 As String, ByVal transactionId As String, ByVal amount As String, ByVal note As String, ByRef resp As RefundTransactionResponseType) As AckCodeType
Dim caller As New CallerServices()
Dim profile As IAPIProfile = ProfileFactory.createSignatureAPIProfile()
'
' WARNING: Do not embed plaintext credentials in your application code.
' Doing so is insecure and against best practices.
' Your API credentials must be handled securely. Please consider
' encrypting them for use in any production environment, and ensure
' that only authorized individuals may view or modify them.
'
' Set up your API credentials, PayPal end point, and API version.
profile.APIUsername = AppSettings("APIUsername")
profile.APIPassword = AppSettings("APIPassword")
profile.APISignature = AppSettings("APISignature")
profile.Environment = AppSettings("Environment")
caller.APIProfile = profile
' Create the request object.
Dim concreteRequest As New RefundTransactionRequestType()
concreteRequest.Version = "51.0"
' Add request-specific fields to the request.
' If (amount IsNot Nothing AndAlso amount.Length > 0) AndAlso (refundType__1.Equals("Partial")) Then
Dim amtType As New BasicAmountType()
amtType.Value = amount
amtType.currencyID = CurrencyCodeType.CAD
concreteRequest.Amount = amtType
concreteRequest.RefundType = RefundType.Full
' Else
'MsgBox(0)
'concreteRequest.RefundType = RefundType.Full
' End If
concreteRequest.RefundTypeSpecified = True
concreteRequest.TransactionID = transactionId
concreteRequest.Memo = note
' Execute the API operation and obtain the response.
' Dim pp_response As New RefundTransactionResponseType()
resp = DirectCast(caller.[Call]("RefundTransaction", concreteRequest), RefundTransactionResponseType)
Return resp.Ack
End Function
答
我会建议在您的PayPal账户找到交易,并看着它。这可能是授权,订单,待处理交易或其他类型的交易。
您只能退还已发送到您代表*发送API的帐户的拍摄/销售,但尚未退款。
*
- 第三方API调用,在你与你的用户名,密码和签名/证书一起使用“主体”在您的API参数,你送代表的API调用'主题的帐户。
- 第一方API调用,你不送主题,并且只使用自己的API的用户,传球,和SIG/CERT
这不是一个编码错误,但更多的是与交易。我建议您通过https://www.paypal.com/mts/ – Robert 2012-03-02 00:41:45