Paypal Express Checkout Shipping Quote

Project:Ubercart Contributions
Component:Code
Category:
Priority:critical
Assigned:cosmo83@drupal.org
Status:patch (needs review)
Description
Project: 
Ubercart

Today, after updating to Alpha-7c i have got a Paypal Express Checkout Order, which seems to fail to calculate the shipping cost.

This is when i realised that the paypal module has not been updated to the latest panels code.
I assumed the guys will be busy for 7d release. Here is the patch that seems to be working for me. (Took lot of time, but all part of the learning)

The code needs review.

PreviewAttachmentSize
uc_paypal.diff2.25 KB
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Paypal Express Checkout Shipping Quote

Oof... this reminds me I need to update PayPal in other areas, too. Would you mind explaining your changes to the validate/submit functions? You seem to have done more than just update for the new pane system.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Paypal Express Checkout Shipping Quote

I also had to change this around line 780:

<?php
// Redirects if a customer selects PayPal Express Checkout as a payment method.
function uc_paypal_ec_checkout($form_id, $form_values) {
  if (
$form_values['panes']['payment']['pane']['payment_method'] != 'paypal_ec') {
    return;
  }
?>

Should remove the extra ['pane']:

<?php
// Redirects if a customer selects PayPal Express Checkout as a payment method.
function uc_paypal_ec_checkout($form_id, $form_values) {
  if (
$form_values['panes']['payment']['payment_method'] != 'paypal_ec') {
    return;
  }
?>

There are a few other changes, too... you can get them when you update to Alpha 7d.

cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Should that be ??
Assigned to:Ryan» cosmo83@drupal.org
<?php
// Redirects if a customer selects PayPal Express Checkout as a payment method.
function uc_paypal_ec_checkout($form_id, $form_values) {
  if (
$form_values['panes']['payment']['payment_method'] != 'paypal_ec') {
    return;
  }
?>
cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Re: Re: Paypal Express Checkout Shipping Quote

The thing was strange for me too..

The quote method also changed from the previous code. SO i had to figure out the things. Maybe Lyle could bring in more light whether i have done it right .

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Paypal Express Checkout Shipping Quote
Assigned to:cosmo83@drupal.org» Ryan

Honestly, it works fine for me so I'm just going to test a few more times and let it be. Eye-wink

cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Re: Re: Re: Re: Paypal Express Checkout Shipping Quote
Assigned to:Ryan» cosmo83@drupal.org

Do i need to make any changes to any of the other paypal code(i suppose not..) ??

I had few orders this morning and i think everything went smooth.

I didnt understand ur concenrn abt the pane??

cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Re: Re: Re: Re: Re: Paypal Express Checkout Shipping Quote

I see it now.. Laughing out loud

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: Paypal Express Checkout Shipping Quote
Assigned to:cosmo83@drupal.org» Lyle

Heh, I usually stop paying attention when I see "PayPal", so it took me a while to go look at your diff.

It looks like it should work. I should break this habit of just changing things without telling anybody. But I guess we're still in alpha for a little while longer.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Paypal Express Checkout Shipping Quote
Assigned to:Lyle» Ryan

Or just grep the Uber-source to see where your changes might apply... Eye-wink