Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal WPP Direct Payments & Express Checkout Support


dynamoeffects

Recommended Posts

just bumping this to get some help. are there any additional logs or files that i can post for someone to take a look at? thanks in advance.

 

chris

 

I'm having trouble getting my WPP to process orders and I'm not really sure where to look first. Upon checkout, an email is sent to the customer, however no email is send to the store owner, nor is the card charged or funds disbursed to the paypal account.

 

the only error i am getting shows up in my server log:

 

/home/httpd/vhosts/mysite.com/httpdocs/product_info.php' not found or unable to stat

 

which may or may not be relevant to this problem, as my entire site is set up in my httpsdocs folder.

 

any help is appreciated.

 

chris

Link to comment
Share on other sites

This has not been fixed yet. That was only a suggestion for the new update.

 

Oh, I forgot that #2 was already covered by user mwillbrand. He sent me his fix for the shipping address issue, so that'll save me some time. Huzzah.

 

Oh. sorry. I thought this meant there was a fix for it.

Link to comment
Share on other sites

This is the support thread for the PayPal Direct Payments & Express Checkout module. Please post any bugs or errors you see while using it so that they can be fixed.

 

The contribution can be found here:

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

 

I've reinstalled this contribution and I'm not able to get it working I am having the follwoing problem:

. When I click on PayPal button to go to EC, I just get a blank page (ec_process.php). Same thing when I submit a CC order: I just get a blank page (checkout_process.php). A couple others have reported this, but I did not see any responses. Has anyone figured out what causes this? As stated by seanjean.

 

The curl proxy fix doesn't work for me because my ISP is does not require curl proxy. Any thought are appreciated.

Link to comment
Share on other sites

I've reinstalled this contribution and I'm not able to get it working I am having the follwoing problem:

. When I click on PayPal button to go to EC, I just get a blank page (ec_process.php). Same thing when I submit a CC order: I just get a blank page (checkout_process.php). A couple others have reported this, but I did not see any responses. Has anyone figured out what causes this? As stated by seanjean.

 

The curl proxy fix doesn't work for me because my ISP is does not require curl proxy. Any thought are appreciated.

 

lnap,

 

i had encountered this problem and it turned out that I had not installed PEAR correctly. check your webserver error log.

 

chris

Link to comment
Share on other sites

You can take it off, just remove the code for it.

 

 

Thanks! I was undsure if paypal policies would allow me to do that.

 

I might take it off, although people who are already logged in wont have the option of Paypal express.

i am thinking of moving the code entirely to the checkout_payment page. To make it more clear.

I hope it goes smoothly..

Edited by MechBun
Link to comment
Share on other sites

Oh. sorry. I thought this meant there was a fix for it.

 

It meant that a fix has been developed (by forum member mwillbrand) and submitted to Brian, but it hasn't made it into a release yet. Mwillbrand apparently has not posted the fix to this forum.

 

--Glen

Link to comment
Share on other sites

Thanks! I was undsure if paypal policies would allow me to do that.

 

I might take it off, although people who are already logged in wont have the option of Paypal express.

i am thinking of moving the code entirely to the checkout_payment page. To make it more clear.

I hope it goes smoothly..

 

There are two issues here; technical and policy. There is no technical limitation to putting the Express Checkout button most anywhere it makes sense in the checkout flow. PayPal's business rules, however, require you to present the button before collecting any information from the customer. To comply, you must leave the buttons where Brian put them.

 

Brian already put an option to present the Express Checkout button on the checkout_payment page; it's a checkbox on the module configuration page, and was introduced in version 0.3. I am using the PayPal IPN contribution to offer PayPal from checkout_payment; mainly because there was no option to pay by PayPal from checkout_payment when Brian released 0.1.

Link to comment
Share on other sites

Steve's right about compliancy, but the reason I put the EC button on the login page was so that if a customer wanted to checkout with EC without creating an account or logging in, they could press that button and go straight to the shipping page after doing their stuff on Paypal's site. It's kindof a purchase without account mod. The logic of keeping it on top of the shipping page is so that they still have the option of doing an express checkout if that's what thrill's 'em.

 

