Skip to content

Commit

Permalink
fix: code climate PaymentProcessor.php issues
Browse files Browse the repository at this point in the history
  • Loading branch information
devaguia committed Jan 4, 2024
1 parent f570ea6 commit c25f2ff
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/utils/PaymentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ public function process_order()
$product = $order_item->get_product();

if ($this->is_subscription_type($product)) {
$product_id = $product->id;

if ($this->is_variable($product)) {
$product_id = $order_item['variation_id'];
}

$period = $product->get_meta('_subscription_period', true);
$interval = $product->get_meta('_subscription_period_interval', true);
$subscriptions_grouped_by_period[$period . $interval][] = $order_item;
Expand Down Expand Up @@ -318,7 +312,7 @@ public function process_order()
$bills[] = $subscription['bill'];

$message = $this->cancel_if_denied_bill_status($subscription['bill']);

if ($message) {
throw new Exception($message);
}
Expand All @@ -338,7 +332,8 @@ public function process_order()
$order_post_meta['single_payment']['bill'] = $this->create_bill_meta_for_order($single_payment_bill);
$bills[] = $single_payment_bill;

if ($message = $this->cancel_if_denied_bill_status($single_payment_bill)) {
$message = $this->cancel_if_denied_bill_status($single_payment_bill);
if ($message) {
$this->order->update_status('cancelled', __($message, VINDI));

if ($subscriptions_ids) {
Expand Down

0 comments on commit c25f2ff

Please sign in to comment.