PayPal 自适应付款退款问题

Posted

技术标签:

【中文标题】PayPal 自适应付款退款问题【英文标题】:PayPal Adaptive Payments refund Issue 【发布时间】:2013-03-09 22:28:06 【问题描述】:

我正在尝试将自适应支付链式付款完全退还给发件人,但我被卡住了。我正在使用 CodeIgniter 和 Andrew Angell's awesome library 进行自适应支付。

我要退款的详细信息如下:(您可以在下面查看原始 xml 请求和响应)

Array
(
    [Errors] => Array
        (
        )

    [Ack] => Success
    [Build] => 5472483
    [CorrelationID] => 4d31bf900a109
    [Timestamp] => 2013-03-20T09:45:02.585-07:00
    [ActionType] => PAY_PRIMARY
    [CancelURL] => http://my-cancel-url.com
    [CurrencyCode] => TRY
    [FeesPayer] => PRIMARYRECEIVER
    [FundingTypes] => Array
        (
        )

    [IPNNotificationURL] => 
    [Memo] => 
    [PayKey] => my-paykey
    [PaymentInfo] => Array
        (
            [PendingRefund] => false
            [RefundAmount] => 0.00
            [SenderTransactionID] => 
            [SenderTransactionStatus] => COMPLETED
            [TransactionID] => my-transaction-id
            [TransactionStatus] => COMPLETED
        )

    [PreapprovalKey] => 
    [ReturnURL] => http://success-url-area.com
    [ReverseAllParallelPaymentsOnError] => false
    [SenderEmail] => sender@email.com
    [Status] => INCOMPLETE
    [TrackingID] => 
    [Receiver] => Array
        (
            [Amount] => 5.00
            [Email] => receiver@email.com
            [InvoiceID] => 
            [PaymentType] => SERVICE
            [Primary] => true
        )

    [XMLRequest] => <?xml version="1.0" encoding="utf-8"?><PaymentDetailsRequest xmlns="http://svcs.paypal.com/types/ap"><requestEnvelope xmlns=""><detailLevel>ReturnAll</detailLevel><errorLanguage>en_US</errorLanguage></requestEnvelope><payKey xmlns="">my-paykey</payKey></PaymentDetailsRequest>
    [XMLResponse] => <?xml version='1.0' encoding='UTF-8'?><ns2:PaymentDetailsResponse xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-03-20T09:45:02.585-07:00</timestamp><ack>Success</ack><correlationId>4d31bf900a109</correlationId><build>5472483</build></responseEnvelope><cancelUrl>http://my-cancel-url.com</cancelUrl><currencyCode>TRY</currencyCode><paymentInfoList><paymentInfo><transactionId>my-transaction-id</transactionId><transactionStatus>COMPLETED</transactionStatus><receiver><amount>5.00</amount><email>receiver@email.com</email><primary>true</primary><paymentType>SERVICE</paymentType><accountId>7VYWTSCQKWPAL</accountId></receiver><refundedAmount>0.00</refundedAmount><pendingRefund>false</pendingRefund><senderTransactionId>7P642947V2872150G</senderTransactionId><senderTransactionStatus>COMPLETED</senderTransactionStatus></paymentInfo><paymentInfo><receiver><amount>4.60</amount><email>soulsmasher@gmail.com</email><primary>false</primary><paymentType>SERVICE</paymentType><accountId>7UZSWUVKCU4UW</accountId></receiver><refundedAmount>0.00</refundedAmount><pendingRefund>false</pendingRefund></paymentInfo></paymentInfoList><returnUrl>http://success-url-area.com</returnUrl><senderEmail>sender@email.com</senderEmail><status>INCOMPLETE</status><payKey>my-paykey</payKey><actionType>PAY_PRIMARY</actionType><feesPayer>PRIMARYRECEIVER</feesPayer><reverseAllParallelPaymentsOnError>false</reverseAllParallelPaymentsOnError><sender><email>sender@email.com</email><accountId>Y2BSLXZ8DQYY2</accountId><useCredentials>false</useCredentials></sender></ns2:PaymentDetailsResponse>
)

当我尝试执行退款时,提供支付密钥、交易 ID(我从上面的请求中获得)和发件人电子邮件(将获得退款)出现此错误(您可以在下面看到原始请求和响应):

