godaddy-wordpress / wc-plugin-framework

The official SkyVerge WooCommerce plugin framework
Other
138 stars 42 forks source link

Authorization / charge handling for virtual-only orders #144

Closed bekarice closed 8 years ago

bekarice commented 8 years ago

Considering for a future payment gateway feature: If an order contains only virtual items, and you authorize transactions, customers won't get access to downloads / content / memberships / etc until the charge is captured and the order moves to "processing".

For a virtual-only order, we could probably handle this a bit better. It makes sense for many merchants to automatically charge virtual-only orders rather than authorizing them (as most times they're capturing when shipping, so the hold isn't needed), so moving for a setting here.

If "Authorize" is used for transactions, have a second setting shown:

Ref HS 24700

justinstern commented 8 years ago

Considering for a future payment gateway feature: If an order contains only virtual items, and you authorize transactions, customers won't get access to downloads / content / memberships / etc until the charge is captured and the order moves to "processing".

This makes sense to me. Would you not want to also do this with a mixed-order that has both virtual and physical goods? Have the ability to restrict any virtual items on an order, regardless of whether the whole order is virtual?

bekarice commented 8 years ago

Would you not want to also do this with a mixed-order that has both virtual and physical goods?

Typically with a physical good, the reason I've seen a lot of merchants wait to capture the charge is waiting until the order ships. Therefore, if the order contained a non-virtual / physical good, they probably still want this authorization workflow to apply. Otherwise, you could just set the transaction type to "charge" instead 😸

Have the ability to restrict any virtual items on an order, regardless of whether the whole order is virtual?

Not quite sure what you mean here? I don't see how you'd capture payment for some items but not others, partial captures / multiple captures are not supported.

justinstern commented 8 years ago

oh apologies, re-reading the issue I thought you were saying that this part "If an order contains only virtual items, and you authorize transactions, customers won't get access to downloads / content / memberships / etc until the charge is captured and the order moves to 'processing'." is how we'd like it to be, rather than how it currently is. Makes sense now

bekarice commented 8 years ago

👍 currently auth'ed transactions are on-hold, they only move to processing when captured. As a result, no download / membership / etc access is granted to anyone who "pays" for a virtual-only order until someone in the admin captures it (because they haven't truly "paid").

While this makes sense with the shipping workflow, it can be better for these sort of cases, we could just charge an all-virtual order directly instead of auth'ing if the merchant wants that as no items need to be shipped, and thus waiting on a capture may not be useful.

justinstern commented 8 years ago

yep, totally

maxrice commented 8 years ago

seems like a fine idea to me, should be straightforward enough to implement.

dax702 commented 8 years ago

So when this feature becomes available, if an order (containing virtual download products only) is marked as processing once the customer's card is authorized, does it ever have to be marked as completed for any reason? I know you need to mark orders as completed for shipped goods to do things like send the order completed email which would contain tracking number info. I am new to Woo and just trying to plan all this stuff out for the easiest workflow.

bekarice commented 8 years ago

@dax702, marking it completed is up to you, it's not required -- just useful to note that no further action is needed for the order. Note that this feature will only apply to SkyVerge payment gateways.

For your reference: orders containing only virtual and downloadable items are automatically completed when paid by WooCommerce, so that would be supported with this workflow automatically; it would work like any other charge.

Virtual (not all-downloadable) orders are not auto-completed, and thus would be left as processing still (in case there are virtual goods like a logo design to deliver).

dax702 commented 8 years ago

That's interesting, because I just came across this page:

http://www.pootlepress.com/2014/04/100-woocommerce-tips-tricks/

Look specifically at the ones titled:

I'm not a coder, but it sounds like one of these code snippets would solve the problem without having to modify the gateway plugin, or did I miss something?

bekarice commented 8 years ago

@dax702 The snippet they borrowed from us for that is way old, it doesn't work with WooCommerce 2.2+. If you wanted to auto-complete virtual orders (or all of them), our Order Status Control plugin would do the trick.

dax702 commented 8 years ago

Yes I'm always leery of blogs with code snippets and usually look at the date of the post but missed that this one was from 2014. Thanks for the clarification. I will read about the status control plugin.

dax702 commented 8 years ago

Beka, regarding the Order Status Control Plugin, the docs say "WooCommerce will auto-complete paid orders that contain only virtual-downloadable products..." But with regard to your Authorize.net AIM plugin, if the transaction type is set to Authorize, then that's not considered "paid" so the order status control plugin wouldn't really help in this case, correct?

bekarice commented 8 years ago

if the transaction type is set to Authorize, then that's not considered "paid" so the order status control plugin wouldn't really help in this case, correct?

@dax702 That is correct. In the current state, OSC wouldn't do anything with an authorized-only order.

That's what this issue would aim to change -- if the order is virtual-only, then it would be charged immediately, marked as paid, and Order Status Control could auto-complete it depending on your settings.

dax702 commented 8 years ago

Ok, thank you, just want to make sure I'm on the same page

dax702 commented 8 years ago

Wouldn't another solution just be to give orders placed with this payment method the status of "processing" when transaction type is "authorize" ? And if transaction type is set to charge, then give it a status of completed. This would then give access to virtual download products because Woo doesn't give access unless status is processing or completed. And for shipped product orders, processing is correct too. An authorization is good for 30 days. The only thing that hasn't been done with an authorization is settle the funds to the merchant's checking account. To use "on hold" status for an authorization doesn't make any sense (to me)

bekarice commented 8 years ago

Hi @dax702 I'm afraid that processing status for an authorization isn't an option. The on hold status lets us ensure that non-captured orders are differentiated from captured payments, that stock isn't reduced until payment is taken, and that inventory will be reduced automatically on capture.

We can't use processing vs completed as many stores with physical goods reserve completed status for when the order has been shipped, not when it's paid for, thus a "charge" should never immediately move to completed without user input. We need to support the vast majority of stores who use these statuses to signify "paid for" vs "we've sent this".

We're about to begin our next framework development cycle for framework v4.5 within a week or two and we've milestoned this feature request to look at during 4.5 development, stay tuned 😄