@@ -604,7 +604,7 @@ public function capture(InfoInterface $payment, $amount)
604
604
if ($ result ->success ) {
605
605
$ payment ->setIsTransactionClosed (false )
606
606
->setShouldCloseParentTransaction (false );
607
- if ($ this -> isFinalCapture ( $ payment ->getParentId (), $ amount )) {
607
+ if ($ payment ->isCaptureFinal ( $ amount )) {
608
608
$ payment ->setShouldCloseParentTransaction (true );
609
609
}
610
610
} else {
@@ -905,7 +905,7 @@ protected function processSuccessResult(
905
905
->setAdditionalInformation ($ this ->getExtraTransactionInformation ($ result ->transaction ))
906
906
->setAmount ($ amount )
907
907
->setShouldCloseParentTransaction (false );
908
- if ($ this -> isFinalCapture ( $ payment ->getParentId (), $ amount )) {
908
+ if ($ payment ->isCaptureFinal ( $ amount )) {
909
909
$ payment ->setShouldCloseParentTransaction (true );
910
910
}
911
911
if (isset ($ result ->transaction ->creditCard ['token ' ]) && $ result ->transaction ->creditCard ['token ' ]) {
@@ -964,21 +964,4 @@ protected function _convertObjToArray($data)
964
964
{
965
965
return json_decode (json_encode ($ data ), true );
966
966
}
967
-
968
- /**
969
- * Checks whether the capture is final
970
- *
971
- * @param string $orderId
972
- * @param string $amount
973
- * @return bool
974
- */
975
- protected function isFinalCapture ($ orderId , $ amount )
976
- {
977
- if (!empty ($ orderId )) {
978
- $ order = $ this ->orderRepository ->get ($ orderId );
979
- return (float )$ order ->getTotalDue () === (float ) $ amount ;
980
- }
981
-
982
- return false ;
983
- }
984
967
}
0 commit comments