I'm very confused about the way this module works.

After much testing this is the flow I can see:

  1. User enters payment detail on checkout page
  2. User submits checkout page
  3. System sends payment details to PayPal
  4. PayPal charges card
  5. User is sent to Order Review Page

At this point, the order is paid, but the user can still click "Go Back" and the Order entity is set to the "Review" state. No order completion emails are dispatched.

As far as the user knows, no payment has been made. But if you click "Go Back" then you can't click "Continue to next step" again to get passed the Payment pane, because errors are thrown by PayPal: order amount is $0

So basically, the "Review" page is both worthless and dangerous.

If the user doesn't hit "Continue to next step" the only thing that doesn't happen is the Rules that fire when the order is complete.
If the user clicks "Go back" they are in for a world of errors.
If the user abandons the order, and thinks they haven't paid, they will be very upset to learn that the payment has already been made.

Am I just way off base here? This seems like a big deal.

Comments

tmsimont’s picture

Issue summary: View changes

missed a step

tmsimont’s picture

Status: Active » Closed (duplicate)

It seems that at some point this issue was almost addressed. There is a rule you can configure to "Capture a payment from a previous authorization" but the rule is empty. In the latest dev version its totally removed. I think this came from this support request:
#1820356: Rule to capture from a previous authorization empty

The WPP module is really not usable on its own if there is no way to authorize payment during checkout, then capture when the order is complete. I will close this as a duplicate of the above issue and continue this thread there.

tmsimont’s picture

Status: Closed (duplicate) » Active

not a duplicate... this issue seems to be moved out of commerce. I think this is the responsibility of the WPP module to support capture of payment outside of the submit handler for the payment pane.

tmsimont’s picture

OK so here's what I've discovered so far.

It seems my original issue could be resolved if on the WPP settings page this is selected: Authorization only (requires manual or automated capture after checkout)

If that's selected, however, there's no way to capture the payment automatically.

You could do it with rules, but there's no rule in commerce or payment or WPP that would allow you to do this. That's where #1820356: Rule to capture from a previous authorization empty comes in.

You could argue that I'm looking for a new feature here, but consider this:

  1. The default setting of "Authorization and capture" will result in the buggy, broken process that I detailed in the original issue summary
  2. The alternative setting of "Authorization only (requires manual or automated capture after checkout)" will require an administrator to capture payments manually, or custom PHP code in rules to work.

That's why I'm keeping this as a "bug report"

For now I will probably go with a PHP solution in a custom rule, but I feel like this should not be required to make this module work. I will post back my solution here.

I would be willing to post a patch as well if someone could give me some guidance about where this should be fixed:

  1. Should the fix be a rule in commerce payment like the one druroot put together in #1820356: Rule to capture from a previous authorization empty
  2. Should the fix be a rule in WPP that is similar to druroot's patch, but specific to PayPal?

I'd vote for #1

tmsimont’s picture

Status: Needs review » Active

Attached is a patch that moves the capture functionality from the admin capture screen into a function that can be used from a rule. If the patch I attached to #1820356: Rule to capture from a previous authorization empty is committed, then this will allow an admin to put a rule at checkout that will use the action from the payment module to capture the payment.

So to make this work

  1. use patch from #1820356: Rule to capture from a previous authorization empty
  2. apply the patch below
  3. edit your WPP payment method: set "Default credit card transaction type" to "Authorization only"
  4. go to checkout rules, add a new rule
  5. call it what you want
  6. add an action: "Capture from a prior authorization"
  7. profit
tmsimont’s picture

Status: Active » Needs review
StatusFileSize
new12.11 KB

forgot to attach

rszrama’s picture

Category: bug » support
Status: Active » Needs work

Yeah, the problem was with your configuration - for instant payment methods like CC payment, the payment checkout pane needs to be at the last step before completion. It doesn't make a whole lot of sense to collect payment before the review page in most cases, because customers like to see the final order total before giving their payment information. Even if capturing a prior authorization was implemented through Rules, you still need to void authorizations as well, otherwise each time someone goes forward and back without completing checkout, you'll end up with multiple authorizations against the same credit card which can affect a customer's credit / daily limit.

tmsimont’s picture

The payment checkout pane needs to be at the last step before completion. It doesn't make a whole lot of sense to collect payment before the review page in most cases, because customers like to see the final order total before giving their payment information.

That seems crazy to me. Isn't that why the first pane on the Checkout page is the cart contents and line items? The user already had to see the cart once to get to checkout, then they see it at the top of the Checkout page. Why would they need a 3rd review before even entering credit card details?

