Skip to content

Commit

Permalink
feat: alternate pix and billet info
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaMelazzo committed Feb 5, 2024
1 parent bd13118 commit 6c697fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Gateway/Transaction/Base/Command/InitializeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,9 @@ private function doCoreDetour($payment)
if (!$isSubscription) {
$orderService = new OrderService();
$pagarmeOrder = current($orderService->createOrderAtPagarme($orderDecorator));
if (!is_null($pagarmeOrder->getPixOrBilletTransaction())) {
$this->checkoutSession->setPixOrBilletTransaction($pagarmeOrder->getPixOrBilletTransaction());
$transaction = $pagarmeOrder->getPixOrBilletTransaction();
if (!is_null($transaction)) {
$this->checkoutSession->setPixOrBilletTransaction($transaction);
}
}

Expand Down
4 changes: 4 additions & 0 deletions Helper/Payment/Billet.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ private function getBoletoLinkFromOrder($info, $transaction = null)
return $transaction->getBoletoUrl();
}

if (!$orderId) {
return null;
}

$orderRepository = new OrderRepository();
$order = $orderRepository->findByPagarmeId(new OrderId($orderId));

Expand Down

0 comments on commit 6c697fd

Please sign in to comment.