【问题标题】:Paypal Refund/Cancel Order auto refundPaypal 退款/取消订单自动退款
【发布时间】:2014-11-26 05:07:17
【问题描述】:

我一直在寻找这个,似乎每个人都说要退款,你必须去paypal网站等,然后客户会在那里退款。

我需要的是: 当客户要退款时,会在我的网站中向管理员发送批准,然后当管理员批准时,管理员将在网站内选择退款金额给客户。 (那我猜,它会直接到paypal并输入电子邮件和密码?)

这可能吗?除了付款之外,每个流程都在我的网站上?我似乎没有找到解决方案,我也没有任何线索。谢谢。

【问题讨论】:

    标签: php api paypal return


    【解决方案1】:

    绝对有可能,

    首先要提出退款请求,您必须存储 Paypal 的交易 ID

    一旦您的管理员点击退款批准按钮

    var refundTransactionRequestType = new RefundTransactionRequestType
    {
        Version = RefundTransactionRequestVersion, //it must be same version with Express Checkout Request Version
        RefundTypeSpecified = true,
        TransactionID = transactionId //HERE You need to set Paypal's TransactionID
    };
    
    
    var refundTransactionRequest = new RefundTransactionRequest( 
                _customSecurityHeaderType, //CustomSecurityHeaderType will have your paypal merchant credentials
                new RefundTransactionReq //Your RefundTransactionRequestType
                {
                    RefundTransactionRequest = refundTransactionRequestType
                });
    
    RefundTransactionResponse refundTransactionResponse;
    
    
    try
    {
        PayPalAPIInterface apiInterface = new PayPalAPIInterfaceClient();
        refundTransactionResponse = apiInterface.RefundTransaction(refundTransactionRequest);
    }
    catch (FaultException err)
    {
        return 123123;//Error CODE
    }
    

    代码适用于 C#,但逻辑相同

    Here is reference for RefundTransaction SOAP

    Here is reference for RefundTransaction NVP

    【讨论】:

    • 我还没有学过C#,你介意用php解释一下吗?我在网上搜索,没有找到任何教程,同样的问题(除了对我来说很难的 paypal 文档)
    • 你是用SOAP还是NVP,我可以帮你集成PHP
    • 我看不清楚两者之间的区别,我想只要我可以选择输入金额,任何一个都可以。非常感谢
    猜你喜欢
    • 1970-01-01
    • 2015-01-28
    • 1970-01-01
    • 1970-01-01
    • 2016-05-31
    • 2014-12-27
    • 2017-08-30
    • 2020-07-23
    • 2021-11-21
    相关资源
    最近更新 更多