gpt4 book ai didi

asp.net-mvc - 授权交易退款时出现错误 10009

转载 作者:太空宇宙 更新时间:2023-11-03 15:49:38 24 4
gpt4 key购买 nike

我有一个 paypal 交易,该交易被授权然后被捕获。我想使用 refundtransaction 的 .net 代码进行退款 我遇到以下错误:您不能为此类交易退款

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 的帐户且尚未退款的捕获/销售进行退款。


*

  1. 第三方 API 调用,您在 API 参数中使用“主题”以及您的用户名、密码和签名/证书,您是代表“主题的帐户”发送 API 调用。
  2. 第一方 API 调用是您不发送主题,仅使用您自己的 API 用户、密码和签名/证书

关于asp.net-mvc - 授权交易退款时出现错误 10009,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9526406/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com