You can remove the buttons, but you need at least one to show up before the checkout process or else you are in violations of their TOS.

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.

can you please pm me this fix if it is at all possible . I can use it right away. THanks,

UBM

 

Hi, below is code to carry over the customer shipping address and email address to the paypal invoice. Insert into your catalog/includes/module/payment/paypal_wpp.php at appr line #820.

 

Matt

 

<?php
/* 

	Find in catalog/includes/modules/payment/paypal_wpp.php:

	// OrderTotal  
	$ot =& Services_PayPal::getType('BasicAmountType');
	$ot->setattr('currencyID', $wpp_currency);
	$ot->setval(number_format($order->info['total'], 2));

	and insert the following code immediately after:

*/

	// Begin ItemTotal -- WILLBRAND //
	$it =& Services_PayPal::getType('BasicAmountType');
	$it->setattr('currencyID', $wpp_currency);
	$it->setval(number_format($order->info['subtotal'], 2));
	// End ItemTotal -- WILLBRAND //

	// Begin ShippingTotal -- WILLBRAND //
	$st =& Services_PayPal::getType('BasicAmountType');
	$st->setattr('currencyID', $wpp_currency);
	$st->setval(number_format($order->info['shipping_cost'], 2));
	// End ShippingTotal -- WILLBRAND //

	// Begin ShippingAddress -- WILLBRAND //
	$sat =& Services_PayPal::getType('AddressType');
	$sat->setName($order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
	$sat->setStreet1($order->delivery['street_address']);
	$sat->setStreet2($order->delivery['suburb']);
	$sat->setCityName($order->delivery['city']);
	$sat->setPostalCode($order->delivery['postcode']);

	//Paypal only accepts two character state codes
	if (strlen($order->delivery['state']) > 2) {
	  $state_query = tep_db_query("SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_name = '".$order->delivery['state']."'");
	  if (tep_db_num_rows($state_query) > 0) {
		$state = tep_db_fetch_array($state_query);
		$order->delivery['state'] = $state['zone_code'];
	  } else {
		$this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR);
	  }
	}

	$sat->setStateOrProvince($order->delivery['state']);
	$sat->setCountry($order->delivery['country']['iso_code_2']);
	// End ShippingAddress -- WILLBRAND //

	// Begin PaymentDetailsItem -- WILLBRAND //
	/* This isn't carry over item information. I need to look into this further. -- WILLBRAND */
	$pdit =& Services_PayPal::getType('PaymentDetailsItemType');
	$pdit->setName($order->products['name']);

	$finalprice =& Services_PayPal::getType('BasicAmountType');
	$finalprice->setattr('currencyID', $wpp_currency);
	$finalprice->setval(number_format($order->products['final_price'], 2));

	$pdit->setAmount($finalprice);
	$pdit->setNumber($order->products['id']);
	$pdit->setQuantity($order->products['qty']);
	// End PaymentDetailsItem -- WILLBRAND //

	$pdt =& Services_PayPal::getType('PaymentDetailsType');
	$pdt->setOrderTotal($ot);

	//-- Begin PaymentDetailType MATT WILLBRAND --//
	$pdt->setItemTotal($it);
	$pdt->setShippingTotal($st);
	$pdt->setShipToAddress($sat);
	$pdt->setPaymentDetailsItem($pdit);
	//-- End PaymentDetailType MATT WILLBRAND --//

	$at =& Services_PayPal::getType('AddressType');
	$at->setStreet1($order->billing['street_address']);
	$at->setStreet2($order->billing['suburb']);
	$at->setCityName($order->billing['city']);
	$at->setStateOrProvince($order->billing['state']);
	$at->setCountry($order->billing['country']['iso_code_2']);
	$at->setPostalCode($order->billing['postcode']);

	$pnt =& Services_PayPal::getType('PersonNameType');
	$pnt->setFirstName($cc_first_name);
	$pnt->setLastName($cc_last_name);

	$pit =& Services_PayPal::getType('PayerInfoType');
	// Send email address of payee -- WILLBRAND //
	$pit->setPayer($order->customer['email_address']);
	///////////////////-- END WILLBRAND CONTRIBUTION --/////////////////////////
