Hello,

The Paypal Express Checkout code should be heeding the settings for Website Payments Pro. However, its still using the variable uc_paypal_wpp_payment_action, even though it was renamed to uc_pg_paypal_wpp_cc_txn_type a long time ago.

This essentially makes the payment action for Express Checkout unsettable via the UI. You can, of course, set the variable directly in the database.

Attached is patch to change Express Checkout to use the new variable.

NOTE: I use the string literals rather than the constants, because using the constants would force a dependency on uc_credit. However, this is undesirable because Express Checkout doesn't need uc_credit to function.

Regards,
David.

Comments

Status: Needs review » Needs work

The last submitted patch, uc_paypal_wpp_payment_action.patch, failed testing.

tr’s picture

StatusFileSize
new2.04 KB

Test bot doesn't work properly with a fixed release like 6.x-2.4, so ignore the patch does not apply message.

Try this patch: I've modified your patch to use the defined constants UC_CREDIT_AUTH_ONLY and UC_CREDIT_AUTH_CAPTURE instead of the strings 'authorize' and 'auth_capture'. I'm unsure if the constants will be defined in the express checkout context, and I don't have an EC account so I can't test it myself. If they're not defined, then I'd like to fix that rather than revert to using the strings.

dsnopek’s picture

Status: Needs work » Reviewed & tested by the community

Hi,

Sorry for taking so long to get back to you! I couldn't disable uc_credit on the project I was working on, so I had to setup a new test site where I could test EC without it enabled.

Surprisingly to me, your patch seems to work fine! I have no idea how that is possible, because its using those constants (UC_CREDIT_AUTH_ONLY and UC_CREDIT_AUTH_CAPTURE) which are defined in uc_credit.module which is disabled. It might be the uc_paypal_payment_method() function which manually loads uc_credit.module? But I'm not sure when that hook is called.

Anyway, works for me!

Regards,
David.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1129378.patch, failed testing.

longwave’s picture

I think it appears to work even though uc_credit.module is not included because those constants will be cast to plain strings (and a notice will be thrown, but this is usually hidden in D6). But this means that the variable value will change unexpectedly if uc_credit is enabled later, so this still needs work.

Perhaps the easiest solution is to move the uc_credit constants into uc_payment - this was considered in a previous fix to PayPal WPP in D7, but a different workaround was implemented in the end.

tr’s picture

Version: 6.x-2.4 » 7.x-3.x-dev
longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new3 KB

There is no simple solution, as we don't require uc_credit, yet moving the constants feels wrong. Further, there is no way of setting the uc_pg_paypal_wpp_cc_txn_type option if uc_credit is not enabled.

This patch is the same as #0 with the addition of a new option that appears in the Express Checkout settings page, including a comment documenting where the constants are derived from.

longwave’s picture

Status: Needs review » Fixed

Committed #7.

dsnopek’s picture

Version: 7.x-3.x-dev » 6.x-2.x-dev
Status: Fixed » Reviewed & tested by the community

Thanks, that's great! Could you commit this also to the Drupal 6 version? On first look, it appears as though the same patch will work! The patch that I originally posted with this issue was for the D6 version afterall. :-)

longwave’s picture

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1129378-uc_paypal_wpp_payment_action.patch, failed testing.

longwave’s picture

Status: Needs work » Patch (to be ported)
dsnopek’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new2.89 KB

I rerolled the patch for 6.x-2.x. Let's see if the testbot likes it!

dsnopek’s picture

Status: Needs review » Reviewed & tested by the community

Previous patch was RTBC and this one is only a re-roll of that, so I'm marking it also as RTBC because the test bot likes it.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

I committed the original patch to 6.x-2.x and gave you author credit. We don't need the additional radio button here, because in 6.x-2.x you configure all other Express Checkout settings from the PayPal WPP page anyway.

dsnopek’s picture

Awesome, thanks! It's great finally have this fixed after all this time. :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.