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.

SCM Sandbox IPN failing to register in EE

March 04, 2009 10:00am

Subscribe [4]
  • #1 / Mar 04, 2009 10:00am

    BridgingUnit

    214 posts

    Hi there,

    I’ve been reading through the forums/documentation on this and so far here’s what I’ve done:

    Verified Paypal sandbox test account for buyer (business) and seller (personal)
    Paypal Test account for seller email address used in SCM control panel
    IPN settings for Paypal test account for seller set to address in SCM
    Changed $debug to TRUE in mod.simple_commerce.php
    Registered, Logged in and tested purchase for Paypal Test Buyer account
    Returned to expected URL
    Added the email code in mod.simple_commerce.php
    Ran the CURL test template and that’s all fine
    Received expected debug email
    Paypal Test seller shows purchase successful.

    But EE doesn’t show purchases….

    Oh, and this did work (finally) once before I knocked off for last weekend.

    Anyone got any ideas please?

  • #2 / Mar 04, 2009 10:25am

    Sue Crocker

    26054 posts

    Oh, and this did work (finally) once before I knocked off for last weekend.

    What changed between now and then?

  • #3 / Mar 04, 2009 10:46am

    BridgingUnit

    214 posts

    Hi Sue,

    Hit server problems on Monday and I believe it was transferred to a new box. Not sure how that might be affecting things though…. Everything else seems to still be working correctly on the install.

  • #4 / Mar 04, 2009 1:19pm

    BridgingUnit

    214 posts

    Okay, just updated install to 1.6.7 latest build to see if that might help. No dice.

    Any ideas?

  • #5 / Mar 04, 2009 3:45pm

    BridgingUnit

    214 posts

    Right I’ve narrowed things down a bit further.

    Seems as though the problem is from line 393 in mod.simple_commerce.php onwards somewhere.

    The $url returned from line 383 is https://www.sandbox.paypal.com/cgi-bin/webscr

    But then no $result appears to be returned from the curl_process on line 396, though the function curl_init does appear to exist alright.

    Can anyone point me in the direction of what the problem is here please?

    Thank you

  • #6 / Mar 04, 2009 3:49pm

    BridgingUnit

    214 posts

    Here’s a copy of the most recent debug email that was triggered in case it helps flag anything up:

    Array
    (
    [mc_gross] => 5.00
    [protection_eligibility] => Eligible
    [address_status] => confirmed
    [payer_id] => 5TCL6HY7SVSGC
    [tax] => 0.00
    [address_street] => 1 Main Terrace
    [payment_date] => 11:42:05 Mar 04, 2009 PST
    [payment_status] => Completed
    [charset] => windows-1252
    [address_zip] => W12 4LQ
    [first_name] => Test
    [mc_fee] => 0.37
    [address_country_code] => GB
    [address_name] => Test User
    [notify_version] => 2.7
    [custom] => 11
    [payer_status] => verified
    [business] => .(JavaScript must be enabled to view this email address)
    [address_country] => United Kingdom
    [address_city] => Wolverhampton
    [quantity] => 1
    [verify_sign] => A.BSOpYjPGRF7DIpQ0YMFT9vj3mtAWO1.OgdgJoB8mm9CLieXh3lOdeU
    [payer_email] => .(JavaScript must be enabled to view this email address)
    [txn_id] => 7D85681888972050N
    [payment_type] => instant
    [last_name] => User
    [address_state] => West Midlands
    [receiver_email] => .(JavaScript must be enabled to view this email address)
    [payment_fee] => 
    [receiver_id] => C8R9NLMA6CJWA
    [txn_type] => web_accept
    [item_name] => Entrants Fee: Under 17 Individual
    [mc_currency] => GBP
    [item_number] => 3
    [residence_country] => GB
    [test_ipn] => 1
    [handling_amount] => 0.00
    [transaction_subject] => 11
    [payment_gross] => 
    [shipping] => 0.00
    )
  • #7 / Mar 04, 2009 5:20pm

    Ingmar

    29245 posts

    That looks good. Just to make sure, are you doing these purchases with a registered and logged in member? Because EE only registers those.

    Another thing is, I have had a lot of issues with the sandbox. Would trying the transaction with a minuscule amount on the “real” PayPal site be an option?

  • #8 / Mar 04, 2009 6:04pm

    BridgingUnit

    214 posts

    Thanks for responding Ingmar,

    Yes, as said earlier ‘Registered, Logged in and tested purchase for Paypal Test Buyer account’. It’s even using the same email as the Paypal Test Buyer account just in case anything funny is going on there too.

    Will check real Paypal rather than test Paypal in a tick

  • #9 / Mar 04, 2009 7:12pm

    BridgingUnit

    214 posts

    Nope, still doesn’t work Ingmar. Same result: receive debug email, don’t see purchases in SCM, don’t see SCM gen’d emails :-(

    Tried with an ‘auto return for website payments’ in the ‘website payment preferences’ in Paypal and without (relying on the parameter in the SCM tags). Also tried removing all punctuation characters in the weblog entry associated with the SCM item in case that was throwing anything off.

    3 questions:

    - What’s the minimum amount that Paypal can accept and that the SCM with recognise back in an IPN response? My ‘miniscule amount’ was £0.01.

    - I see an option for ‘payment data transfer’ in the ‘website payment preferences’ in Paypal. Is that relevant? If I click it, I’m provided with a token, but don’t see anywhere in SCM to put it (so haven’t). The only setting in Paypal that I thought essential was the IPN URL itself.

    - In Paypal live, when not using the sandbox, do buyers have to be Paypal verified for IPN responses to be registered usually? I am testing with one that is, but am aware that a lot of the potential clients for this site won’t be. I’m also aware that the docs state that you do need to be, but there seems to be some disagreement on the forums.

    So, what now? Really hope you guys can come up with something, because I’m stumped, and I really need to get this project moving again.

    Thanks for all your help so far.

  • #10 / Mar 04, 2009 7:47pm

    Derek Jones

    7561 posts

    Have you done a var_dump() of $result to see what value it holds?  The server move seems the likely culprit, and it could be that in this new environment, cURL is failing for one reason or another.

  • #11 / Mar 04, 2009 8:26pm

    BridgingUnit

    214 posts

    Just done a print_r() using the same code for the earlier debug email and it comes back blank with no content at all.

  • #12 / Mar 04, 2009 8:35pm

    Derek Jones

    7561 posts

    If it’s failing gracefully, it would be an empty string.  Try it with a var_dump(), please so we can eliminate a boolean FALSE, which print_r() would not reveal.  That will at least tell us where to focus attention.

  • #13 / Mar 04, 2009 8:56pm

    BridgingUnit

    214 posts

    If I swap it for the print_r() in the same code as for the debug email, this is what I get in the email:

    string(0) “”

    Have I put it in the right place?

  • #14 / Mar 05, 2009 4:43am

    BridgingUnit

    214 posts

    Okay, when I add in this code to line 526, in the curl_process function,

    // Check if any error occured
    if(curl_errno($ch) || !$ch)
    {
        echo 'cURL error: ' . curl_error($ch);
        echo "cURL error number: " .curl_errno($ch);
    }

    this is what I get:

    string(83) “cURL error: Protocol https not supported or disabled in libcurlcURL error number: 1”

    But I’m not using https anywhere consciously myself and I’ve doublechecked settings in SCM and can’t see anything there that might be triggering that.

    Can anyone help please?

  • #15 / Mar 05, 2009 8:44am

    BridgingUnit

    214 posts

    Looks like the https is generated by the SCM module for the $url, which explains that. Tried hardcoding $url with https and without. Without works, with doesn’t, so the error message reports accurately. I’m getting the hosts to look into things more deeply now as apparently settings report that things should be working okay. Looks like cURL is either not correctly configured with SSL or there’s a problem with OpenSSL. Will report back here with their results (so please keep this open til then).

    In the meantime though I must press on with this project (lost nearly a day and a half so far to this particular problem), so will hardcode a non-https $url for the time being (with a view to rolling back when we get to the bottom of this). Can someone who knows and is more familiar with Paypal’s API and IPN tell me what the implications of running things like this will be and what problems I may be opening myself up to when going down this route please?

    Thanks for all your help.

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

ExpressionEngine News!

#eecms, #events, #releases