?>

Link to comment
Share on other sites

International Orders and PayPal WPP Direct Payments & Express Checkout - Can a customer from outside the U.S use their credit card for this module? I read a while back about a 2 letter State requirement...is this still the case? Thanks.

Link to comment
Share on other sites

International Orders and PayPal WPP Direct Payments & Express Checkout - Can a customer from outside the U.S use their credit card for this module? I read a while back about a 2 letter State requirement...is this still the case? Thanks.

Yes. Web Site Payment Pro is still limitted to US. You can see that in PayPal web site HERE.

Take care

Regards,

Link to comment
Share on other sites

Hi, below is code to carry over the customer shipping address and email address to the paypal invoice. Insert into your catalog/includes/module/payment/paypal_wpp.php at appr line #820.

 

Matt

 

<?php
/* 

	Find in catalog/includes/modules/payment/paypal_wpp.php:

	// OrderTotal  
	$ot =& Services_PayPal::getType('BasicAmountType');
	$ot->setattr('currencyID', $wpp_currency);
	$ot->setval(number_format($order->info['total'], 2));

	and insert the following code immediately after:

*/

	// Begin ItemTotal -- WILLBRAND //
	$it =& Services_PayPal::getType('BasicAmountType');
	$it->setattr('currencyID', $wpp_currency);
	$it->setval(number_format($order->info['subtotal'], 2));
	// End ItemTotal -- WILLBRAND //

	// Begin ShippingTotal -- WILLBRAND //
	$st =& Services_PayPal::getType('BasicAmountType');
	$st->setattr('currencyID', $wpp_currency);
	$st->setval(number_format($order->info['shipping_cost'], 2));
	// End ShippingTotal -- WILLBRAND //

	// Begin ShippingAddress -- WILLBRAND //
	$sat =& Services_PayPal::getType('AddressType');
	$sat->setName($order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
	$sat->setStreet1($order->delivery['street_address']);
	$sat->setStreet2($order->delivery['suburb']);
	$sat->setCityName($order->delivery['city']);
	$sat->setPostalCode($order->delivery['postcode']);

	//Paypal only accepts two character state codes
	if (strlen($order->delivery['state']) > 2) {
	  $state_query = tep_db_query("SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_name = '".$order->delivery['state']."'");
	  if (tep_db_num_rows($state_query) > 0) {
		$state = tep_db_fetch_array($state_query);
		$order->delivery['state'] = $state['zone_code'];
	  } else {
		$this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR);
	  }
	}

	$sat->setStateOrProvince($order->delivery['state']);
	$sat->setCountry($order->delivery['country']['iso_code_2']);
	// End ShippingAddress -- WILLBRAND //

	// Begin PaymentDetailsItem -- WILLBRAND //
	/* This isn't carry over item information. I need to look into this further. -- WILLBRAND */
	$pdit =& Services_PayPal::getType('PaymentDetailsItemType');
	$pdit->setName($order->products['name']);

	$finalprice =& Services_PayPal::getType('BasicAmountType');
	$finalprice->setattr('currencyID', $wpp_currency);
	$finalprice->setval(number_format($order->products['final_price'], 2));

	$pdit->setAmount($finalprice);
	$pdit->setNumber($order->products['id']);
	$pdit->setQuantity($order->products['qty']);
	// End PaymentDetailsItem -- WILLBRAND //

	$pdt =& Services_PayPal::getType('PaymentDetailsType');
	$pdt->setOrderTotal($ot);

	//-- Begin PaymentDetailType MATT WILLBRAND --//
	$pdt->setItemTotal($it);
	$pdt->setShippingTotal($st);
	$pdt->setShipToAddress($sat);
	$pdt->setPaymentDetailsItem($pdit);
	//-- End PaymentDetailType MATT WILLBRAND --//

	$at =& Services_PayPal::getType('AddressType');
	$at->setStreet1($order->billing['street_address']);
	$at->setStreet2($order->billing['suburb']);
	$at->setCityName($order->billing['city']);
	$at->setStateOrProvince($order->billing['state']);
	$at->setCountry($order->billing['country']['iso_code_2']);
	$at->setPostalCode($order->billing['postcode']);

	$pnt =& Services_PayPal::getType('PersonNameType');
	$pnt->setFirstName($cc_first_name);
	$pnt->setLastName($cc_last_name);

	$pit =& Services_PayPal::getType('PayerInfoType');
	// Send email address of payee -- WILLBRAND //
	$pit->setPayer($order->customer['email_address']);
	///////////////////-- END WILLBRAND CONTRIBUTION --/////////////////////////
