I have a few sites running Drupal/Ubercart with Quickpay.
A client have asked me how to capture a smaller amount than the amount the customer have accepted at the time of ordering the items. He wish to do this because it happens a product is sold out and he will not be able to deliver it.
It is possible to do this through the Quickpay manager but I think I remember it also was possible through Ubercart but I have tested and I have not been able to get the system to capture less.

What I have done is to test with the two amounts at the top.
First you have the total (I use Danish so not sure what the name is in English) (Ordre i alt).
I can easy change the next amount (Nuværende saldo) by adding an amount further down and click send.
But when I capture it is the total amount that is being captured.

I hope someone can advise me.

Comments

xen’s picture

Looks like a bug. Try this:

In uc_quickpay/uc_quickpay.module, change line 119-125:

    if ($form_state['clicked_button']['#action'] == 'capture') {
      $order_total = variable_get('uc_fix_broken_totals', TRUE) ?
        round($order->order_total, 2) : $order->order_total;
      $qptxn = quickpay_capture(array(
                 'transaction' => $payment->qp_transaction,
                 'currency' => variable_get('uc_currency_code', ''),
               ), $order_total);

to


    if ($form_state['clicked_button']['#action'] == 'capture') {
      $order_total = variable_get('uc_fix_broken_totals', TRUE) ?
        round(uc_payment_balance($order), 2) : uc_payment_balance($order);
      $qptxn = quickpay_capture(array(
                 'transaction' => $payment->qp_transaction,
                 'currency' => variable_get('uc_currency_code', ''),
               ), $order_total);

(minus the tags)
and see if that doesn't makes it capture the remaining amount, instead of the order total. If it does, I'll include it in the next version.

jens peter’s picture

Worked perfect.
Thank you so much.

xen’s picture

Status: Active » Fixed

Committed. Will be in 1.3.

Status: Fixed » Closed (fixed)

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