cart = WC()->cart; $this->total_price = floatval(WC()->cart->total); } $account = PayplugWoocommerceHelper::get_account_data_from_options(); $oney_settings = $this->gateway->get_configuration()->get_option('payment_methods.configuration.oney'); $country = PayplugWoocommerceHelper::getISOCountryCode(); $mapper = OneyAccountMapper::map((array) $account, $oney_settings, $country); $fee_mode = !empty($oney_settings['with_fees']) ? 'with_fees' : 'without_fees'; if (PayplugWoocommerceHelper::is_cart_block() && is_cart() && !PayplugWoocommerceHelper::is_subscription()) { $data['oney_cart_label'] = __('OR PAY IN', 'payplug'); if ('with_fees' === $fee_mode) { $data['oney_cart_logo'] = esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/lg-3x4xoney.png'); } else { $data['oney_cart_logo'] = esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/Oneywithoutfees3x4x.png'); } } $data['icon'] = [ 'src' => esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $this->icon), 'class' => 'payplug-payment-icon', 'alt' => $this->gateway->title, ]; $data['description'] = $this->gateway->description; $data['currency'] = get_woocommerce_currency_symbol(get_option('woocommerce_currency')); $data['allowed_country_codes'] = $this->gateway->allowed_country_codes; $data['oney_widget'] = [ 'merchant_guid' => $mapper->get_merchant_guid(), 'business_transaction_code' => $mapper->business_transaction_code_for_gateway($this->gateway->id), 'business_transaction_codes' => $mapper->business_transaction_codes($fee_mode), 'country' => $country, 'language' => strtoupper(substr(get_locale(), 0, 2)), 'payment_amount' => $this->total_price, ]; $oney_amount = json_decode($oney_settings['custom_amounts'], true); $data['requirements'] = [ 'max_quantity' => $this->gateway::ONEY_PRODUCT_QUANTITY_MAXIMUM, 'min_threshold' => $oney_amount['min'], 'max_threshold' => $oney_amount['max'], 'allowed_country_codes' => $this->gateway->allowed_country_codes, ]; return $data; } }