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 by not sending email address
Pages: [1]

Author Topic: Defaulting to Paypal Credit Card screen by not sending email address  (Read 1746 times)

wjm

  • I post occasionally
  • **
  • Posts: 88
  • Karma: 0
  • CiviCRM version: Latest
  • CMS version: Joomla (Latest)
Defaulting to Paypal Credit Card screen by not sending email address
March 13, 2012, 05:31:42 pm
I've discovered that when email address is not sent to Paypal during a Website Standard transaction, the "Credit Card" entry screen shows up instead of the default Paypal login screen.  I would like to have the ability to have this happen if I choose in CiviCRM. 

As a test, I set up a vanilla environment.  I'm using Joomla 2.5.1 and CiviCRM 4.1.1.  I then took the file  /administrator/components/com_civicrm/civicrm/CRM/Core/Payment/PayPalImpl.php and made a copy of it... calling it PayPalImpl2.php.  In it, I changed the following:

1)  Changed 2 occurrences of CRM_Core_Payment_PaypalImpl to CRM_Core_Payment_PaypalImpl2
2)  I changed the following code at line 465 by eliminating "email":

So this:
     
Code: [Select]
  $otherVars = array( 'first_name'         => 'first_name',
                            'last_name'          => 'last_name',
                            'street_address'     => 'address1',
                            'country'            => 'country',
                            'preferred_language' => 'lc',
                            'city'               => 'city',
                            'state_province'     => 'state',
                            'postal_code'        => 'zip',
                            'email'              => 'email' );

Became this:
       
Code: [Select]
$otherVars = array( 'first_name'         => 'first_name',
                            'last_name'          => 'last_name',
                            'street_address'     => 'address1',
                            'country'            => 'country',
                            'preferred_language' => 'lc',
                            'city'               => 'city',
                            'state_province'     => 'state',
                            'postal_code'        => 'zip' );

I then added a record to the civicrm_payment_processor_type table.  I basically copied the PayPal_Standard record, changed the ID to the next available, and changed the class_name field to Payment_PayPalImpl2.

In then ran a live transaction from my personal Paypal Account to my Business Paypal account and everything seemed to work fine. 

I'm just curious if anyone with expertise in the Paypal Website Standard payment code could tell me if there is any cause for concern in NOT SENDING the email address to Paypal. 

Thoughts?

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 by not sending email address
March 13, 2012, 08:21:19 pm

rather than eliminating email (which i suspect and hope paypal uses to avoid the user typing in their email again), can you add the parameter

landingpage=creditcard

which u described in the oher forum post

thanx

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 by not sending email address
March 14, 2012, 03:53:06 am
Donald,

Unfortunately, it turns out that the "LANDINGPAGE" parameter is for Paypal Express and not available in the Paypal Website Standard API.

I should also mention that the login page will show up (even when email is not sent) if a paypal cookie called "Login_email" is set in your browser.  I don't see that as a problem, though, as many who have a Paypal account will probably use it.

So... I would LOVE LOVE LOVE attempting to write a hook for this... but I'm having trouble following the docs. 

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

Having trouble mapping this in my head:
Quote
Hook plugins should be placed in the civicrm plugin group in a subfolder with the same name as the plugin..

Once created plugins may be packaged and installed with the Joomla installer or the files can be placed in the appropriate folder and installed with the discover method.

My goal is to:

1) Blank out the "email" field before going to Paypal
2) Send Phone Number to Paypal (specifically to Paypal field "night_ phone_a") if Phone Number is available on the CiviCRM side.  To do this, I've added "Phone" to the "Name and Addess" Profile.  This maps to "phone-Primary-1".
« Last Edit: March 14, 2012, 04:12:51 am by wjm »

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 by not sending email address
March 14, 2012, 09:44:58 am

Might want to check the joomla docs on how to write a plugin.

there is a sample here:

administrator/components/com_civicrm/civicrm/joomla/admin/plugins/civicrm/

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 by not sending email address
March 14, 2012, 11:52:06 am
The docs seemed to be a bit lacking, but I found another hook someone wrote for Joomla and finally figured it out.

I have successfully created a CiviCRM / Joomla plugin / hook that gives this functionality.  Will post later.

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 by not sending email address
March 14, 2012, 12:05:56 pm

can you please update the docs and point to the relevant pages / write better docs so others can use :)

thanx

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]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Defaulting to Paypal Credit Card screen by not sending email address

This forum was archived on 2017-11-26.