ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple Commerce IPN Issues

January 17, 2011 12:22pm

Subscribe [4]
  • #1 / Jan 17, 2011 12:22pm

    Jack McDade

    425 posts

    Hey there,

    I’m having issues with IPNs saving to the database on the live environment. On dev, and my initial tests on live, everything worked swimmingly, and nothing has changed since then. Here’s what i know.

    Action ID is correctly set between paypal + EE2, and accessible (htaccess not an issue, and tested w/out)

    Email address is exactly the same, sentence case and all, between paypal + EE2.

    Turning on email IPN debug WILL send me the output. It is below:

    Array
    (
    [handling_amount] => 0.00
    [payer_id] => ANONYMIZED 
    [address_country_code] => US
    [address_zip] => 12065
    [shipping] => 0.00
    [charset] => windows-1252
    [payment_gross] => 15.00
    [address_status] => confirmed
    [address_street] => ANONYMIZED
    [receipt_id] => 0479-6002-3189-XXXX
    [verify_sign] => Aw-NJRD9KanRn7UxFJ79IYiIjGFAAAhxp2o81fVW7DQ9-65Xf9hWAj.m
    [item_name] => ANONYMIZED
    [txn_type] => web_accept
    [receiver_id] => ANONYMIZED
    [payment_fee] => 0.74
    [mc_currency] => USD
    [transaction_subject] => 1
    [custom] => 1
    [protection_eligibility] => Eligible
    [address_country] => United States
    [payer_status] => verified
    [first_name] => ANONYMIZED
    [address_name] => ANONYMIZED
    [mc_gross] => ANONYMIZED
    [payment_date] => 07:42:32 Jan 17, 2011 PST
    [payment_status] => Completed
    [quantity] => 1
    [business] => ANONYMIZED
    [item_number] => 1
    [last_name] => ANONYMIZED
    [address_state] => NY
    [txn_id] => ANONYMIZED
    [mc_fee] => ANONYMIZED
    [resend] => true
    [payment_type] => instant
    [notify_version] => 3.0
    [payer_email] => ANONYMIZED
    [receiver_email] => ANONYMIZED
    [address_city] => ANONYMIZED
    [tax] => 0.00
    [residence_country] => US
    )

    Any thoughts?

  • #2 / Jan 17, 2011 12:31pm

    Jack McDade

    425 posts

    Also, worth noting, my simple_commerce_purchases table has 2 entries, my Purchases view in the module shows 1, and at the bottom of the results table, it says “Showing 0 to 0 of 0 entries”.

    EDIT: I figured this part out—had a test purchase from a member account that was subsequently deleted.

    Still having the original, main issue though. IPNs not saving in the database.

  • #3 / Jan 17, 2011 1:50pm

    Jack McDade

    425 posts

    I’ve added some logging to the mod. file and am seeing that the process dies when it’s looking for “verified” in the $response. However, the IPN purchaser’s status IS verified.

  • #4 / Jan 17, 2011 2:05pm

    Jack McDade

    425 posts

    Update:

    It’s definitely the following conditional:

    if (stristr($result, 'verified'))

    The value is “verified” but for whatever reason, it dies. Hacking it (temporarily) to be

    if (1==1)

    Any thoughts? At all?

  • #5 / Jan 17, 2011 7:18pm

    andrewjonesdev

    7 posts

    I’m also having this issue. It accepts the payments, but it just won’t store it on my EE2 database.

  • #6 / Jan 17, 2011 7:58pm

    narration

    773 posts

    Well out of my direct fund of knowledge, but this looks like one of those twice-too-cute PHP things.

    Note that the documentation says that stristr returns the substring from the match point if matched, but FALSE if no matches found.

    This is obviously a type roadcrash, and PHP may not be dealing well with it in a logical decision—anyway, the doc is making me seasick 😉.

    You might try

    if (stristr($result, 'verified') !== FALSE)

    and see if this more type-correct and type-managed version works.

    Reference: http://justimho.blogspot.com/2009/10/php-and-great-operator.html

    Not signing this…

  • #7 / Jan 18, 2011 2:59pm

    Lisa Wess

    20502 posts

    Hey, Jack and andjon01 -

    Are both purchaser and seller Verified on PayPal? That is required for this to work.

  • #8 / Jan 18, 2011 5:03pm

    andrewjonesdev

    7 posts

    Ah. Did not know that. Seller definitley is, as its my account i’m selling from, but I don’t think buyer is.

    Thats annoying! although I still receive payment.

    Also I noticed it gives me the option of accepting the payment or refusing it. I’m not sure if there’s an “accept it automatically” setting? Or if this is standard paypal, as I don’t receive payments that often, and its the first time I’ve seen this option.

  • #9 / Jan 18, 2011 9:04pm

    narration

    773 posts

    Jack, I had a moment this afternoon so tried both forms, and actually the original if statement with type ambiguity looks like it works, on EngineHosting PHP 5.1.6 anyway. As expected, the cleaner form does as well.

    I had taken for granted that your data check was valid.

    Maybe the information Lisa points out is the problem for your installation too?

    Regards,
    Clive

  • #10 / Jan 19, 2011 10:48am

    Sue Crocker

    26054 posts

    Jack, what about you? Is the buyer also verified?

  • #11 / Jul 18, 2011 6:38pm

    MasonH

    15 posts

    Just thought I’d update and say that I was experiencing the exact same problem. I changed

    (stristr($result, 'VERIFIED'))

    to

    (1 == 1)

    and my system now accepts and confirms purchases. The other recommendations on the syntax were unsuccessful in my case.

    Thanks!

  • #12 / Jul 19, 2011 9:06am

    Sue Crocker

    26054 posts

    Thanks for letting us know, MasonH.

    Jack, this is a really old thread. Are you OK, and is it alright to close it?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases