Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal WPP Direct Payments & Express Checkout Support


dynamoeffects

Recommended Posts

Apparently I'm not smart enough to post inside the forum on the first try.....

 

http://www.oscommerce.com/forums/index.php?showtopic=228943 :)

 

Can a moderator bump my message into this forum?

:'(

 

The forum is so busy that I don't think that moderators move messages around much. Thanks for the pointer; I suggested an answer to your problem in that thread.

 

Summary for future reference:

Andy was able to check out, but the payment details didn't show up with the order. I suggested that the value for $timeout in /catalog/pear/Services/PayPal/SOAP/Transport/HTTP.php was still at the default value of four seconds. It should be changed to at least 30 seconds. Note that the instructions (README.html) for this module indicate that the value has been changed, but if you check the file (line 62), you will find that it hasn't.

 

--Glen

Link to comment
Share on other sites

The forum is so busy that I don't think that moderators move messages around much. Thanks for the pointer; I suggested an answer to your problem in that thread.

 

Summary for future reference:

Andy was able to check out, but the payment details didn't show up with the order. I suggested that the value for $timeout in /catalog/pear/Services/PayPal/SOAP/Transport/HTTP.php was still at the default value of four seconds. It should be changed to at least 30 seconds. Note that the instructions (README.html) for this module indicate that the value has been changed, but if you check the file (line 62), you will find that it hasn't.

 

--Glen

 

Everyone (esp Glenn, Brian, et al)

 

This thread has been awesome. I'm a newbie, so I took the time to go through all lovely 70 pages. The only silly thing that stumped me was where the pear files were, so I'm going to place it here for anyone who may have the siutation.

 

GREAT MODULE. GREAT SUPPORT. Thanks, everything works well.

 

Beginniners:

If you have PHP 1.4+, then to get PEAR installed simply use http://paypaltech.com/php_pear/

Otherwise, use bullet 1. here: http://www.tutorialjunkies.com/pear_http_upload/

 

:D

Wen'

Link to comment
Share on other sites

Add this function to paypal_wpp.php:

	
//get icon image
function get_icon_image() {
	$icon_image .= tep_image(DIR_WS_ICONS . 'credit_cards.gif', $this->title);
	return $icon_image;
}

Then find the function "selection" and change the following:

						 
From:
					 'module' => MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE,
to:
					 'module' => MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE . '	 ' . $this->get_icon_image(),

 

Put the credit card acceptance mark file in /catalog/images/icons/. You can use mine; right click to download the image. I just updated it to include the latest Visa acceptance mark.

 

credit_cards.gif

 

I adapted this code from contribution 3202, which adds a PayPal icon to the PayPal IPN module.

--Glen

 

 

Ya know..this is really cool in concept, but here's my error code:

 

Fatal error: Call to undefined function: get_icon_image() in /home/gnosishe/public_html/shop/catalog/includes/modules/payment/paypal_wpp.php on line 112

 

 

Here's the code I have:

