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
Comment #2
tr commentedTest 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.
Comment #3
dsnopekHi,
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.
Comment #5
longwaveI 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.
Comment #6
tr commentedComment #7
longwaveThere 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.
Comment #8
longwaveCommitted #7.
Comment #9
dsnopekThanks, 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. :-)
Comment #10
longwave#7: 1129378-uc_paypal_wpp_payment_action.patch queued for re-testing.
Comment #12
longwaveComment #13
dsnopekI rerolled the patch for 6.x-2.x. Let's see if the testbot likes it!
Comment #14
dsnopekPrevious 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.
Comment #15
longwaveI 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.
Comment #16
dsnopekAwesome, thanks! It's great finally have this fixed after all this time. :-)