CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • A little trouble with test drive
Pages: [1] 2

Author Topic: A little trouble with test drive  (Read 7038 times)

tmccartney

  • I post frequently
  • ***
  • Posts: 154
  • Karma: 9
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.28
A little trouble with test drive
October 07, 2008, 10:50:52 pm
I'm running 2.1 on Drupal.  I have a Paypal Developer Sandbox fake address and entered it in the Payment Processor section of Global Settings.

When I do a test run of the online registration, I have to be logged into Drupal as admin to get into the Paypal sandbox. However, if I'm not logged into Drupal when I enter a test registrant and then continue to payment, I get a Paypal page that says "To access the PayPal Sandbox, please log in to PayPal Developer Central."

Is this expected behavior?

Thanks.

emilyf

  • Ask me questions
  • ****
  • Posts: 696
  • Karma: 54
  • CiviCRM version: 2.x - 4.x
  • CMS version: Drupal 5, 6, 7
Re: A little trouble with test drive
October 08, 2008, 06:45:33 am
I think you have to have another browser tab open and be logged in to paypal sandbox while you test: https://developer.paypal.com/

so you would be logged in there, and then in your other browser tab you would be on your drupal site doing the test drive (and i *think* you should not have to be logged in as admin but don't quote me on it, just try it out)


jbourke

  • Guest
Re: A little trouble with test drive
October 15, 2008, 09:17:56 am
tmccartney -- I was having the same issue.  The answer provided by emilyf is correct; I opened a tab with the developer site logged in, tried a test, and it worked.

emilyf  -- Thanks. :)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: A little trouble with test drive
October 23, 2008, 05:30:31 pm
I never got paypal sandbox to work properly and decided my time was worth more than that so I did a handful of 50 cent transactions on the live site instead.