function selection() {
  //<--get icon image (thanks SteveDallas)-->//
	function get_icon_image() {
	$icon_image .= tep_image(DIR_WS_ICONS . 'checkout_logo.jpg', $this->title);
	return $icon_image;
}
 // <--end get icon image-->//
  global $order;

  for ($i=1; $i < 13; $i++) {
	$expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));
  }

  $today = getdate();
  for ($i=$today['year']; $i < $today['year']+10; $i++) {
	$expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
  }

  $selection = array('id' => $this->code,
					 'module' => MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE . '	 ' . $this->get_icon_image(),

yes, I called my logo something different. But when I leave logo portion in there, the error pops up.

It's late..will think on this tomorrow. Trying to make it too cute after getting the basic installed...is too much. LOL. Maybe the call funciton is just in a bad spot.

Link to comment
Share on other sites

Alright, so here's what I wind up with

checkout.png

 

I decided to keep it simple and just put the link in the English, right next to the word. See below

define('MODULE_PAYMENT_PAYPAL_DP_TEXT_TITLE', 'Credit Card <img src="http://www.gnosishealthproducts.com/images/creditcard_logo.jpg">');

 

OK...much later will figure out the problem w/ the Express checkout not being too express..LOL, but that's later. Hope this helps someone.

 

Claire

Link to comment
Share on other sites

Ya know..this is really cool in concept, but here's my error code:

 

Fatal error: Call to undefined function: get_icon_image() in /home/gnosishe/public_html/shop/catalog/includes/modules/payment/paypal_wpp.php on line 112

Here's the code I have:

 

[snip]

 

Maybe the call funciton is just in a bad spot.

 

Actually, the problem looks like a function scope problem. You defined get_icon_image() inside the definition of the selection() function. Move it up above the line that begins "function selection..." and it will work as advertised.

 

--Glen

Link to comment
Share on other sites

I just installed the payment mod, when I try and process a payment it gives an error, I really new to this so bare with me.

 

I done a screen print below.

 

Payment_error.PNG

 

If anyone can give me some advise that would be really cool.

 

Thanks

David

Link to comment
Share on other sites

I have a very similar problem. I am using a quantity discount module (order X number of products and get a % discount). However, the full amount gets passed to paypal on checkout. I cannot figure it out. The contrib is passing $order->info['total'] to paypal, which should have the discount applied, but it doesn't. Has anyone else gotten past this problem?

Thanks.

 

The way I eventually got this working was to change checkout_process.php. The before_process of the payment modules was being called before calling the order totals modules. I don't think this should cause any side effects, but if anyone else sees a problem with this, feel free to chime in.

 

In checkout_process.php, change:

// load the before_process function from the payment modules
 $payment_modules->before_process();

 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_totals = $order_total_modules->process();

to:

  require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_totals = $order_total_modules->process();

// load the before_process function from the payment modules
 $payment_modules->before_process();

 

Sean

 

In trying to use "Easy Coupon" & "Easy Discount" contributions with Paypal Website Payments Pro, the coupon discount shows during the checkout but doesn't get carried over to the Paypal total.

 

I tried the above solution but when I checkout using a credit card, I get an error:

 

"(10520) The transaction was refused because the amount totals of the order do not match. Review the amounts of the transaction and resubmit."

 

Any ideas on how to correct this?

 

If I take this code out and change to the "aggregate" method for Paypal, will this be corrected?

If so, how do I change to aggregate method?

 

Thanks for looking!

 

~Mark

Link to comment
Share on other sites

I just installed the payment mod, when I try and process a payment it gives an error, I really new to this so bare with me.

 

I done a screen print below.

 

Payment_error.PNG

 

If anyone can give me some advise that would be really cool.

 

Thanks

David

 

David,

Either you didn't install the two Pear module zip files (step 2 of the installation instructions), or you didn't set the "Pear Modules" directory in the module's settings page correctly, or both.

 

I have found that the live links for the Pear modules in the installation instructions don't work correctly any longer. (It appears that the osCommerce site now checks the referring page on download requests and redirects to the contribution page when the referrer isn't local.) Just go to the contribution page and download the second and third items from the bottom, labeled "Pear Modules - Part 1" and "Pear Modules - Part 2". Note that the fix described for the timeout issue has not been applied to /catalog/pear/Services/PayPal/SOAP/Transport/HTTP.php, as claimed in the instructions, so you will have to do that for yourself.

 

--Glen

Link to comment
Share on other sites

1.)Ok I actually have two things, but one thing at a time right! I had to take the edit codes in the files that were edited in certain files and place them in my own files, my site is so modified that i couldn't just overwrite them with the orginal documents. Anyways the firs thing is all im getting in my modules list is PayPal Direct Payment Now is that normal? Cause in the directions it says to enable the 6. Go into your Administration section -> Modules -> Payment and enable the "PayPal Direct Payment & Express Checkout" module. But that was not the case for me.

<br>

