Skip to content

Commit

Permalink
PayReminder for Paypal
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroensmit committed Mar 25, 2021
1 parent 2d66c05 commit aa24fd0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Model/Method/Paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,19 @@ public function getOrderTransactionBuilder($payment)
{
$transactionBuilder = $this->transactionBuilderFactory->get('order');

$serviceAction = 'Pay';
if($originalTransactionKey = $this->helper->getOriginalTransactionKey($payment->getOrder()->getIncrementId())){
$serviceAction = 'PayRemainder';
$transactionBuilder->setOriginalTransactionKey($originalTransactionKey);

if($alreadyPaid = $this->helper->getBuckarooAlreadyPaid($payment->getOrder()->getIncrementId())){
$transactionBuilder->setAmount($transactionBuilder->getAmount() - $alreadyPaid);
}
}

$services = [
'Name' => 'paypal',
'Action' => 'Pay',
'Action' => $serviceAction,
'Version' => 1,
'RequestParameter' => [],
];
Expand Down

0 comments on commit aa24fd0

Please sign in to comment.