Array
(
    [Errors] => Array
        (
            [0] => Array
                (
                    [Receiver] => 
                    [Category] => Application
                    [Domain] => PLATFORM
                    [ErrorID] => 589061
                    [ExceptionID] => 
                    [Message] => The receiver sender@email.com is invalid for this refund
                    [Parameter] => sender@email.com
                    [Severity] => Error
                    [Subdomain] => Application
                )

        )

    [Ack] => Failure
    [Build] => 5472483
    [CorrelationID] => 2a1630b772ee0
    [Timestamp] => 2013-03-20T09:52:10.986-07:00
    [EncryptedTransactionID] => 
    [RefundFeeAmount] => 
    [RefundGrossAmount] => 
    [RefundHasBecomeFull] => 
    [RefundNetAmount] => 
    [RefundStatus] => 
    [RefundTransactionStatus] => 
    [TotalOfAllRefunds] => 
    [Receiver] => Array
        (
            [Amount] => 
            [Email] => 
            [InvoiceID] => 
            [PaymentType] => 
            [Primary] => 
        )

    [RawRequest] => <?xml version="1.0" encoding="utf-8"?><RefundRequest xmlns="http://svcs.paypal.com/types/ap"><requestEnvelope xmlns=""><detailLevel>ReturnAll</detailLevel><errorLanguage>en_US</errorLanguage></requestEnvelope><currencyCode>TRY</currencyCode><payKey xmlns="">my-paykey</payKey><receiverList xmlns=""><receiver xmlns=""><amount xmlns="">1.00</amount><email xmlns="">sender@email.com</email><paymentType xmlns="">SERVICE</paymentType></receiver></receiverList><transactionId xmlns="">1VL98806A27476639</transactionId></RefundRequest>
    [RawResponse] => <?xml version='1.0' encoding='UTF-8'?><ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-03-20T09:52:10.986-07:00</timestamp><ack>Failure</ack><correlationId>2a1630b772ee0</correlationId><build>5472483</build></responseEnvelope><error><errorId>589061</errorId><domain>PLATFORM</domain><subdomain>Application</subdomain><severity>Error</severity><category>Application</category><message>The receiver sender@email.com is invalid for this refund</message><parameter>sender@email.com</parameter></error></ns3:FaultMessage>
)
1

此外,当我不提供交易 ID 并将其余部分留给 PayPal 时,问题会发生变化(原始 XML 请求位于数组下方):

Array
(
    [Errors] => Array
        (
            [0] => Array
                (
                    [Receiver] => 
                    [Category] => Application
                    [Domain] => PLATFORM
                    [ErrorID] => 589036
                    [ExceptionID] => 
                    [Message] => The currency code is missing or doesn't match the code in the payment request
                    [Parameter] => 
                    [Severity] => Error
                    [Subdomain] => Application
                )

        )

    [Ack] => Failure
    [Build] => 5472483
    [CorrelationID] => e3fc5e41040f3
    [Timestamp] => 2013-03-20T10:02:29.233-07:00
    [EncryptedTransactionID] => 
    [RefundFeeAmount] => 
    [RefundGrossAmount] => 
    [RefundHasBecomeFull] => 
    [RefundNetAmount] => 
    [RefundStatus] => 
    [RefundTransactionStatus] => 
    [TotalOfAllRefunds] => 
    [Receiver] => Array
        (
            [Amount] => 
            [Email] => 
            [InvoiceID] => 
            [PaymentType] => 
            [Primary] => 
        )

    [RawRequest] => <?xml version="1.0" encoding="utf-8"?><RefundRequest xmlns="http://svcs.paypal.com/types/ap"><requestEnvelope xmlns=""><detailLevel>ReturnAll</detailLevel><errorLanguage>en_US</errorLanguage></requestEnvelope><currencyCode>TRY</currencyCode><payKey xmlns="">AP-52A99028X8685964M</payKey><receiverList xmlns=""><receiver xmlns=""><amount xmlns="">1.00</amount><email xmlns="">sender@email.com</email><paymentType xmlns="">SERVICE</paymentType></receiver></receiverList></RefundRequest>
    [RawResponse] => <?xml version='1.0' encoding='UTF-8'?><ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-03-20T10:02:29.233-07:00</timestamp><ack>Failure</ack><correlationId>e3fc5e41040f3</correlationId><build>5472483</build></responseEnvelope><error><errorId>589036</errorId><domain>PLATFORM</domain><subdomain>Application</subdomain><severity>Error</severity><category>Application</category><message>The currency code is missing or doesn't match the code in the payment request</message></error></ns3:FaultMessage>
)
1

如您所见,我已经提供了 CurrencyCode,发件人的电子邮件地址也是从请求本身中获取的,以防止拼写错误。即使我硬编码也不会改变这种情况。

你能帮帮我吗,我错过了什么?

谢谢,

【问题讨论】:

【参考方案1】:

检查文档说 paypal here

Turkish Lira     TRY

NOTE:This currency is supported as a payment currency and a currency balance for in-country PayPal accounts only.

【讨论】:

以上是关于PayPal 自适应付款退款问题的主要内容,如果未能解决你的问题,请参考以下文章

Paypal 自适应支付和 IPN

如何启用贝宝自适应付款的退款?

模式窗口中的PayPal自适应付款?

PayPal 自适应付款登录失败

PayKey 使用 Paypal 自适应付款的工作流程

自适应付款支付 API 错误 580001