?>

 

I tried this and there is no change.

 

My code looks like this:

 

 

	   //If they're still here, and awake, set some of the order object's variables
	$order->info['cc_type'] = $cc_type;
	$order->info['cc_number'] = substr($cc_number, 0, 4) . str_repeat('X', (strlen($cc_number) - 8)) . substr($cc_number, -4);
	$order->info['cc_owner'] = $cc_first_name . ' ' . $cc_last_name;
	$order->info['cc_expires'] = $cc_expdate_month . substr($cc_expdate_year, -2);

	//It's time to start a'chargin.  Initialize the paypal caller object
	$caller = $this->paypal_init();

	$ot =& Services_PayPal::getType('BasicAmountType');
	$ot->setattr('currencyID', $wpp_currency);
	$ot->setval(number_format($order->info['total'], 2));
 // Begin ItemTotal -- WILLBRAND //
$it =& Services_PayPal::getType('BasicAmountType');
$it->setattr('currencyID', $wpp_currency);
$it->setval(number_format($order->info['subtotal'], 2));
// End ItemTotal -- WILLBRAND //

// Begin ShippingTotal -- WILLBRAND //
$st =& Services_PayPal::getType('BasicAmountType');
$st->setattr('currencyID', $wpp_currency);
$st->setval(number_format($order->info['shipping_cost'], 2));
// End ShippingTotal -- WILLBRAND //

// Begin ShippingAddress -- WILLBRAND //
$sat =& Services_PayPal::getType('AddressType');
$sat->setName($order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
$sat->setStreet1($order->delivery['street_address']);
$sat->setStreet2($order->delivery['suburb']);
$sat->setCityName($order->delivery['city']);
$sat->setPostalCode($order->delivery['postcode']);

//Paypal only accepts two character state codes
if (strlen($order->delivery['state']) > 2) {
$state_query = tep_db_query("SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_name = '".$order->delivery['state']."'");
if (tep_db_num_rows($state_query) > 0) {
$state = tep_db_fetch_array($state_query);
$order->delivery['state'] = $state['zone_code'];
} else {
$this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR);
}
}

$sat->setStateOrProvince($order->delivery['state']);
$sat->setCountry($order->delivery['country']['iso_code_2']);
// End ShippingAddress -- WILLBRAND //

// Begin PaymentDetailsItem -- WILLBRAND //
/* This isn't carry over item information. I need to look into this further. -- WILLBRAND */
$pdit =& Services_PayPal::getType('PaymentDetailsItemType');
$pdit->setName($order->products['name']);

$finalprice =& Services_PayPal::getType('BasicAmountType');
$finalprice->setattr('currencyID', $wpp_currency);
$finalprice->setval(number_format($order->products['final_price'], 2));

$pdit->setAmount($finalprice);
$pdit->setNumber($order->products['id']);
$pdit->setQuantity($order->products['qty']);
// End PaymentDetailsItem -- WILLBRAND //

$pdt =& Services_PayPal::getType('PaymentDetailsType');
$pdt->setOrderTotal($ot);

