GithubHelp home page GithubHelp logo

Comments (7)

alexanderdean avatar alexanderdean commented on June 30, 2024

Hi @smalldogs - thanks for your kind words. On your issue: nobody has reported a specific issue with the sandbox not populating ipn_order_items. I will recheck the code tonight but I can't think of a setting that would make the sandbox play up just with the line items.

In other words: I wouldn't recommend going live yet, because you will probably experience the same problem in live.

Have you gone through debug mode to check that you haven't got a problem with your setup? Here are my instructions on debug mode:


To switch on debugging, set 'debug' => TRUE for your current environment in the file:

https://github.com/orderly/codeigniter-paypal-ipn/blob/master/common/config/paypal_ipn.php

Once debugging is switched on, this is how you test:

  • Run through your checkout process as normal, making your PayPal sandbox payment etc
  • PayPal will fire your IPN script, something will go wrong
  • Now you manually invoke your IPN URL in a browser and see what happens (e.g. PHP error, database not found error)
  • Fix
  • Repeat

The way that debug mode works is that it stores the last IPN access which had IPN data (i.e. POST variables) into the database, and then when you access the IPN URL directly without data, it reloads the cached data. So it's kind of like a replay mode which let's you directly inspect what the IPN handler is doing.


If the problem isn't at your end, then there may be an issue with either a) a recent PayPal IPN change or b) this pull request from a couple of months ago: #6

Let me know in this thread how your debugging goes and I will investigate as required...

Thanks!

from codeigniter-paypal-ipn.

brwnll avatar brwnll commented on June 30, 2024

I've found at least symptom of the problem.

on Line 64 of ipn_open_model for Active Record, I dumped $orderItems and it was a blank array.

Does the sandbox send the "numItems" variable? My logs on an IPN test:
ERROR --> Severity: Notice --> Undefined index: num_cart_items /libraries/PayPal_IPN.php 297

from codeigniter-paypal-ipn.

alexanderdean avatar alexanderdean commented on June 30, 2024

Hi @smalldogs, thanks - that's a very helpful clue. Can you confirm that PayPal is sending you:

txn_type -> "cart"
num_cart_items -> ""

If it is, then that's your problem: for some reason PayPal is not telling you how many items are in the cart.

To confirm what PayPal is sending you, you need to run a PHP unserialize on the detail field in ipn_log

from codeigniter-paypal-ipn.

brwnll avatar brwnll commented on June 30, 2024

Doesn't appear to pass num_cart_items at all.
Note: These are all the default options in the IPN sandbox, other than business/receiver email for a "Cart Checkout"

Array
(
    [test_ipn] => 1
    [payment_type] => instant
    [payment_date] => 10:28:30 Jan 19, 2012 PST
    [payment_status] => Completed
    [payer_status] => verified
    [first_name] => John
    [last_name] => Smith
    [payer_email] => [email protected]
    [payer_id] => TESTBUYERID01
    [business] => [email protected]
    [receiver_email] => [email protected]
    [receiver_id] => TESTSELLERID1
    [residence_country] => US
    [item_name1] => something
    [item_number1] => AK-1234
    [quantity1] => 1
    [tax] => 2.02
    [mc_currency] => USD
    [mc_fee] => 0.44
    [mc_gross] => 15.34
    [mc_gross_1] => 12.34
    [mc_handling] => 2.06
    [mc_handling1] => 1.67
    [mc_shipping] => 3.02
    [mc_shipping1] => 1.02
    [txn_type] => cart
    [txn_id] => 301191828
    [notify_version] => 2.4
    [custom] => xyz123
    [invoice] => abc1234
    [charset] => windows-1252
    [verify_sign] => AQqMGpA57Y8mvzZacFNIKmzbfGcWAJeab8gULkbXHu7vGdUIUVD8Jn1t
)

I don't know if it is a recent PayPal change, or just a flaw in the sandbox. But that is causing this

$hasCart = ($this->order['txn_type'] == 'cart');
$numItems = $hasCart ? (int)$this->order['num_cart_items'] : 1;

to throw the error, because the txn_type is cart, but there is no num_cart_items variable set.

from codeigniter-paypal-ipn.

alexanderdean avatar alexanderdean commented on June 30, 2024

Ah! I think we're on the same page now @smalldogs When you said you were using the sandbox, I thought you meant you were sending a test order into the PayPal sandbox, but I think you meant that you were hitting the "send test IPN" from the PayPal interface. I don't think PayPal's IPN test is a valid one - because it's saying it's a cart transaction but it's not setting any line items.

So you have two options: 1. go live and test it works with a real order, or 2. deploy to your test environment, and test against the PayPal sandbox using the sandbox settings in https://github.com/orderly/codeigniter-paypal-ipn/blob/master/common/config/paypal_ipn.php

from codeigniter-paypal-ipn.

brwnll avatar brwnll commented on June 30, 2024

I switched to the Live environmental and everything works as expected. Closing this issue with the confirmation that it is a PayPal test IPN issue and not a library issue.

from codeigniter-paypal-ipn.

alexanderdean avatar alexanderdean commented on June 30, 2024

Great - thanks Dustin!

Alex
On Jan 19, 2012 9:25 PM, "Dustin B" <
[email protected]>
wrote:

I switched to the Live environmental and everything works as expected.
Closing this issue with the confirmation that it is a PayPal test IPN issue
and not a library issue.


Reply to this email directly or view it on GitHub:

#9 (comment)

from codeigniter-paypal-ipn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.