我有一個貝寶交易,然後被授權然後被捕獲。我想用的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
這不是一個編碼錯誤,但更多的是與交易。我建議您通過https://www.paypal.com/mts/ – Robert 2012-03-02 00:41:45