//-- Begin PaymentDetailType MATT WILLBRAND --//
$pdt->setItemTotal($it);
$pdt->setShippingTotal($st);
$pdt->setShipToAddress($sat);
$pdt->setPaymentDetailsItem($pdit);
//-- End PaymentDetailType MATT WILLBRAND --//

$at =& Services_PayPal::getType('AddressType');
$at->setStreet1($order->billing['street_address']);
$at->setStreet2($order->billing['suburb']);
$at->setCityName($order->billing['city']);
$at->setStateOrProvince($order->billing['state']);
$at->setCountry($order->billing['country']['iso_code_2']);
$at->setPostalCode($order->billing['postcode']);

Link to comment
Share on other sites

Hi.

can you please pm me this fix if it is at all possible . I can use it right away. THanks,

UBM

 

I posted a workaround for this a little while ago- my way isn't pretty but IME it works. It should be within the last few pages.

 

Basically the payment page is loaded by the server briefly but never shown to the customer.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Ok, the day has come. I'll be spending a couple of days fixing the remaining bugs and adding a few requested features.

 

TODO:

1. Add a workaround so that when Paypal sends back a blank response, it'll requery the server and check on the status of payment. (Not even sure if this is possible yet. I'll need to check the docs)

 

2. Find out why the shipping address gets erased and have it display on the payment page.

 

3. Fix the dubug coding (whoops).

 

