I installed this module on a test site and it all works like a charm. There's one issue though, that I didn't manage to solve and like some support on;

After recipient ordered the gift, I want the value of the gift certificate to be set to zero in the user account. In my case the amount stays the same, so the certificate can be used multiple times.

So, my question is how -and where- to set the certificate to 'use one time only'?

Any help on how to prevent this is much appreciated.

Comments

pixelsweatshop’s picture

getting this same issue.

pixelsweatshop’s picture

Component: Documentation » Code
Category: support » bug
Priority: Normal » Critical
bsorrells’s picture

Yeah, me too. The amount stays the same. I was able to place two orders and use the same gift certificate two times. What am I missing?

mcfilms’s picture

Wouldn't this bug render the module rather useless?

torgospizza’s picture

I'm not seeing this... we're actually using the module on our site (rifftrax.com) and all deductions happen as they should. The certificate acts like store credit, so if you have a $20 store credit, you are able to use it to buy 2x $10 items, or one $19.95 item (with $0.05 remaining), etc.

Is this not happening? Or is the use-case "One-time use, no matter the amount"? I'm not quite sure what the issue is, but I'm willing to investigate.

It makes me wonder if it's a payment status issue - IIRC the module is checking for certain order statuses before it deducts the payment. Part of me wants to make this a Conditional Action, which would probably help with issues like this.

bsorrells’s picture

I'm confirming this is still happening for me. Here's my use-case:

1) Anonymous user purchases a gift certificate for $29.95 for a person who doesn't have an account.
2) Recipient gets an E-mail that has a UC cart link to the product that was bought as a gift for them.
3) Recipient clicks on that link, is taken to the UC cart, and then logs in to complete their transaction.
4) Recipient uses the Gift Certificate method of payment because the cost of the order is == to the value of the gift certificate.
5) The order goes through, the recipient is granted the correct role based on this purchase, but the value of their gift certificate credit does not diminish in their account.

This would allow the user to repurchase their subscription forever for no cost. I can't figure out where it's going wrong or what I could have set up differently to cause this.

This is as of right now -- 4/4/2011.

bsorrells’s picture

Update -- I just tried an order where the order total exceeded my gift certificate credit. In this case, the order total was $34.95 and the GC value was $29.95, leaving a balance of $5.00 (which I used a credit card to pay for).

This resulted in the correct behavior the the GC value was zeroed out in the user's account.

So -- it looks like this is only happening when the value of the GC == order total.

torgospizza’s picture

Hmm, interesting. Thanks for the additional info. The strange thing is, as I've said, I've never seen this or been able to reproduce it - but I will try with this additional info and report back.

If you are able to keep digging that'd be helpful too... I kind of find it hard to believe this is the ONLY reason behind the issue.

bsorrells’s picture

Thanks. I'm working on it again now, so I'll report back what I found.

kenheim’s picture

It was doing the same for me, but then I changed the setting (store administration > configuration > gift certificate settings) under "Order Status for Deducting" from payment received (the default) to Pending, and now it seems to be working as it should.

torgospizza’s picture

Hmm, strange. Not really sure how that'd make a difference, although to be honest the workflow of "updating an order status" isn't very well thought out in Ubercart.

One idea would be to remove all of my custom logic and require Conditional Actions entirely to do that bit... but I'm not quite sure yet.

kenheim’s picture

Changing the "Order Status for Deducting" to pending was necessary because when using gift certificate only, the status never gets set to payment received. However, I have since discovered that if using a gift certificate with a credit card, the status does get set to payment received and not pending, so just having the pending checkbox checked doesn't get it done in that situation. I have since tested both scenarios with both checkboxes checked, and it appears to work as it should.

kenheim’s picture

Status: Active » Needs review
torgospizza’s picture

Status: Needs review » Postponed (maintainer needs more info)

I wonder if this applies to everyone? Still seems there might be an underlying issue that needs fixing though. Setting to needs more info.

sleepingmonk’s picture

Just ran into this issue as well.

1) Paying the order in full with the GC sets the status to Pending.
2) A "split" payment, part GC, part Credit Card, sets the status to Payment Received.

If the deduction settings have both of these statuses checked, things work. However, consider the following scenario:

- order is paid in full with GC
- status goes to "Pending"
- GC amount is deducted
- Site administrator later updates the status to "Payment Received"
- GC amount is deducted again!

This scenario can happen when admins use the order status in their order processing workflow, I.e. "Payment Received" orders are processed by the shipping department. Shipping department sets status to "Complete" once shipped. So if an admin sees the Pending transaction, sees that it has been paid by GC, they have to set it to "Payment Received" so shipping can process it, triggering the deduction again.

"Payment Received" has to be checked in the settings because combo payments set status to "Payment Received" and deductions need to be made at that point too.

So if there was a way to check if the deduction was made on the transaction already, then there could be a condition to check before another deduction is made.