I feel like in most e-commerce websites, I enter payment info on the checkout screen before a final review lets me pull the trigger on the order... I can't think of one time that I ever went from entering my credit card to immediately getting charged.

Anytime I've ever purchased anything online, I get to review my order AFTER I enter my credit card information but BEFORE the order is submitted. With the way you say this module should work, you'd review the order, THEN enter the credit card, and then it's all over without any further review? That seems extremely odd to me.

Doesn't Ubercart collect credit card details on the page before the final review "submit order" action?

Also, if authorization before capture causes credit problems for the user, why even provide that option?

tmsimont’s picture

Category: support » feature
StatusFileSize
new98.15 KB
new82.39 KB
new65.89 KB

OK...

So I just spent some time on this, talked it over with my boss and did some homework..

My misunderstanding of exactly what "Authorize" involves is the source of my confusion.

Authorization vs. capture

I asked

if authorization before capture causes credit problems for the user, why even provide that option?

I read up on Authorization vs. Capture and found the following :

Capture Within 3 Days

  1. Your buyer orders a camera from your website.
  2. Your buyer enters payment information and authorizes payment.
  3. Send your buyer to PayPal using a hosted flow, specifying the variable paymentaction=authorization
  4. PayPal initiates the authorization.
  5. On day 3, you ship the camera and capture funds.

So, Authorization should NOT occur when the user simply enters a Credit Card ##

Checkout process with "Review" between CC entry and auth/capture

I defend that it is quite common and often expected that the user get 1 last review before the Payment completes.

See apple.com and amazon.com as examples:

apple.com checkout

apple.com screenschot of checkout
Shows 1 more step to review between CC entry and submission

amazon.com checkout

amazon.com screenschot of checkout
Shows 1 more step to review between CC entry and submission

However, it seems it is not possible to develop this workflow with this WPP Drupal Commerce module because submission of the payment pane seems to send CC data to PayPal immediately, either to authorize or capture. So there is no final review for the user.

Checkout process withOUT "Review" between CC entry and auth/capture

It appears that the only way commerce will work is if the payment executes immediately after CC entry. I suppose that makes sense if there's not a way to interact with PayPal in way that offloads the CC data to be processed at a later stage without actually running an authorization call.

It seems Reebok.com uses this method:

reebok.com checkout

reebok.com screenschot of checkout
Shows immediate order completion after CC entry

My questions:

  1. Is this correct that there's no way to stop the Payment pane from sending payment to PayPal immediately?
  2. If so, is it indeed because we can't give CC details to paypal without running auth, and because storing them in $_SESSION or, $form or anywhere in the database is a PCI violation?
tmsimont’s picture

Category: feature » support
rszrama’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Status: Needs work » Fixed

A few responses to some of your comments:

"That seems crazy to me. Isn't that why the first pane on the Checkout page is the cart contents and line items? The user already had to see the cart once to get to checkout, then they see it at the top of the Checkout page. Why would they need a 3rd review before even entering credit card details?"

Because they might select a shipping service or enter an address that results in tax being added to the order, and they'd never know. Notice that even in the Apple.com example, you can see on that page that shipping is free and tax has been estimated. We provide the review step because there is no AJAX updating of these elements on the same page as addresses are entered and shipping is selected - although that is on the roadmap for Commerce 2.x.

However, there is no secure way to store credit card numbers between checkout pages without either authorizing or capturing the card. Ubercart is a bad example, because I rewrote the checkout / payment process in Commerce precisely to avoid what we hacked together in Ubercart. It may follow the letter of the law when it comes to PCI compliance, but it certainly doesn't follow the spirit.

"So, Authorization should NOT occur when the user simply enters a Credit Card ##"

I think you got too strong of an idea here. There's nothing wrong with authorizing the CC when the customer enters it and capturing on checkout completion so long as you can ensure the capture amount doesn't exceed the allowable amount over the authorization amount. That varies gateway by gateway.

You could treat it as a card on file, but that's going to involve an authorization to make sure the card is valid (albeit a smaller one, and the follow-up transaction can issue a re-authorization for whatever amount you want. Those sites that you're used to having simpler checkout processes - Apple.com, Amazon.com, etc. all likely have PCI compliant CC storage mechanisms that they can use. Apple sure does.

With all that in mind, the answers to your closing questions are yes and yes. It's an issue of PCI compliance and architecting for the lowest common denominator in terms of who's actually using the software. There may in fact be people who certify Commerce to run in a PCI Level 1 compliant manner who could store cards if they wanted and send them off arbitrarily later, but my hunch is that number will be close to 0 for the life of Drupal Commerce. ^_^

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

missed detail