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 CiviContribute (Moderator: Donald Lobo) »
  • Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
Pages: [1] 2

Author Topic: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)  (Read 8183 times)

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 11, 2012, 08:03:05 pm
Whenever CiviContribute redirects to Paypal (using Paypal Website Standard), it takes you to the screen that asks to log into Paypal.  Below that is a link that says "Don't have a PayPal account?".  When you press that, the login screen closes, and the credit card screen opens.

I would like to be able to have the credit card screen be the default. 

I find that if I were to manually go to the following URL, "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=<a valid paypal email address>", I get redirected to a payment screen for that Paypal account and it defaults to the Credit Card screen.

Likewise I've done some research and found that that there is an option that can be sent to Paypal that might also work.  Specifically, a variable called "LANDINGPAGE".  It's options are:
   
    Billing – Non-PayPal account
    Login – PayPal account login

Is anyone familiar with what I'd need to do to get this to work (using either of the 2 ways I document above)?

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: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 12, 2012, 09:15:39 am

you can use the hook: hook_civicrm_alterPaymentProcessorParams

http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmalterPaymentProcessorParams

to add the LANDINGPAGE variable we send to paypal

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

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 12, 2012, 05:38:02 pm
Looks promising.  Willing to try it out.  Having trouble, though, figuring out the implementation.

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 12, 2012, 06:43:49 pm
I'm now suspecting that the CIVICRM Paypal Website Standard payment plugin is sending something to force the Paypal Login screen to show.   

I've created the following html form and run it from my desktop.  When submitted, it ALWAYS goes to the Paypal credit card screen.  I don't have any crazy parameters set... just the bare minimum is being Posted.  (Note... you have to put a valid paypal email address below).

Quote
<html>
<head>
</head>
<body>
    <form action="https://www.paypal.com/us/cgi-bin/webscr" method="post"> 
        <input type="hidden" name="cmd" value="_xclick"> 
        <input type="hidden" name="business" value="<ENTER A VALID PAYPAL EMAIL ADDESS"> 
        <input type="hidden" name="item_name" value="Online Contribution: John Doe for Mayor"> 
        <input type="hidden" name="amount" value="9.00"> 
        <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."> 
        <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 
    </form> 
</body>
</html>

Where can I see what values CIVICRM is posting to Paypal?  I would really love to compare.

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: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 12, 2012, 07:21:58 pm

The hook sends you all the values civicrm sends to paypal. You can put in a few debug statements in the hook body and see the values that civicrm sends over

check drupal/civitest.module.sample

to see an implementaton of the hook

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

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 12, 2012, 07:34:30 pm
Actually, I'm using Joomla.  After significant reading...still not quite sure how to implement the hookl :-(

I have been able to determine that the PayPalImpl.php file that handles all of this....

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: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 12, 2012, 07:36:43 pm

http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviCRM+hook+specification#CiviCRMhookspecification-ProceduresforimplementinghooksforJoomla

The example code will still help

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

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 12, 2012, 08:22:09 pm
OK.  Here's what I did. 

I created a test payment processor... using Paypal Website standard... but changed the paypal URL so that the data would not get sent to paypal.

I then created a test contribution payment page and used the payment processor above.

Submitted a test contributions and I was able to capture ALL of the info that would have been sent to paypal from the URL line.

I then created a test form using all of those name/value pairs.  Submitting that form took me to to the paypal login page.

I kept deleting name/value pairs from my form until I got the credit card screen to show instead of the paypal login screen.

My findings?  It's EMAIL.  When the contributor's email address is forwarded to paypal, the user gets the paypal login screen.  If not sent, you get the credit card screen.

Now... next step is to remove the email data being sent to paypal to see if there is any negative effect.

If someone knows... do share :-)

jhofer

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: 3.x
  • CMS version: Drupal 6.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 13, 2012, 08:10:13 pm
Would be interested in how and if you solve this.  Nice work on narrowing it down to removing the email field.

I'm still learning how to implement hooks.  I'd hate to have to hack the civicrm core to remove the code that sends the email field to the processor.  This seems like a big enough issue with a simple enough solution that someone must have created code to implement the hook_civicrm_alterPaymentProcessorParams to solve this... 

Need to get back to my studies on hooks!   :-\

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 13, 2012, 08:13:02 pm
It's not a hack, though.  It's a whole new payment processor.  I call it "Paypal Website Standard-CREDIT CARD".  I used the same exact steps as you would use if you had someone write a payment module for you for a different payment Gateway.

I too would like to see the "Hook" version of this.

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 13, 2012, 08:16:25 pm
Oops... You probably need clarification on my last post.  This will explain it:  http://forum.civicrm.org/index.php/topic,23854.0.html

jhofer

  • I’m new here
  • *
  • Posts: 23
  • Karma: 0
  • CiviCRM version: 3.x
  • CMS version: Drupal 6.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 13, 2012, 10:31:25 pm
Ahh... got it working.  Not sending the email just forces the contributor to input their email 2x ... not a bad trade off for the convenience of going directly to the credit card landing.  We were losing contributions because people thought they needed a PayPal acct.  Thanks for your work on this.

Let me know if you figure out how to keep the email and set landingpage=creditcard as lobotomies suggested ... everything I tried was breaking the code.

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 14, 2012, 01:51:14 am
Exactly... only downfall is entering email address twice.

I don't believe landingpage parameter is available for Paypal Website Standard.  I tested it an it did not work.  It's documented to be for Paypal Express.


wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 14, 2012, 11:50:54 am
Whoo hoo!  Successfully created a CiviCRM / Joomla plugin that gives this functionality.  Will post later.

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Re: Defaulting to Paypal Credit Card screen (on Paypal Website Standard)
March 14, 2012, 03:14:17 pm
Donald,

Where does one post a plugin for sharing?

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Defaulting to Paypal Credit Card screen (on Paypal Website Standard)

This forum was archived on 2017-11-26.