2.)I am getting this error in my create account.php page... Parse error: parse error, unexpected $ in /var/www/vhosts/tarojoenterprises.com/httpdocs/store/create_account.php on line 549 and here is my code sorry for taking up so much space, but at the end of the document i do not see $ this so i figured it had to be somewere else in the file.

 

<?php
/*
 $Id: create_account.php,v 1.65 2003/06/09 23:03:54 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

// needs to be included earlier to set the success message in the messageStack
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);

 $process = false;
 if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
$process = true;

if (ACCOUNT_GENDER == 'true') {
  if (isset($HTTP_POST_VARS['gender'])) {
	$gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
  } else {
	$gender = false;
  }
}
$firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
$street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
$postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
$city = tep_db_prepare_input($HTTP_POST_VARS['city']);
if (ACCOUNT_STATE == 'true') {
  $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
  if (isset($HTTP_POST_VARS['zone_id'])) {
	$zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
  } else {
	$zone_id = false;
  }
}
$country = tep_db_prepare_input($HTTP_POST_VARS['country']);
$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);
$fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);
if (isset($HTTP_POST_VARS['newsletter'])) {
  $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);
} else {
  $newsletter = false;
}
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
$confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

$error = false;

if (ACCOUNT_GENDER == 'true') {
  if ( ($gender != 'm') && ($gender != 'f') ) {
	$error = true;

	$messageStack->add('create_account', ENTRY_GENDER_ERROR);
  }
}

if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}

if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
}

if (ACCOUNT_DOB == 'true') {
  if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {
	$error = true;

	$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
  }
}

if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($email_address) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
//---PayPal WPP Modification START ---//	
  //$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . //tep_db_input($email_address) . "'");
  $check_email_query = tep_db_query("select customers_id as id, customers_paypal_ec as ec from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  if (tep_db_num_rows($check_email_query) > 0) {
	$check_email = tep_db_fetch_array($check_email_query);
	if ($check_email['ec'] == '1') {
	  //It's a temp account, so delete it and let the user create a new one
	  tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$check_email['id'] . "'");
	  tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . (int)$check_email['id'] . "'");
	} else {
	  $error = true;
	  $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
	}
//---PayPal WPP Modification END---//	
  $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  $check_email = tep_db_fetch_array($check_email_query);
  if ($check_email['total'] > 0) {
	$error = true;

	$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
  }
}

if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
}

if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
}

if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_CITY_ERROR);
}

if (is_numeric($country) == false) {
  $error = true;

  $messageStack->add('create_account', ENTRY_COUNTRY_ERROR);
}

if (ACCOUNT_STATE == 'true') {
  $zone_id = 0;
  $check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "'");
  $check = tep_db_fetch_array($check_query);
  $entry_state_has_zones = ($check['total'] > 0);
  if ($entry_state_has_zones == true) {
	$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
	if (tep_db_num_rows($zone_query) == 1) {
	  $zone = tep_db_fetch_array($zone_query);
	  $zone_id = $zone['zone_id'];
	} else {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR_SELECT);
	}
  } else {
	if (strlen($state) < ENTRY_STATE_MIN_LENGTH) {
	  $error = true;

	  $messageStack->add('create_account', ENTRY_STATE_ERROR);
	}
  }
}

if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
}


if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
  $error = true;

  $messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
} elseif ($password != $confirmation) {
  $error = true;

  $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
}

if ($error == false) {
  $sql_data_array = array('customers_firstname' => $firstname,
						  'customers_lastname' => $lastname,
						  'customers_email_address' => $email_address,
						  'customers_telephone' => $telephone,
						  'customers_fax' => $fax,
						  'customers_newsletter' => $newsletter,
						  'customers_password' => tep_encrypt_password($password));

  if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
  if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);

  tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);

  $customer_id = tep_db_insert_id();

  $sql_data_array = array('customers_id' => $customer_id,
						  'entry_firstname' => $firstname,
						  'entry_lastname' => $lastname,
						  'entry_street_address' => $street_address,
						  'entry_postcode' => $postcode,
						  'entry_city' => $city,
						  'entry_country_id' => $country);

  if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;
  if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
  if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;
  if (ACCOUNT_STATE == 'true') {
	if ($zone_id > 0) {
	  $sql_data_array['entry_zone_id'] = $zone_id;
	  $sql_data_array['entry_state'] = '';
	} else {
	  $sql_data_array['entry_zone_id'] = '0';
	  $sql_data_array['entry_state'] = $state;
	}
  }

  tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

  $address_id = tep_db_insert_id();

  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");

  tep_db_query("insert into " . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");

  if (SESSION_RECREATE == 'True') {
	tep_session_recreate();
  }

  $customer_first_name = $firstname;
  $customer_default_address_id = $address_id;
  $customer_country_id = $country;
  $customer_zone_id = $zone_id;
  tep_session_register('customer_id');
  tep_session_register('customer_first_name');
  tep_session_register('customer_default_address_id');
  tep_session_register('customer_country_id');
  tep_session_register('customer_zone_id');

// restore cart contents
  $cart->restore_contents();

// build the message content
  $name = $firstname . ' ' . $lastname;

  if (ACCOUNT_GENDER == 'true') {
	 if ($gender == 'm') {
	   $email_text = sprintf(EMAIL_GREET_MR, $lastname);
	 } else {
	   $email_text = sprintf(EMAIL_GREET_MS, $lastname);
	 }
  } else {
	$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  }

  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
  tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

  tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
}
 }

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php require('includes/form_check.js.php'); ?>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="0">
 <tr>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('create_account', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="smallText"><br><?php echo sprintf(TEXT_ORIGIN_LOGIN, tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL')); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 if ($messageStack->size('create_account') > 0) {
?>
  <tr>
	<td><?php echo $messageStack->output('create_account'); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
 }
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo CATEGORY_PERSONAL; ?></b></td>
	   <td class="inputRequirement" align="right"><?php echo FORM_REQUIRED_INFORMATION; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
<?php
 if (ACCOUNT_GENDER == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_GENDER; ?></td>
			<td class="main"><?php echo tep_draw_radio_field('gender', 'm') . '  ' . MALE . '  ' . tep_draw_radio_field('gender', 'f') . '  ' . FEMALE . ' ' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_FIRST_NAME; ?></td>
			<td class="main"><?php echo tep_draw_input_field('firstname') . ' ' . (tep_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_LAST_NAME; ?></td>
			<td class="main"><?php echo tep_draw_input_field('lastname') . ' ' . (tep_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="inputRequirement">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 if (ACCOUNT_DOB == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_DATE_OF_BIRTH; ?></td>
			<td class="main"><?php echo tep_draw_input_field('dob') . ' ' . (tep_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? '<span class="inputRequirement">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
			<td class="main"><?php echo tep_draw_input_field('email_address') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 if (ACCOUNT_COMPANY == 'true') {
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_COMPANY; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_COMPANY; ?></td>
			<td class="main"><?php echo tep_draw_input_field('company') . ' ' . (tep_not_null(ENTRY_COMPANY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 }
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_ADDRESS; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_STREET_ADDRESS; ?></td>
			<td class="main"><?php echo tep_draw_input_field('street_address') . ' ' . (tep_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 if (ACCOUNT_SUBURB == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_SUBURB; ?></td>
			<td class="main"><?php echo tep_draw_input_field('suburb') . ' ' . (tep_not_null(ENTRY_SUBURB_TEXT) ? '<span class="inputRequirement">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_POST_CODE; ?></td>
			<td class="main"><?php echo tep_draw_input_field('postcode') . ' ' . (tep_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="inputRequirement">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_CITY; ?></td>
			<td class="main"><?php echo tep_draw_input_field('city') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?></td>
		  </tr>
<?php
 if (ACCOUNT_STATE == 'true') {
?>
		  <tr>
			<td class="main"><?php echo ENTRY_STATE; ?></td>
			<td class="main">
<?php
if ($process == true) {
  if ($entry_state_has_zones == true) {
	$zones_array = array();
	$zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
	while ($zones_values = tep_db_fetch_array($zones_query)) {
	  $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
	}
	echo tep_draw_pull_down_menu('state', $zones_array);
  } else {
	echo tep_draw_input_field('state');
  }
} else {
  echo tep_draw_input_field('state');
}

if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
?>
			</td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td class="main"><?php echo ENTRY_COUNTRY; ?></td>
			<td class="main"><?php echo tep_get_country_list('country') . ' ' . (tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_CONTACT; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>
			<td class="main"><?php echo tep_draw_input_field('telephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
			<td class="main"><?php echo tep_draw_input_field('fax') . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_OPTIONS; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_NEWSLETTER; ?></td>
			<td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main"><b><?php echo CATEGORY_PASSWORD; ?></b></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" cellspacing="2" cellpadding="2">
		  <tr>
			<td class="main"><?php echo ENTRY_PASSWORD; ?></td>
			<td class="main"><?php echo tep_draw_password_field('password') . ' ' . (tep_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?></td>
		  </tr>
		  <tr>
			<td class="main"><?php echo ENTRY_PASSWORD_CONFIRMATION; ?></td>
			<td class="main"><?php echo tep_draw_password_field('confirmation') . ' ' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
</table></form></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

If you want to visit the page i am talking about please click the link, thanks for your help in advance!!!!

http://www.tarojoenterprises.com/store/create_account.php

Link to comment
Share on other sites

I just uploaded a new version of the module that no longer requires PEAR modules! It's beta, so don't install it unless you're willing to help test it and report any bugs you find in here.

 

http://www.oscommerce.com/community/contributions,3647

 

And if you're updating, note that there's a new directory to upload:

/catalog/includes/wpp_xml/

 

And feel free to delete your pear directory.

Edited by dynamoeffects

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

Oh, I forgot to say that if you don't make any changes to checkout_shipping/checkout_payment (which is just adding the box where the customer can cancel ExpressCheckout), all you need to upload is:

 

/includes/modules/payment/paypal_wpp.php

/includes/languages/english/modules/payment/paypal_wpp.php

/includes/wpp_xml/

 

Remember to uninstall the old module before doing this, though.

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

Hi, I have a quick question on changing the amount passed to Paypal.

 

Whenever I see $order->info['total'], I changed it to:

 

$order->info['total'] * 1.80

 

 

1.80 is a hard-coded number in order to pass to Paypal the correct amount when under a different currency.

 

The problem I am having is checkout_confirmation is showing USD 74.00 but my default currency is GBP 40.00. When I use Paypal WPP, the amount I got in my Paypal account is USD 40.00!! Therefore I hard-coded the above number to get the exact USD 74.00 as exactly shown to the customer on the checkout_confirmation.php page.

 

May I know if there is a way to automate the "* 1.80" part? I tried:

 

$order->info['total'] * $currencies->get_value('USD')

 

but it gave me an error saying "Call to a member function on a non-object".

 

I have very limited php knowledge so any guidance is much appreciated!

Link to comment
Share on other sites

Go into your Administration section -> Modules -> Payment and enable the "PayPal Direct Payment" module.

 

when trying the above step I receive this error in my Admin Section "Fatal error: Cannot redeclare class paypal_wpp in" the error is in "catalog/includes/modules/payment/paypal_wpp.php on line 10"

Link to comment
Share on other sites

Alright...

 

I know there are posts here about this error, but nothing discussed fixes my problem. I am hoping that someone out there has a new perspective on this. My error is:

 

Fatal error: Call to undefined function: setopt() in /home/u3/bgentryk/html/catalog/includes/modules/payment/paypal_wpp.php on line 324

 

every time I try to connect w/ paypal, whether it be express or direct.

 

HELP!!!!

Link to comment
Share on other sites

[/code]Ok i checked this forum and googled it, but it just saying to make sure your paths are set in my admin, wich they are!! But im getting these errors when i try to check out or trying to check out using express check out? Ne ideas? thanks

 

Warning: paypal_wpp::paypal_init() [function.paypal-init]: open_basedir restriction in effect. File(/Services/PayPal.php) is not within the allowed path(s): (/var/www/vhosts/tarojoenterprises.com/httpsdocs:/tmp) in /var/www/vhosts/tarojoenterprises.com/httpsdocs/store/includes/modules/payment/paypal_wpp.php on line 304

 

Warning: paypal_wpp::paypal_init(Services/PayPal.php) [function.paypal-init]: failed to open stream: Operation not permitted in /var/www/vhosts/tarojoenterprises.com/httpsdocs/store/includes/modules/payment/paypal_wpp.php on line 304

 

Fatal error: paypal_wpp::paypal_init() [function.require]: Failed opening required 'Services/PayPal.php' (include_path='.::/var/www/vhosts/tarojoenterprises.com/httpsdocs/store/pear/') in /var/www/vhosts/tarojoenterprises.com/httpsdocs/store/includes/modules/payment/paypal_wpp.php on line 304

 

Now here is my info,

untitled1.JPG

 

Now here is my code for my paypal_wpp.php Thanks for the help guys?

 

	//Initialize the connection with PayPal
function paypal_init() {
  global $customer_id, $customer_first_name;

  require_once ('Services/PayPal.php');
  require_once ('Services/PayPal/Profile/Handler/Array.php');
  require_once ('Services/PayPal/Profile/API.php');

  $handler =& ProfileHandler_Array::getInstance(array(
	'username' => MODULE_PAYMENT_PAYPAL_DP_API_USERNAME,
	'certificateFile' => MODULE_PAYMENT_PAYPAL_DP_CERT_PATH,  //This needs to be an absolute path i.e. /home/user/cert.txt
	'subject' => '',
	'environment' => MODULE_PAYMENT_PAYPAL_DP_SERVER));

  $profile = APIProfile::getInstance(MODULE_PAYMENT_PAYPAL_DP_API_USERNAME, $handler);
  $profile->setAPIPassword(MODULE_PAYMENT_PAYPAL_DP_API_PASSWORD);

  $caller =& Services_PayPal::getCallerServices($profile); //Create a caller object.  Ring ring, who's there?

  if (trim(MODULE_PAYMENT_PAYPAL_DP_PROXY) != '') {
	$caller->setOpt('curl', CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
	$caller->setOpt('curl', CURLOPT_PROXY, MODULE_PAYMENT_PAYPAL_DP_PROXY);
  }

  $caller->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0); 
  $caller->setOpt('curl', CURLOPT_TIMEOUT, 180);
  $caller->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0);

  if(Services_PayPal::isError($caller))  {
	if ($this->enableDebugging == '1') {
	  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'PayPal Error Dump', "In function: paypal_init()\r\n\r\n" . var_dump($caller), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
	}

	$this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_GEN_ERROR  . $caller->Errors->ShortMessage . '<br>' . $caller->Errors->LongMessage . ' (' . $caller->Errors->ErrorCode . ')', true);
  } else {
	return $caller;
  }
}

Link to comment
Share on other sites

Probably simplest to uninstall the module and install the new version that I just released that doesn't require pear modules.

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

sal2006: You have another file in your includes/modules/payment directory that uses the class name "paypal_wpp." Do you have pbreit's installed as well?

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Link to comment
Share on other sites

Okay...

 

I have everything working with this mod except...I don't get much order detail when using direct pay. All I get that is useful is shipping address and order total, but I really need to be getting more detail such as item number, description, and any options selected.

 

Does anyone have a fix for this? I thought that IPN was supposed to handle this, but it seems to be completely separate from direct payment.

Link to comment
Share on other sites

Hi guys,

ive installed the contribution, and after the confirmation i received the following error msg

 

PayPal WPP installation incomplete! There should be XML files located in /var/www/vhosts/jrinternationalinc.com/httpdocs/osCommerce3includes/!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...