2012-03-02 94 views
2

我有一个贝宝交易,然后被授权然后被捕获。我想用的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 
+1

这不是一个编码错误,但更多的是与交易。我建议您通过https://www.paypal.com/mts/ – Robert 2012-03-02 00:41:45

回答

1

我会建议在您的PayPal账户找到交易,并看着它。这可能是授权,订单,待处理交易或其他类型的交易。

您只能退还已发送到您代表*发送API的帐户的拍摄/销售,但尚未退款。


*

  1. 第三方API调用,在你与你的用户名,密码和签名/证书一起使用“主体”在您的API参数,你送代表的API调用'主题的帐户。
  2. 第一方API调用,你不送主题,并且只使用自己的API的用户,传球,和SIG/CERT
+0

与PayPal Merchant Technical Services联系,我的交易类型为授权 – 2012-03-04 18:34:17

+1

您无法退还授权。您可以使其无效,但没有资金被采纳,因此不需要为买方提供资金;买方已经'资助'了。只是为了好玩,''''''''。 – SgtPooki 2012-03-05 17:52:31

+0

@khs,我希望接受我的答案是正确的答案。谢谢。 – SgtPooki 2012-11-07 17:53:09