Alternately, if the GC payment could set the status to "Payment received" like a regular payment, there would be no need to deduct on "Pending", and no need to switch status. Probably a simpler solution, but still leaves the risk of multiple deductions if someone goes switching statuses and hits "Payment received" more than once, for some reason.

I can try a patch to set "Payment Received" status if you think that's a worthwhile effort. I just found a related thread:
http://drupal.org/node/960594

cocofireah’s picture

Yes, me to

jasonabc’s picture

Version: 6.x-1.1 » 6.x-1.4
Status: Postponed (maintainer needs more info) » Active

I am getting this also. Am using the latest version of the module (1.4) on Ubercart 2.2. A client notified me after a customer of theirs was able to place multiple orders for over $1,000 of merchandise using a $200 gift certificate!!!

I tested this myself this morning and the gift certificate funds are not reduced following checkout (if the gift cert option is checked). Here is the scenario:

Had $75 of gift cert funds tied to my account. Placed an order for a $30 shirt (grand total with shipping and tax = $47). Opted to use my gift cert funds to pay for the entire order. Checked out successfully. Gift cert funds REMAIN at $75. The funds are usable over and over again.

Desperate for a fix here. Any ideas??

torgospizza’s picture

What is the final "order complete" status of the orders you've placed, and what is the completed order application configured as in your Gift Certificates configuration page? That would be the first thing I'd check.

jasonabc’s picture

Hey TP - thanks for the reply. Both order complete statuses (deducting & issuing) were set to "payment received". In the "Order Status for Deducting" I also added "pending". This seems to have solved the problem (phew!), although if the owner moves the order from pending to payment received I can see a possible double deduction on the gift card occuring? There is nothing in the README that comes with the module about setting the order statuses. Since this can cause the module to completely fail, it really should get a mention...?

Any chance this can be added to the README - and the module sets order statuses up properly upon install? We have this module running on a bunch of sites (they have all now been changed) but it is only blind luck that prevented this critical issue from surfacing before now.

cheers

torgospizza’s picture

Not a bad idea. I actually have another version of the module that was engineered more recently that I'd like to put out, I just haven't had the time. I'll see if I can take care of it this week.

dpintats’s picture

@jasonabc I was able to make a workaround for the order status deduction issue by adding a new conditional actions and order statuses. These tools are all

Credit card orders (or orders that are immediately marked payment received):
Create a new action predicate -

Trigger-> Order status gets updated

Conditions:
Check the order status-> updated order = Pending
Check payment method -> original order = gift certificate
Check order balance -> updated order = 0

Action:
Update the order status -> Updated order = Payment received

Check/CoD payments:
Create a new order status called 'Pending check'
Add this status to the deductions options on the gift certificate admin page

Create a new configurable action predicate -

Trigger-> Order status gets updated

Conditions:
Check the order status-> updated order = Pending
Check payment method -> original order = check
Check order balance -> updated order balance > 0

Action:
Update the order status -> Updated order = Pending check

As you can see, there are a wide variety of having the gift certificate amounts deducted. Hope this helped!

torgospizza’s picture

This should be fixed without doing the CA route.. Can you test the 6.x-2.x version? (Note: I would probably not test this in a production environment, so you should ONLY install it on a test site.)

Essentially I am working on moving the issuing and deduction of certificates into a hook_uc_order_complete() call. Unfortunately I don't know if this works with orders that are "point of sale" or are held and then authorized later, but I'd love some testing on that. Any help is appreciated and remember this code is in heavy flux and will probably be getting multiple rewrites in the coming weeks.

1kenthomas’s picture

@22: What exactly are the issues for those of us in production environments? Any way I can meaningfully help with getting this working? Thanks.

torgospizza’s picture

The only issues really are just making sure that certificates are applied/deducted for all scenarios. I don't know if I have full coverage over them yet, but I did want to write some SimpleTest scenarios for each. However we ARE running the 2.x version on our production site (rifftrax.com) and so far there have been only a few minor issues which I was able to correct and apply back to the 2.x branch. (They had to do with deduction and adding comments to the order when a certificate was processed.)

Also one thing to keep in mind, I also need to write up a CHANGELOG, because the process of allowing certificates to be purchased has changed somewhat. (It's easy, really, you just need to create product attribute(s) for the Recipient Email address or the Message to Recipient, and then choose those values in the GC settings area. This allows stores to begin selling physical gift cards that can be printed and mailed.)

I'll keep poking around and will write up a more complete documentation as soon as I'm able.

1kenthomas’s picture

Priority: Critical » Normal
Status: Active » Closed (duplicate)

Since this is now an issue for -2.x-dev, I'm going to close to eliminate duplicate tickets. See open -dev ticket. (I resolved by a lot of .hs hacking). Feel free to reopen if you need.

Please note: priority is an indication of how critical it is to the module's status, not to you :)