I'm very confused about the way this module works.
After much testing this is the flow I can see:
- User enters payment detail on checkout page
- User submits checkout page
- System sends payment details to PayPal
- PayPal charges card
- 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.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | apple.png | 65.89 KB | tmsimont |
| #8 | amazon.png | 82.39 KB | tmsimont |
| #8 | reebok.png | 98.15 KB | tmsimont |
| #5 | commerce_paypal-authorize_then_capture_callback-1851340-4.patch | 12.11 KB | tmsimont |
Comments
Comment #0.0
tmsimont commentedmissed a step
Comment #1
tmsimont commentedIt 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.
Comment #2
tmsimont commentednot 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.
Comment #3
tmsimont commentedOK 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:
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:
I'd vote for #1
Comment #4
tmsimont commentedAttached 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
Comment #5
tmsimont commentedforgot to attach
Comment #6
rszrama commentedYeah, 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.
Comment #7
tmsimont commentedThat 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?
Comment #8
tmsimont commentedOK...
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
I read up on Authorization vs. Capture and found the following :
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
Shows 1 more step to review between CC entry and submission
amazon.com 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
Shows immediate order completion after CC entry
My questions:
$_SESSIONor,$formor anywhere in the database is a PCI violation?Comment #9
tmsimont commentedComment #10
rszrama commentedA 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. ^_^
Comment #11.0
(not verified) commentedmissed detail