I feel like I'm missing something obvious -- how do I disable recurring payments in uc_payflowpro?

CommentFileSizeAuthor
#2 uc_payflowpro.module.patch1015 bytescjdavis

Comments

kwinters’s picture

Status: Active » Fixed

You can disable them globally in the gateway settings, or simply remove the recurring schedule from the product at admin/store/settings/uc_recurring/products.

cjdavis’s picture

Title: How to disable recurring transactions? » Remove recurring transactions tab on user accounts if recurring transactions are disabled
Component: Documentation » Code
Category: support » feature
Status: Fixed » Needs review
StatusFileSize
new1015 bytes

Sorry, that was a poorly stated question. I've never turned on the recurring payments feature, but there the recurring transactions tab is visible to the customer accounts at user/%/pfp_cpanel. Even worse, it displays an error to customer accounts:

user notice: Warning: You need to enable recurring products in the gateway settings to use this tool. in XX\sites\all\modules\uc_payflowpro\includes\uc_payflowpro_recurring.inc on line 733.

Looking at the code in uc_payflowpro.module, user/%/pfp_cpanel is added whether recurring transactions are enabled or not. Simply wrapping it in a 'if( variable_get('uc_payflowpro_enable_recurring', 0) ) {' check and flushing the menu cache appears to do what I need. Is this the correct approach?

I've attached a patch for this - my first actual patchfile - is the format correct?

kwinters’s picture

Title: Remove recurring transactions tab on user accounts if recurring transactions are disabled » Only show recurring user tab if recurring is enabled
Version: 6.x-1.x-dev » 6.x-1.1-beta4
Category: feature » bug
Status: Needs review » Fixed

Ah, that's completely different :) This is a good improvement.

I can't think of anything else major to change. Removing the menu callback entirely means we don't need to check in the tab's code, since it can't be executed. The cache has to be cleared manually after the setting is changed, but I don't think that's very avoidable or particularly important in practice.

As far as creating a patch goes, it's easiest for the maintainer if you have the CVS version checked out and diff against that, but for smaller patches like this it's easy enough for me to work around. Usually any patch is better than none, though.

Committed to both D5 and D6 branches, with some modifications to the D5 version. I'm not going to create a new beta until we have some more changes, though. You should be fine with your local mods for now, or you can check out the dev version from CVS (which would be good anyway if you're going to create any more patches).

Status: Fixed » Closed (fixed)

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