4. Support alternate shipping addresses (Stew's gift address thingy)

 

5. Update the readme with an FAQ section (BIG maybe)

 

If there's anything I'm forgetting, let me know.

 

4- THANK YOU!!!

 

6- Slimming down the checkout process. There is interest, Brian, I would imagine a lot of it. For me specifically the big push for the first few months of the year will be installing Address Book Enhancer and combining the shipping and payment pages.

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Is it possible to take payment in administration with "Order Editor" or something?

 

This is what I need to do to ensure customer's don't give up on order when submitting payment information:

 

1. Customer submits payment information they think is right and order is submitted.

 

2. When we get ready to ship, we charge the customer's card, in the back office (administration).

 

3. Information is correct = Sweet: send order Else Call customer for correct information.

 

We prefer doing it this way as many of our customers are not very computer savvy and we are quite sure that they are dropping the order if placed at unusual times of day when they are unable to reach us by phone to get help.

 

Also, this solves the problem of phone orders, whereby I would then have to go into paypal and use the "Virtual Terminal" feature. I don't want employees accessing paypal. So a payment button appearing on the "Order" would take payment based on information submitted. If it doesn't go through, we contact customer, get the right information and process payment.

 

What do you think? WPP was working already, but we removed it when we noticed a drop in number of customers completing orders.

 

Rob

Link to comment
Share on other sites

I tried this and there is no change.

 

My code looks like this:

 Code has been removed to conserve space.

 

 

My apologies. I gave incorrect installation information.

 

Step 1. Find the following:

		$ot =& Services_PayPal::getType('BasicAmountType');
	$ot->setattr('currencyID', $wpp_currency);
	$ot->setval(number_format($order->info['total'], 2));

then insert immediately after:

		// Begin ItemTotal -- WILLBRAND //
	$it =& Services_PayPal::getType('BasicAmountType');
	$it->setattr('currencyID', $wpp_currency);
	$it->setval(number_format($order->info['subtotal'], 2));
	// End ItemTotal -- WILLBRAND //

	// Begin ShippingTotal -- WILLBRAND //
	$st =& Services_PayPal::getType('BasicAmountType');
	$st->setattr('currencyID', $wpp_currency);
	$st->setval(number_format($order->info['shipping_cost'], 2));
	// End ShippingTotal -- WILLBRAND //

	// Begin ShippingAddress -- WILLBRAND //
	$sat =& Services_PayPal::getType('AddressType');
	$sat->setName($order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
	$sat->setStreet1($order->delivery['street_address']);
	$sat->setStreet2($order->delivery['suburb']);
	$sat->setCityName($order->delivery['city']);
	$sat->setPostalCode($order->delivery['postcode']);

	//Paypal only accepts two character state codes
	if (strlen($order->delivery['state']) > 2) {
	  $state_query = tep_db_query("SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_name = '".$order->delivery['state']."'");
	  if (tep_db_num_rows($state_query) > 0) {
		$state = tep_db_fetch_array($state_query);
		$order->delivery['state'] = $state['zone_code'];
	  } else {
		$this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR);
	  }
	}

	$sat->setStateOrProvince($order->delivery['state']);
	$sat->setCountry($order->delivery['country']['iso_code_2']);
	// End ShippingAddress -- WILLBRAND //

	// Begin PaymentDetailsItem -- WILLBRAND //
	$pdit =& Services_PayPal::getType('PaymentDetailsItemType');
	$pdit->setName($order->products['name']);

	$finalprice =& Services_PayPal::getType('BasicAmountType');
	$finalprice->setattr('currencyID', $wpp_currency);
	$finalprice->setval(number_format($order->products['final_price'], 2));

	$pdit->setAmount($finalprice);
	$pdit->setNumber($order->products['id']);
	$pdit->setQuantity($order->products['qty']);
	// End PaymentDetailsItem -- WILLBRAND //

Step 2. Find:

		$pdt =& Services_PayPal::getType('PaymentDetailsType');
	$pdt->setOrderTotal($ot);

And insert the following immediately after:

		//-- Begin PaymentDetailType MATT WILLBRAND --//
	$pdt->setItemTotal($it);
	$pdt->setShippingTotal($st);
	$pdt->setShipToAddress($sat);
	$pdt->setPaymentDetailsItem($pdit);
	//-- End PaymentDetailType MATT WILLBRAND --//

 

Optional: If you would like to send the email address to paypal then find:

		$pit =& Services_PayPal::getType('PayerInfoType');
	$pit->setPayerName($pnt);
	$pit->setAddress($at);

and insert the following immediately after:

		$pit->setPayer($order->customer['email_address']);

 

Hopefully the above instructions will fix any troubles you were having with this code.

 

Matt

Link to comment
Share on other sites

My apologies. I gave incorrect installation information.

 

Step 1. Find the following:

		$ot =& Services_PayPal::getType('BasicAmountType');
	$ot->setattr('currencyID', $wpp_currency);
	$ot->setval(number_format($order->info['total'], 2));

then insert immediately after:

		// Begin ItemTotal -- WILLBRAND //
	$it =& Services_PayPal::getType('BasicAmountType');
	$it->setattr('currencyID', $wpp_currency);
	$it->setval(number_format($order->info['subtotal'], 2));
	// End ItemTotal -- WILLBRAND //

	// Begin ShippingTotal -- WILLBRAND //
	$st =& Services_PayPal::getType('BasicAmountType');
	$st->setattr('currencyID', $wpp_currency);
	$st->setval(number_format($order->info['shipping_cost'], 2));
	// End ShippingTotal -- WILLBRAND //

	// Begin ShippingAddress -- WILLBRAND //
	$sat =& Services_PayPal::getType('AddressType');
	$sat->setName($order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
	$sat->setStreet1($order->delivery['street_address']);
	$sat->setStreet2($order->delivery['suburb']);
	$sat->setCityName($order->delivery['city']);
	$sat->setPostalCode($order->delivery['postcode']);

	//Paypal only accepts two character state codes
	if (strlen($order->delivery['state']) > 2) {
	  $state_query = tep_db_query("SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_name = '".$order->delivery['state']."'");
	  if (tep_db_num_rows($state_query) > 0) {
		$state = tep_db_fetch_array($state_query);
		$order->delivery['state'] = $state['zone_code'];
	  } else {
		$this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR);
	  }
	}

	$sat->setStateOrProvince($order->delivery['state']);
	$sat->setCountry($order->delivery['country']['iso_code_2']);
	// End ShippingAddress -- WILLBRAND //

	// Begin PaymentDetailsItem -- WILLBRAND //
	$pdit =& Services_PayPal::getType('PaymentDetailsItemType');
	$pdit->setName($order->products['name']);

	$finalprice =& Services_PayPal::getType('BasicAmountType');
	$finalprice->setattr('currencyID', $wpp_currency);
	$finalprice->setval(number_format($order->products['final_price'], 2));

	$pdit->setAmount($finalprice);
	$pdit->setNumber($order->products['id']);
	$pdit->setQuantity($order->products['qty']);
	// End PaymentDetailsItem -- WILLBRAND //

Step 2. Find:

		$pdt =& Services_PayPal::getType('PaymentDetailsType');
	$pdt->setOrderTotal($ot);

And insert the following immediately after:

		//-- Begin PaymentDetailType MATT WILLBRAND --//
	$pdt->setItemTotal($it);
	$pdt->setShippingTotal($st);
	$pdt->setShipToAddress($sat);
	$pdt->setPaymentDetailsItem($pdit);
	//-- End PaymentDetailType MATT WILLBRAND --//

 

Optional: If you would like to send the email address to paypal then find:

		$pit =& Services_PayPal::getType('PayerInfoType');
	$pit->setPayerName($pnt);
	$pit->setAddress($at);

and insert the following immediately after:

		$pit->setPayer($order->customer['email_address']);

 

Hopefully the above instructions will fix any troubles you were having with this code.

 

Matt

 

This didn't work either. In the payment page, I now get a shopping cart which has the item and order total as $0 and the item total and shipping total are both set to $0. But the email and the shipping address are now transferred. by the way, I checked the payment page from the previous fix and the shipping total didnt transfer in that one either.

Edited by Urbluffingme
Link to comment
Share on other sites

This didn't work either. In the payment page, I now get a shopping cart which has the item and order total as $0 and the item total and shipping total are both set to $0. But the email and the shipping address are now transferred. by the way, I checked the payment page from the previous fix and the shipping total didnt transfer in that one either.

 

Nevermind. I got I got it working. I must have screwed something up this time. It works perfectly. Thanks alot!!!

Link to comment
Share on other sites

Searching the thread, the only mention I see of problems with downloads is with pbreit's. I'll test it out on my dev server, 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

My apologies. I gave incorrect installation information.

 

Step 1. Find the following:

		$ot =& Services_PayPal::getType('BasicAmountType');
	$ot->setattr('currencyID', $wpp_currency);
	$ot->setval(number_format($order->info['total'], 2));

then insert immediately after:

		// Begin ItemTotal -- WILLBRAND //
	$it =& Services_PayPal::getType('BasicAmountType');
	$it->setattr('currencyID', $wpp_currency);
	$it->setval(number_format($order->info['subtotal'], 2));
	// End ItemTotal -- WILLBRAND //

	// Begin ShippingTotal -- WILLBRAND //
	$st =& Services_PayPal::getType('BasicAmountType');
	$st->setattr('currencyID', $wpp_currency);
	$st->setval(number_format($order->info['shipping_cost'], 2));
	// End ShippingTotal -- WILLBRAND //

	// Begin ShippingAddress -- WILLBRAND //
	$sat =& Services_PayPal::getType('AddressType');
	$sat->setName($order->delivery['firstname'] . ' ' . $order->delivery['lastname']);
	$sat->setStreet1($order->delivery['street_address']);
	$sat->setStreet2($order->delivery['suburb']);
	$sat->setCityName($order->delivery['city']);
	$sat->setPostalCode($order->delivery['postcode']);

	//Paypal only accepts two character state codes
	if (strlen($order->delivery['state']) > 2) {
	  $state_query = tep_db_query("SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_name = '".$order->delivery['state']."'");
	  if (tep_db_num_rows($state_query) > 0) {
		$state = tep_db_fetch_array($state_query);
		$order->delivery['state'] = $state['zone_code'];
	  } else {
		$this->away_with_you(MODULE_PAYMENT_PAYPAL_DP_TEXT_STATE_ERROR);
	  }
	}

	$sat->setStateOrProvince($order->delivery['state']);
	$sat->setCountry($order->delivery['country']['iso_code_2']);
	// End ShippingAddress -- WILLBRAND //

	// Begin PaymentDetailsItem -- WILLBRAND //
	$pdit =& Services_PayPal::getType('PaymentDetailsItemType');
	$pdit->setName($order->products['name']);

	$finalprice =& Services_PayPal::getType('BasicAmountType');
	$finalprice->setattr('currencyID', $wpp_currency);
	$finalprice->setval(number_format($order->products['final_price'], 2));

	$pdit->setAmount($finalprice);
	$pdit->setNumber($order->products['id']);
	$pdit->setQuantity($order->products['qty']);
	// End PaymentDetailsItem -- WILLBRAND //

Step 2. Find:

		$pdt =& Services_PayPal::getType('PaymentDetailsType');
	$pdt->setOrderTotal($ot);

And insert the following immediately after:

		//-- Begin PaymentDetailType MATT WILLBRAND --//
	$pdt->setItemTotal($it);
	$pdt->setShippingTotal($st);
	$pdt->setShipToAddress($sat);
	$pdt->setPaymentDetailsItem($pdit);
	//-- End PaymentDetailType MATT WILLBRAND --//

 

Optional: If you would like to send the email address to paypal then find:

		$pit =& Services_PayPal::getType('PayerInfoType');
	$pit->setPayerName($pnt);
	$pit->setAddress($at);

and insert the following immediately after:

		$pit->setPayer($order->customer['email_address']);

 

Hopefully the above instructions will fix any troubles you were having with this code.

 

Matt

Hi Matt,

I have changed my codes exactly as above, but I'm getting the following error:

 

Your credit card was declined. Please try another card or contact your bank for more info.

Transaction amounts do not match.

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

 

After I have removed the above change, it started to work again (without sending the address and other information to PayPal).

Do you have any idea why I'm getting this error and how to fix this?

Thanks

Regards,

Link to comment
Share on other sites

Hi

 

I would be very grateful for advice/guidance on the following

  • This is the first time I have posted to a large thread/designated support thread. Am I posting in an approved manner ? ie just tacking on my question on to the end of the thread?
  • Question can I install this contribution onto a local machine for testing in my envioronment before installing on a production site? The local machine does not have SSL etc. If not what is the best way to learn about the contribution and how it works?
  • I have installed contribution Administration Access Level Accounts 2.0. Will this cause problems with the installation of this contribution?
  • In an effort to get self help I located this thread and tried to do a local search using the topic button and google. No luck with the topic search but google appeared to indicate that questions had been asked about this subject. When I requested the specific item the message board kicked in and reurned and error. How can I search a large thread succesfully?
     
     
    Thank you
     
    Nossum

Link to comment
Share on other sites

This is the first time I have posted to a large thread/designated support thread. Am I posting in an approved manner ? ie just tacking on my question on to the end of the thread?

Yes, it's fine.

 

Question can I install this contribution onto a local machine for testing in my envioronment before installing on a production site? The local machine does not have SSL etc. If not what is the best way to learn about the contribution and how it works?

No, Paypal won't respond to a non https:// url. You can make your own SSL certificate and use that. Paypal only cares that the traffic is encrypted, not that if the certificate is valid.

 

I have installed contribution Administration Access Level Accounts 2.0. Will this cause problems with the installation of this contribution?

I doubt it.

 

In an effort to get self help I located this thread and tried to do a local search using the topic button and google. No luck with the topic search but google appeared to indicate that questions had been asked about this subject. When I requested the specific item the message board kicked in and reurned and error. How can I search a large thread succesfully?

Just type your keywords into the search box at the bottom of the page. If you get no results, it probably wasn't asked.

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

Yes, it's fine.

No, Paypal won't respond to a non https:// url. You can make your own SSL certificate and use that. Paypal only cares that the traffic is encrypted, not that if the certificate is valid.

I doubt it.

Just type your keywords into the search box at the bottom of the page. If you get no results, it probably wasn't asked.

 

 

Thank you Brian - do you have any sources where I can start to learn about creating a certificate?

 

Regards

 

Nossum

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...