(BTW - we have been struggling along with paypal for about 6 months but have found it to be really awful so if you have another option I'd go with that)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

sawjer

  • Guest
Re: A little trouble with test drive
November 26, 2008, 09:05:20 am
Quote from: tmccartney on October 07, 2008, 10:50:52 pm
I'm running 2.1 on Drupal.  I have a Paypal Developer Sandbox fake address and entered it in the Payment Processor section of Global Settings.

When I do a test run of the online registration, I have to be logged into Drupal as admin to get into the Paypal sandbox. However, if I'm not logged into Drupal when I enter a test registrant and then continue to payment, I get a Paypal page that says "To access the PayPal Sandbox, please log in to PayPal Developer Central."

Is this expected behavior?

Thanks.


The Sequence of events in test driving online registration is as follows (you have to be logged in to start test drive!):
Register page (civicrm)
Comfirmation page (civicrm)
Transfer page to paypal sandbox. Click on link opens sandbox login to your sandbox account. Do a login. The click on test accounts. This opens the test seller and test buyer accounts.
Mark the buyer account and click enter sandbox test site.
On the screen you get you have right the login for the paypal account. Use it to login to the buyers account (attention enter the proper account name!).  The next screen allows to accept payment. A Confirmation screen appears where you can return to civicrm.
The screen you get has right the paypal login.

The reason for this complicated procedure ist the concept of paypal, that you should have an account with paypal. This would give you the benefit of paying directly from this account. In the live transaction you should not try to login (as most people have no paypal account but use the registration screen for a paypal account. Fill it out but omit the checkbox "Create a paypal account".

Not my favorite. If something goes wrong, there is almost no error reporting. Which means you will have a tedius trial and error procedure to make it work.

Good luck!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: A little trouble with test drive
November 27, 2008, 01:47:00 am
Which leads me to the question - how is it that paypal is so successful when it's such a dog to use.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

sawjer

  • Guest
Re: A little trouble with test drive
December 01, 2008, 11:27:54 am
Only the few developers, that are condemmed to test a software out, will face this, all other will not feel the pain. Obviously Paypal has been the first.

I would be interested to see reasonable alternatives that work in all countries!

ronald

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 5
Re: A little trouble with test drive
December 31, 2008, 08:14:20 am
I've been working through the same problem and it looks like it works, but then doesn't.

Meaning that I get through all the steps for registration, login to the buyer test account, "pay", go back and get the "Thank You" page.
So far, so good. The registration then shows up in the participant list, but as pending/incomplete. There is nothing whatsoever being logged in sites/default/files/civicrm/upload/CiviCRM.log
(Well there's some older stuff in it, which tells me that it is the right file.)

I would find this a bit unsettling if it happened with a live setup - customer pays, gets receipt, confirmation and all, and I don't see any evidence of the payment having gone through, so I'm wondering if that also happens...

Anyway, any tips where to look for clues would be much appreciated.

TIA,

Ronald
« Last Edit: December 31, 2008, 08:17:57 am by ronald »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: A little trouble with test drive
December 31, 2008, 12:08:04 pm

are you using paypal standard? if so, you might want to add a debug statement here: CRM/Core/Payment/PayPalImpl.php, line 397 (for v2.1) and add:

Code: [Select]
CRM_Core_Error::debug( 'paypalURL', $paypalURL );
exit( );

and check the value of notifyURL (should be extern/ipn.php).  try using that URL in a browser and ensure it works. You might want to get onto IRC if the above does reveal anything (http://embed.mibbit.com/?server=irc.freenode.net&channel=%23civicrm&forcePrompt=true)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ronald

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 5
Re: A little trouble with test drive
January 01, 2009, 12:38:12 am
Lobo, many thanks for your quick and, as usual, spot-on reply - much appreciated!

Thanks to your instructions I got a step further.

The first problem was that CRM-3444 raised its ugly head - I had installed 2.1.4 but forgot to patch civicrm.config.php and thus the valid configuration dir was not found. Applying my patch fixed that one, but the process still doesn't work.

If I use the whole (decoded) URL from "notify_url=" onwards, I get "access denied" and this in the error log:
mod_security: Access denied with code 403. Pattern match "\\\\.php\\\\?.*=(https?|ftp)\\\\:/.*(cmd|command)="

If I only use the part up to the next ":", which seems somewhat logical, I get Failure: Missing Parameter.
I've tried various other cut-off points for the URL but always seem to get one of the above.

Looking closer at the pattern above, I removed the &cmd=_xclick&amount=2 from the end of the URL and got no "access denied" anymore, but the missing parameter message persists.

[Edit: and this in /sites/default/files/civicrm/upload/CiviCRM.log
Jan 01 19:35:24  [info] Could not find an entry for payment_status in POST]

[Edit2: I also tried the (decoded) piece of the URL between "notify_url=" and the next unencoded "&", assuming that the latter indicates the next parameter for PayPal rather than my site, but still the same result.]

[Edit3: FWIW, the URL referred to in edit2 is /civicrm/extern/ipn.php?reset=1&contactID=12&contributionID=15&module=event&eventID=1&participantID=11&item_name=Online+Event+Registration%3A+Test+Event - no difference if I swap %3A for :]

Any ideas what I'm missing here?

[Edit4: I think I understand why there might be (a) missing parameter/s (and no payment status) when accessing the link directly rather than PayPal calling it with whatever parameters it does that. However when I just try to acess /civicrm/extern/ipn.php without parameters, I get "Access Denied" - is that expected behaviour?]


Thanks again,

Ronald
« Last Edit: January 01, 2009, 04:23:15 am by ronald »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: A little trouble with test drive
January 01, 2009, 06:41:25 am
Quote from: ronald on January 01, 2009, 12:38:12 am
[Edit4: I think I understand why there might be (a) missing parameter/s (and no payment status) when accessing the link directly rather than PayPal calling it with whatever parameters it does that. However when I just try to acess /civicrm/extern/ipn.php without parameters, I get "Access Denied" - is that expected behaviour?

That is the error. You should not get access denied for that url:

check: http://drupal.demo.civicrm.org/sites/drupal.demo.civicrm.org/modules/civicrm/extern/ipn.php

which is the notify url for the demo server

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ronald

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 5
Re: A little trouble with test drive
January 01, 2009, 06:55:04 am
Quote from: Donald Lobo on January 01, 2009, 06:41:25 am
That is the error. You should not get access denied for that url:

check: http://drupal.demo.civicrm.org/sites/drupal.demo.civicrm.org/modules/civicrm/extern/ipn.php

which is the notify url for the demo server

For that one I get
Could not get module name from request url

[Edit: same result when I try /sites/all/modules/civicrm/extern/ipn.php on my own site.
And http://drupal.demo.civicrm.org/civicrm/extern/ipn.php gives me "Access Denied".]

Is that expected behaviour, then?

Cheers,

Ronald
« Last Edit: January 01, 2009, 07:04:39 am by ronald »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: A little trouble with test drive
January 01, 2009, 08:27:36 am

Basically we add extern/ipn.php to the resourceURL (http://drupal.demo.civicrm.org/civicrm/admin/setting/url?reset=1)

That url needs to exist and without parameters should give you: Could not get module name from request url

You notify url should be resource url + 'extern/ipn.php'

i'd ensure the above works. Might be a result of your symlink patch?

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

ronald

  • I post occasionally
  • **
  • Posts: 48
  • Karma: 5
Re: A little trouble with test drive
January 01, 2009, 03:32:36 pm
Quote from: Donald Lobo on January 01, 2009, 08:27:36 am

Basically we add extern/ipn.php to the resourceURL (http://drupal.demo.civicrm.org/civicrm/admin/setting/url?reset=1)

That url needs to exist and without parameters should give you: Could not get module name from request url

You notify url should be resource url + 'extern/ipn.php'

i'd ensure the above works. Might be a result of your symlink patch?

Thanks for the pointer.
Looking at the code in /civicrm/current/CRM/Core/Payment from line 275 I don't see how the patch could have an impact on the notify url:

Code: [Select]
        $notifyURL =
            $config->userFrameworkResourceURL .
            "extern/ipn.php?reset=1&contactID={$params['contactID']}" .
            "&contributionID={$params['contributionID']}" .
            "&module={$component}";


Hm. But it's not using the value I set at http://mysite.com.au/civicrm/admin/setting/url?reset=1
Sorry if this is a stupid question, but does the first bit of the code go straight to the value set at that page, or is there any internal processing happening in between?

Another thing I don't understand is why/how the internal paths are being used externally:
in Drupal, civicrm would reside in /path/to/website/sites/(<site>|all)/modules/.
As I understand it, this path is used internally by Drupal to associate the modules in there with the actual website that's being accessed, so if there are different sites, it would use the appropriate subdirectories. My idea of this is that that is purely internal and should be transparent to a visitor of the site.
Accordingly, CiviCRM can be accessed through http://mysite.com.au/civicrm, administered through http://mysite.com.au/civicrm/admin, etc, even though these are all virtual addresses which do not directly resolve to anything in the underlying file system. When I mouse over the CiviCRM menus and settings, the urls all work that way, i.e. all point to http://mysite.com.au/civicrm/something.
So what I don't understand is why in this case (with extern/ipn.php) that internal structure now needs to be explicitly navigated. In keeping with the mapping that's used by everything else I mentioned, wouldn't it make sense to map that in the same way to http://mysite.com.au/civicrm/extern/ipn.php, rather than to a path that depends on the internal structure of the setup?

That is where I think the symlink patch might in fact contribute to the problem if and when the path is being processed somewhere between setting and retrieving it because it retrieves the current logical path from where httpd believes it is, so if that is using the mapped path at the time when userFrameworkResourceURL url is being worked on, that would be used for it.

Problem is that without my symlink patch, I don't even get that far because it looks for the configuration file in the wrong place. So I guess with the qualification above, there might indeed be the hitch.

Now the question is if there is any such processing happening. If yes, then the next questions would be where and whether it would be better to modify the patch to handle this case differently, or to bring that single URL in line with how the rest of them work.

Cheers,

Ronald
« Last Edit: January 01, 2009, 03:35:34 pm by ronald »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: A little trouble with test drive
January 01, 2009, 08:52:14 pm

1. The userFrameworkResourceURL should be the exact url that you save in url setting form. There is no transformation that happens (to the best of my knowledge). You might want to print the config object and check it out.

2. The cron scripts are invoked from outside of the CMS framework (and hence bypass the CMS). I dont remember the exact reasons why we wanted to bypass the CMS. I suspect we should pull this back into the CMS in future releases and bypass a few issues

lobo






A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • A little trouble with test drive

This forum was archived on 2017-11-26.