Greetings. I have uc_free_order installed on UC 6x-2.2 (on Drupal 6.14). I have a couple of products for which a third-party is billed, so the price for the customer is $0.00; When I go to check out, the cart pane says something like "click 'continue' to proceed with your free order,' but once continue is clicked, the following error message appears:

You have entered an invalid credit card number.
The credit card you entered has expired.

I have only the credit card payment method enabled, set to use our PayPal WPP gateway.

Any help or guidance will be appreciated...

Thanks in advance.

Comments

BigTuna’s picture

I have the same problem. It complains about the required fields:

* Enter the owner name as it appears on the card.
* You have entered an invalid credit card number.
* The credit card you entered has expired.
* You have entered an invalid CVV number.

It also doesn't update the order total.

krlucas’s picture

I am seeing this issue. The hidden/unhidden radio button that's supposed to accompany the "Continue with checkout to complete your free order" never seems to be added to the payment pane.

It only seems to affect me when trying to checkout with a shippable item--even if the shipping fee is $0. Can anyone else confirm this?

I'll do some more digging and see if I can up with any solutions.

krlucas’s picture

False alarm. In my case it was uc_recurring removing "invalid payment types"; had nothing to do with shipping.

jjp125’s picture

I am having this issue also not sure what to do. What is "uc_recurring"?

krlucas’s picture

uc_recurring refers to the Recurring Payments module for Ubercart. It removes payment methods from the payment pane that are incompatible with recurring products.

mattman’s picture

Status: Active » Closed (works as designed)

After having fought with this myself for close to a day, I found the issue is a configuration (rather more of a lack of documentation) issue.

It turns out, that if your default payment method is something like credit (uc_credit module) then this will persist through to review page. When it tries to move to the order review page, with a payment method setting of credit, it will still want valid credit details, hence the error warnings. Here's the problem.

