Skip to content

Commit

Permalink
fix: codeclimate issues
Browse files Browse the repository at this point in the history
  • Loading branch information
devaguia committed Mar 7, 2024
1 parent f8b0f0f commit 304f0ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1121,15 +1121,16 @@ protected function create_bill_meta_for_order($bill)

if (isset($bill['charges']) && count($bill['charges'])) {
$charges = end($bill['charges']);

$bill_meta['bank_slip_url'] = $charges['print_url'] ?? '';
if ($this->payment_method_code() === 'pix' && isset($charges['last_transaction']['gateway_response_fields'])) {
$transaction = $charges['last_transaction']['gateway_response_fields'];

$bill_meta['charge_id'] = $charges['id'];
$bill_meta['pix_expiration'] = $transaction['max_days_to_keep_waiting_payment'];
$bill_meta['pix_code'] = $transaction['qrcode_original_path'];
$bill_meta['pix_qr'] = $transaction['qrcode_path'];
} else {
$bill_meta['bank_slip_url'] = $charges['print_url'];
unset($bill_meta['bank_slip_url']);
}
}
return $bill_meta;
Expand Down

0 comments on commit 304f0ee

Please sign in to comment.