简体   繁体   中英

PayPal Adaptive Payments - Failing on PayPal Website

I've spent the better part of the afternoon dealing with this issue so any help is appreciated.

I'm using ActiveMerchant with the active_paypal_adaptive_payment gateway and I'm running into some problems. Firstly, I don't have an app ID and I'm not sure where to get one. I'm wondering if this is my problem.

My goal is to send money from one user's PayPal account to another's using the Adaptive API. I've debugged to the point where I'm certain that the ActiveMerchant Gateway is producing the correct XML:

<?xml version="1.0" encoding="UTF-8"?>
<PayRequest>
    <requestEnvelope>
        <detailLevel>ReturnAll</detailLevel>
        <errorLanguage>en_US</errorLanguage>
    </requestEnvelope>
    <actionType>PAY</actionType>
    <cancelUrl>http://localhost:3000/.../</cancelUrl>
    <returnUrl>http://localhost:3000/.../</returnUrl>
    <ipnNotificationUrl>http://localhost:3000/.../</ipnNotificationUrl>
    <currencyCode>USD</currencyCode>
    <receiverList>
        <receiver>
            <email>sandbox_account@gmail.com</email>
            <amount>100.0</amount>
        </receiver>
    </receiverList>
    <reverseAllParallelPaymentsOnError>false</reverseAllParallelPaymentsOnError>
</PayRequest>

PayPal responds with:

response_rash: !ruby/hash:Hashie::Rash
  response_envelope: !ruby/hash:Hashie::Rash
    timestamp: '2012-05-28T15:02:43.381-07:00'
    ack: Success
    correlation_id: 881baf8e93444
    build: '2945555'
  pay_key: AP-879734246V2339109
  payment_exec_status: CREATED

I then redirect the user to the correct PayPal page. The user logs in, reviews their information, and then hits "Pay," at which point they are hit with this error:

Your payment can't be completed. Please return to the participating website and try again.

I even uploaded to a staging environment to see if the IPN is triggered but it is not, I assume this is because the payment is never actually completed. I wish I could see what's happening on PayPal's end but I don't think they offer any tools to do that.

Has anyone seen a similar error? Any advice as to where to proceed next?

The problem was in fact the lack of an App ID. After some digging I found that the Sandbox Global APP ID is APP-80W284485P519543T. This has it working for now until I get a real App ID.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM