1
votes

I am making use of Paypal adaptive payments using AngellEye library.

Everything works great except IPN. When using Paypal in Sandbox mode I get a notifications to my URL. However, as soon as I go live I get no IPN POST requests to my server. I checked my Apache access.log.

Do I need to enable Paypal IPN for live adaptive payments somewhere?

In my Paypal account, under selling preferences, it shows IPN as disabled. To enable it and I need to also supply a URL. However, my URL is dynamic and I assumed since I am using the Paypal API, I do not need to change this?

Usage of IPN:

    $PayRequestFields = array(
        'ActionType' => 'CREATE',                                               
        'CancelURL' => base_url() . 'd/cancel/' . $this->transactionID,                                    
        'CurrencyCode' => $this->product->currency, 
        'ReturnURL' => base_url() . 'd/success/' . $this->transactionID,
        'FeesPayer' => 'PRIMARYRECEIVER',
        'IPNNotificationURL' => base_url() . 'ipn/status/' . $this->transactionID,  
        );
2
Did you already enable Instant Payment Notifications in your Live PayPal Account? Let me know if you need instructions.pp_MSI_Jenn
@pp_MSI_Jenn Are you referring to settings in my Paypal account? If so, I have not enabled it as it requires a URL which is dynamic for my application. Can it not be enabled programmatically?Abs
I've updated my question to show how I use Andrew's library.Abs

2 Answers

7
votes

Adaptive Payments IPN's are a little different in that the application will receive one (if configured) and then the merchant/seller account would also get one based on the actual transaction they received.

For example, if your app generates a Pay request on behalf of a 3rd party user and you set the NotificationURL in the Pay request, then an app specific IPN would be sent to that URL. A transaction specific IPN would be sent to the URL that the seller account has configured in their own PayPal account.

You also need to make sure your IPN script is configured to handle the Adaptive IPN's correctly. The parameter names that it sends are like some.name, and the . doesn't work with regular $_POST['paramname'] logic. Check out this IPN template for how it handles it...you may just want to use it.

Here's a sample of an application IPN I received when I ran a Pay request just now.

Array
(
    [transaction] => 
    [payment_request_date] => Tue May 06 12:49:35 PDT 2014
    [return_url] => http://paypal.angelleye.com/paypal/class/1.2/Pay_Return.php
    [fees_payer] => EACHRECEIVER
    [ipn_notification_url] => http://sandbox.angelleye.com/paypal/ipn/ipn-listener.php
    [sender_email] => [email protected]
    [verify_sign] => AFcWxV21C7fd0v3bYYYRCpSSRl31ArVBOvsxhUiZ-m0M3mFjhNWWaRjM
    [test_ipn] => 1
    [cancel_url] => http://paypal.angelleye.com/paypal/class/1.2/Pay_Cancel.php
    [pay_key] => AP-8YH799874R4873815
    [action_type] => PAY
    [transaction_type] => Adaptive Payment PAY
    [status] => INCOMPLETE
    [log_default_shipping_address_in_transaction] => false
    [charset] => windows-1252
    [notify_version] => UNVERSIONED
    [reverse_all_parallel_payments_on_error] => false
)
0
votes

I contacted Paypal support and this is what they had to say:

I checked your current IPN settings for your account and it appears IPN is set to 'Off', not 'Disabled'. This is a very important difference, as IPN being disabled prevents IPN messages from being sent at all. If IPN is simply turned off, PayPal will only send IPN messages if a notify_url is specified in the payment request. For Adaptive Payments, the notify_URL is the only way to trigger IPN messages, so IPN can be in the 'Off' setting and worked correctly, but not disabled.

This was received after I randomly fixed the problem myself. The way I got it to work was simply playing around with my account settings. I enabled IPN in my account and then disabled it, after this all my IPN requests came flooding in to my IPN URL set in my Adaptive Payments API call.