Ubercart Payment on Account

Contrib type: 
Module
Status: 
Initial upload
Moderation: 
Awaiting moderation

Downloads

Compatibility: 
Ubercart 2.x

This module adds a new payment option called `Payment on Account` it is designed for admins who want to offer a tab or account to customers to be paid weekly, monthly, adhoc. Only users with a specific role can check out with this method and a password field is used to ensure it is the correct user purchasing the items on account. The module ads a new management interface for managing account orders and invoices.

Related threads: 

PreviewAttachmentSize
uc_account_payment_patched.tar41.5 KB
yanku's picture
Offline
Joined: 08/25/2009
Juice: 55
pa-complete not found

Hi, after submitting the order the page
cart/checkout/pa-complete
is not found. did I miss something during configuration?

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: pa-complete not found

Hi No additional configuration needed that URL is listed in the hook_menu, can I suggest clearing your cache just to be sure and try again.

yanku's picture
Offline
Joined: 08/25/2009
Juice: 55
thanks! Ok, I found the

thanks!
Ok, I found the issue.
I am running the site on a local host in a sub-folder like:

$base_url = 'http://localhost:8888/test'; (settings.php)
RewriteBase /test (.htaccess)

Somehow the module does not take account of that.

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: thanks! Ok, I found the

Hmmm, thats wierd, thanks will take a look and see why its not respecting base path

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
wont submit

Can you help me, When I submit the order using the account method, it returns to the review order page, which I then put in the password again, and go to the submit page, and again, on submission it returns to the review page.

http://www.testpresence.co.uk/
test user account
ben
ben

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: wont submit

I have added a patch to the module try the new download!

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
erm

I installed, ran update and cron and is still doing it?

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: erm

Cleared Caches?

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
just

Just tried that as well... still doing it... Do you have any further advice?

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: just

Try the new patched version... for some reason I am having trouble uploading the new version under the same filename. It looks like the previous update did not include the patch!

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
atill

Still doing it, seems to be going to cart/checkout/pa-complete
Is that right? Is there something I can Change myself somewhere?

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: atill

cart/checkout/pa-complete is correct! Did you copy the new uc_account_payment.module to your existing module directory and then clear caches?

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
yes

is there something I can check , which file are you upgrading, I will check the create/modified dates

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: yes

Check that Line 378 looks like this:
$form['#action'] = $base_path."cart/checkout/pa-complete";

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: yes

Check which file?

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: yes

uc_account_payment.module

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: yes

