Closed (fixed)
Project:
Commerce Klarna Payments
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2018 at 12:12 UTC
Updated:
28 Nov 2018 at 14:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
agoradesign commentedComment #3
agoradesign commentedComment #4
agoradesign commentedComment #5
tuutti commentedThis seems to works great otherwise, but right now you can only capture the full amount. Adding something like
would probably fix this.
Comment #6
agoradesign commentedgood point. I'll try, if this helps... but first, I'm preparing another patch :D
Comment #7
tuutti commentedActually, adding this might cause problems with #3013322: OrderTransitionSubscriber should check, if order is already paid, before trying to capture since it won't be paid fully anymore.
I guess we could change capture request to use $order->getBalance() rather than $order->getTotalPrice().
Comment #8
agoradesign commentedAnother very good point :)
Comment #9
agoradesign commentedOk, we should leave the other issue as is, because checking for being paid in full is still valid so. Using the balance instead of total price is rather a side effect of this one here, so I'll rather add this here
Comment #10
agoradesign commentedUpdated the patch considering the balance - but haven't tested it so far. Will post my feedback then
Comment #11
tuutti commentedI'm not sure what's the use case for using partial captures, but after thinking more about this, I don't think we should capture the remaining funds because they should have a specific reason to not to capture the full amount.
I propose that we check if order has payments, but is not paid in full and then release the remaining amount and let the merchants handle any extra captures they wish to make.
Comment #12
agoradesign commentedok, then two questions arise at least:
If we still do the old amount to total price comparision, theoretically the capture on placement shouldn't take place at all, if there's already a partial payment
Comment #13
agoradesign commentedUpdate to point 2 of my last comment: if the manual capturing has been done via Commerce UI and therefore via capturePayment() as suggested here, then the payment status gets set to completed either way. And that's also correct, as the single payment is completed... So either way, if we compare the amount against the price, or like I suggested, that the payment must be in authorization state, in both cases the automatic capturing on order fulfillment won't take place, as there's no payment to operate on
Comment #14
agoradesign commentedHow can I help to make progress on this issue? Should I do any changes?
Comment #15
tuutti commentedI'm currently testing this.
For some reason this still seems to capture the full amount when order is fulfilled.
After manual capture (200 €):
After fulfilling the order:
Comment #16
tuutti commentedOh, it's because:
is after the createCapture API call.
Comment #17
agoradesign commentedoh,, I've thought that I have moved that already!?! in fact not... must have gone lost between all the patches
Comment #18
tuutti commentedI added support for releasing the remaining authorization. Can you test this?
Comment #19
agoradesign commentedok, will have a look
Comment #20
agoradesign commentedWorks! :)
Comment #22
tuutti commentedNice, thanks!
Comment #23
agoradesign commentedwow cool, suddenly there's no more patch needed in our project :)