Closed ghost closed 8 years ago
Sounds like a sensible feature to me. Some questions for clarification:
Capturing each order position individually might produce a high number of capture requests to our plattform that might produce higher costs for merchants. It should be possible to capture multiple order positions at once, e.g. in an array() of s_order_details.id. Will that also work in the setting you have in mind?
Additionally, the $amount parameter is redundant, as we can calculate the amount from the price
and quantity
columns in s_order_details. Or is there any specific reason why you would like to set the amount manually?
@bestit-tkellner Please give feedback on these questions, thanks!
@fjbender thanks for your information, i didn't know that.
Yes we can use an array (or an object?) for this function like this:
<?php
$data = [
[
'id' => 12,
'quantity' => 10
],
[
'id' => 13,
'quantity' => 5
],
];
It's also possible to use a quantity instead of a amount.
Appreciate your feedback, I'll talk to Dev about it.
Hi @fjbender , i found the reason why we want to use amount instead of quantity.
We have to calculate article specific amounts for custom articles.
Problem is, that some payment methods require the capture to contain exactly the positions given in the preauthorization. While "free amount" captures work for some payment methods, this is not standard. The standard would be only to capture the preauthorized positions, as this works for all payment methods.
@Fatchip-Support a viable method to keep track of how many articles have been captured and refunded would be to store the number of captured and debited articles in the s_order_details_attributes
table. ERP systems will need to keep track of this in order to be able to refund and capture articles of the same type at the same time.
I added the neccessary method as requested. The first argument $orderDetailParams is an array like this:
$data = [ [ 'id' => 12, 'amount' => 10.0 ], [ 'id' => 13, 'quantity' => 5 ], ];
Note that all orderDetail Ids have to belong to the same Order.
hey, thanks for your support.
public function captureOrder($orderDetailParams, $finalize = false, $includeShipment = false)
$orderDetailParams = this parameter is ok $finalize = can you explain this parameter? $includeShipment = i think shippings costs are captured? so i set this parameter only to true in first caputre?
Hi, Set $finalize to true if you capture the full amount of all order postitions or on your last capture in case of multiple partial captures (corresponds to "Finaler Geldeinzug" when you do the capture manually via the backend). When capturing partial amounts this parameter is set to false. (corresponds to "Teil- Geldeinzug in the backend). Set $includeShipment to true to capture including shipment costs. Set $includeShipment to false in case the shipping costs have their own order position. You do not have to use includeShipment on the first capture, just remember to set it to true in one of your capture request. Hope this clarifies things a bit.
thanks a lot!
Hi, it would be nice, if we can get two public available function (over your plugin Bootstrap.php) to refund or capture values.