When you install uc_free_order (especially after you've setup your cart with credit, paypal or both), it will execute the javascript just fine and tell you to continue to complete the order (message reads "Continue with checkout to complete your free order"). However, the payment method is STILL internally set for 'credit' when it needs to be set for 'free_order'

The problem is that you have not turned on the 'Free Order' payment option at /admin/store/settings/payment/edit/methods

If the payment method for Free Order is not enabled, then the javascript will not be able to check a radio button option of a free order because it's not there on the form. This is how the module is determining if the order is free. If the radio button is checked. Personally, I think it should just check the internal order total, but this is how it's coded.

It also has an additional layer of validation by actually checking the order total in case someone tried to spoof a free order. If the order total is any amount equal to, or greater than 1¢ then it will push the user back to the cart checkout page.

I'm marking this closed to help the maintainer, unless someone else has further issues. This was also addressed at #534710: Why use JS instead of processing everything through hook_form_alter? although it's obscurely technical and brief.

virtuali1151’s picture

I am having this issue and I have ensured that the free order option is enabled. Here is what I am using:

Ubercart: 6.x-2.x-dev
Eway: 6.x-2.x-dev
UC Recurring: 6.x-2.x-dev

Here is the error:

Enter the owner name as it appears on the card.
You have entered an invalid credit card number.
The credit card you entered has expired.
You have entered an invalid CVV number.

Any ideas??

Cheers.

virtuali1151’s picture

Version: 6.x-1.0-beta4 » 6.x-1.x-dev
Priority: Normal » Major
Status: Closed (works as designed) » Active

changing to active

virtuali1151’s picture

Has anybody had any luck with this by chance?

Cheers.

krlucas’s picture

@virtuali1151

Free order is incompatible with orders that contain products with a recurring feature. See my comment above.

Are you testing orders with products that contain a recurring payment feature?

virtuali1151’s picture

@krlucas - yes.. the products I am trying to process do indeed have recurring payments. Would you happen to have any other suggestions to get around this?

Cheers.

brettev’s picture

if we're using the 6.x-1.x-dev version of the module, is this same .diff file from #14 supposed to work? I got the changes integrated to the module, but I'm still seeing the billing info fields on the checkout page. I'm willing to dig into the php or js to fix stuff, but i'm not sure where to start, if this is supposed to work...

krlucas’s picture

@virtuali1151

I don't understand your use case--what's the point of a recurring payment on a free product? How are you going to charge later if you don't collect a credit card? Our workaround, such as it is, has always been to create non-recurring version of the product as a different product or SKU-- if we need to make them free. For us, this requires careful use of cartlinks and other methods to put the right product in the cart.

Kelly

brettev’s picture

I'm not doing recurring payments, its just still not working for me...

I went in and manually added the code from the diff where it's supposed to go, but the fields stay there.

mrconnerton’s picture

@krlucas / @virtuali1151 - The use case is providing a free trial period. I am using Paypal WPP + Direct Payment Recurring Payments (DPRP) to create subscription profiles on paypal from ubercart products. If we want to provide a free subscription, the ideal way would be to set the cost to $0, and the recurring to the cost of the subscription. They would checkout using their credit card to create the subscription via the hosted gateway (paypal WPP in our case).

sparrish26’s picture

I'm having the same issue. Has anyone worked out a solution to this?

sidharth_k’s picture

subscribing.

krlucas’s picture

@mrconnerton I submitted a patch to the uc_authorizenet module #691926: Allow $0.00 CIM transaction that allows the collection of credit card details on $0 transactions. I know you are using paypal, not auth net, but perhaps it can help you out.

mrconnerton’s picture

@krlucas That project was SO last month :-P

You're bypassing talking to authroize.net all together if at checkout the total is 0.

For the use case of If we want to provide a free subscription, the ideal way would be to set the cost to $0, and the recurring to the cost of the subscription. we will still need to capture the credit card data to send to paypal to create the subscription profile. This use case belongs half here and half in a paypal issue queue somewhere. I just haven't had the time to look into it and the client decided to go a different direction.

Anonymous’s picture

Hi everyone, if you are using uc_recurring and would like to not take cc info at all, we were struggling with the same problem, and i think implemented a good solution.

The free payment method needed to be recognized by recurring module as a payment method that could do recurring billing. so we implemented the hook_recurring_info.

here is what we needed to insert:

/*
 * Implementation of hook_recurring_info (from uc_recurring, optional support for CIM-style recurring payments)
 */
function uc_free_order_recurring_info() {
  $items = array();
  $items['free_order'] = array(
    'name' => t('Free Order standalone'),
    'payment method' => 'free_order',
    'module' => 'uc_recurring',
    'fee handler' => 'free_order',
    'renew callback' => 'uc_free_order_renew',
    'process callback' => 'uc_free_order_proc',
    'own handler' => FALSE,
    'menu' => array(
      'charge' => UC_RECURRING_MENU_DEFAULT,
      'edit' => UC_RECURRING_MENU_DEFAULT,
      'cancel' => UC_RECURRING_MENU_DEFAULT,
    ) // Use the default user operation defined in uc_recurring.
  );
  return $items;
}

function uc_free_order_renew($order, &$fee) { 	 return true; }
function uc_free_order_proc($order, &$fee) { 	 return true; }

Here are the steps:

  1. Add this code to the uc_free_order.module (if you are not sure how to do this download a patched version from here ).
  2. go to http://example.com/admin/store/settings/payment/edit/recurring and make sure where it says Valid payment methods for orders with recurring fees: that free payment method is selected

P.S. Also maybe someone with proper permission level could apply this as a patch to the module.

The development was sponsored by Levia IT. The developers who worked on this are:

mediacube.sk’s picture

I had the same problem on D7, I wanted to skip billing and payments at checkout if their price is 0. This is the piece of puzzle I was missing - thank you! gonna try it.
An easy workaround for D7 is here:

function mymodule_form_alter(&$form, $form_state, $form_id) {
  if($form_id == 'uc_cart_checkout_form') {
        $items = $form['panes']['cart']['cart_review_table']['#items'];
        $total = 0;
        foreach($items as $item){
            $total += $item->price * $item->qty;
        }
       
        if($total <= 0){   
            unset($form['panes']['payment']);
            unset($form['panes']['billing']);
        }
    }
}

So what I'm actually doing is deleting the panes dynamically based on the total price of the order. I have a subscription page, so there is never more than 1 product/subscription in a cart, but this solution works for any number of prods.

Hope it helps someone.

coxtopz’s picture

Component: Code » Documentation
Assigned: Unassigned » coxtopz
Category: bug » task

I have to buy the latest version of the quick heal ...so plzzz help me how can i do it..
send me some help

hockey2112’s picture

I was receiving the same error mentioned in the original post, on orders where customers were using a discount code (via uc_discounts_alt) to get their product for free. I was able to fix the problem by modifying the "Free Order" payment method's Conditional Action. I changed that CA to instead check whether the cart had the discount(s) in question. If the discount(s) was/were used, the cart pulls in the Free Order payment method, and it all works as expected.

emcniece’s picture

This looks promising but I'm a bit confused as to the code posted in #21 - is that _form_alter() function supposed to replace the uc_free_order_form_alter() found in the uc_free_order.module file referenced in the link from #20?