Skip to content

Commit

Permalink
Merge branch 'pre-1.7.9.1' into pre-1.7.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ponddeja committed Sep 26, 2024
2 parents 35a81ac + 11b4509 commit 7ad34c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
7 changes: 0 additions & 7 deletions includes/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1096,13 +1096,6 @@ public function get_reepay_cards( string $customer_handle, $reepay_token = null

$result = $tmp;

wc_get_logger()->debug(
array(
'source' => 'billwerk-token',
'_legacy' => true,
)
);

if ( ! $reepay_token ) {
return $result['cards'];
}
Expand Down
7 changes: 5 additions & 2 deletions includes/Gateways/ReepayGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ public function process_payment( $order_id ) {
return $this->process_session_charge( $params, $order );
} else {
$order_lines = 'no' === $this->skip_order_lines ? $this->get_order_items( $order ) : null;
$amount = 'yes' === $this->skip_order_lines ? $this->get_skip_order_lines_amount( $order ) : null;
$amount = 'yes' === $this->skip_order_lines ? $this->get_skip_order_lines_amount( $order, true ) : null;

// Charge payment.
$result = reepay()->api( $this )->charge( $order, $token->get_token(), $amount, $order_lines );
Expand Down Expand Up @@ -1582,8 +1582,9 @@ public function get_order_items( WC_Order $order, bool $only_not_settled = false
* Get order amount from order item amount
*
* @param WC_Order $order order to get items.
* @param bool $skip_fn_rp_amount skip call funcion rp_prepare_amount.
*/
public function get_skip_order_lines_amount( WC_Order $order ) {
public function get_skip_order_lines_amount( WC_Order $order, $skip_fn_rp_amount = false ) {
$total_amount = 0;

if ( wcs_cart_have_subscription() ) {
Expand All @@ -1593,6 +1594,8 @@ public function get_skip_order_lines_amount( WC_Order $order ) {
$total_amount += $item['amount'];
}
}
} elseif ( true === $skip_fn_rp_amount ) {
$total_amount = $order->get_total();
} else {
$total_amount = rp_prepare_amount( $order->get_total(), $order->get_currency() );
}
Expand Down

0 comments on commit 7ad34c0

Please sign in to comment.