function uc_account_payment_form_alter(&$form, &$form_state, $form_id){
global $base_path;
if($form_id == "uc_cart_checkout_review_form"){
$order = uc_order_load(intval($_SESSION['cart_order']));
if($order->payment_method == "uc_account_payment"){
//Only redirect the payment form if we are using the Ubercart Payment on Account Method.
$form['#action'] = $base_path."cart/checkout/pa-complete";
}
}else if($form_id == "user_profile_form"){
if(user_access('payment on account')){
//check to see if we have an address already
$chk = db_result(db_query("SELECT COUNT(uid) AS exist FROM uc_account_payment_invoice_address WHERE uid = %d LIMIT 1;",check_plain(arg(1))));
if($chk != 0){
$sql = db_query("SELECT * FROM {uc_account_payment_invoice_address} WHERE uid = %d LIMIT 1;",check_plain(arg(1)));

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Ubercart Payment on Account

Is this a virtual created path or something, as I cant find a physical path like that on the server?

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: Re: Re: yes

Ok Try replacing the following line and see if that helps

$form['#action'] = $base_path."cart/checkout/pa-complete";

With

$form['#action'] = "/cart/checkout/pa-complete";

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Ubercart Payment on Account

The path is not physical its how Drupal resolves paths to functions what you are effectively seeing is index.php?q=cart/checkout/pa-complete

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Ubercart Payment on Account

Any more ideas ?, sorry still no joy, I pm'd you

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: Re: Ubercart Payment on Account

No sorry, that should work ok! even if the $base_path global variable doesn't work setting the path to /cart/checkout/pa-complete should do it, I can only assume that there is some caching issue or something stopping it from updating now.

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Ubercart Payment on Account

should anything be entered in the "Gateway" drop down? as I dont have anything in mine

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: Re: Re: Re: Ubercart Payment on Account

No, its nothing to do with that, I can see the form action for the review page is cart/checkout/pa-complete not /cart/checkout/pa-complete as it should be according to the changes you have made.

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Re: Re: Ubercart Payment on Account

When I click the confirm button, it is doing something wrong, I can see that where the review is going to cart/checkout the Confirm is going to cart/checkout/cart/checkout ???

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Payment on Account

Yes thats the problem you have, when you click to submit the review for you are going to cart/checkout/cart/checkout/pa-complete, hence the need for the leading slash before the action attribute on the form!

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Payment on Account

you are riht its something to do with the cache, I have cleared the cache, run a update, and a cron and rebooted the server and its still hlding the settings, I dont suppose you know which table stores this in phpmyadmin?

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Payment on Account

try cache or cache_form

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Payment on Acco

Its ok,, I've just broken the whole install, I just deleted a field instead of emptying it, I have tried to copy the field structure from another store database, but beyond my knowledge, looks like a clean install of drupal required

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Payment on Acco

Its ok,, I've just broken the whole install, I just deleted a field instead of emptying it, I have tried to copy the field structure from another store database, but beyond my knowledge, looks like a clean install of drupal required

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Payment on

Unlucky!

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Payment

Ok, fixed that, managed to export a table from another store and import it, still banging my head trying to work out why its caching this module

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Ubercart Pay

OK ...... Idiot if the Week award goes to me, When i copied your first update into the modules folder, I made a mistake by the looks of things and extracted the files into the module root without the uc_account_payment folder, so effectively the files were in there twice, as soon as I deleted those , the ones I had been changing in the uc_account_payment folder started working again.... All is well in the world... Thanks for your help.....

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Ubercart

At least you managed to get it working and hopefully learnt something Smiling

filemakers's picture
Offline
Joined: 11/04/2010
Juice: 36
Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Uber

yes, learnt how to export and import a table in PHPMYADMIN, and also that modules installed in the root, take presidence over modules in sub folders,....

andrews501's picture
Offline
Joined: 11/15/2010
Juice: 71
Adding money to account

Nice module.

I was wondering whether is possible to do the following with this module:

1.Authenticated user purchases a product that automatically gives him a "pay by account role" and adds the amount of the product purchased into the account. Let us say £300 for 30 units. And also creates an order for 5 units that are shipped and delivered.
2. Then next time the purchaser buys the same product, for example, 10 units, and selects "pay by account" as payment method then the account is reduced and the 10 units shipped and delivered.
3.Finally the purchaser buys the remaining 15 units that are shipped and delivered paying with "pay by account".

Or using the store credits module would be easy?

Many thanks.

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Adding money to account

Thanks for the suggestion! The module really is designed just to allow straight product purchases, what you are talking about is not really supported by this module. Not sure if the partial Payment module, which is currently under development would be what you are after.

talkitivewizard's picture
Offline
Joined: 12/31/2010
Juice: 7
Using account payment on manually created orders

Is it possible to use this module as a method of payment for manually created orders through admin/store/orders/create. Can you take a look at this screen capture and let me know if I'm doing something wrong. because View account order and View account Invoices are empty. I've even tried to not going through and completing the order with payment... and it still doesn't seem to work.
http://dl.dropbox.com/u/7177934/2011-01-20_2143.swf

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Re: Using account payment on manually created orders

Hi sorry on tested via the normal checkout process!

Marmite's picture
Offline
Joined: 01/25/2011
Juice: 12
Remove password restriction?

Is it possible to remove the requirement for a password? We would like to use this for a very specific role so the password requirement is a little redundant.

egrafa's picture
Offline
Joined: 02/16/2011
Juice: 46
Account Balance Reporting

Hi Luke- What kind of reporting does this module have for customers with receivables? Also, us there a way to generate a monthly statement for them? thanks

luketarplin's picture
Offline
Joined: 04/26/2010
Juice: 203
Hi Egrafa, This module lists

Hi Egrafa,

This module lists the orders, which have been paid for using the `Payment on Account` whether they are tangible or not (I assume that's what you mean by receivables). There isn't separation of orders between users only payment on account orders as a whole, so as far as reporting goes you may find it a little limited on that side of things.

Kind regards Luke

egrafa's picture
Offline
Joined: 02/16/2011
Juice: 46
Re: Hi Egrafa, This module lists

Ok, let me restate what you wrote just so I'm sure I understand it. The module lists the orders that were paid on account. Not per customer.

Does it let you sort those orders by month?

DanClarkePro's picture
Offline
Joined: 09/22/2010
Juice: 34
Conflict with uc_paypoint

Hello,

I wanted to use this module along side PayPoint (aka SecPay).

When a payment went through for PayPoint, it worked fine. As soon as I tried to put it through Payment On Account, it failed with a communication error. It seemed that the order had been passed to PayPoint..even though it was meant to use Payment On Account.

After a lot of searching in the module to discover what could be doing this, and contacting the developer for PayPoint, I noticed an odd section of code inside uc_account_payment_checkout()

The section was the foreach area, I commented out line 502 ($function = $module .'_order';) and since then both modules work along side each other perfectly.

I am not sure what this section of the code did, but removing that line (therefore annulling the if function below it) caused my problem to be fixed.

Hope this helps someone else.