/** * Get the plugin url * * @since 1.1 * @return string */ public static function plugin_url() { if (self::$plugin_url) { return self::$plugin_url; } return self::$plugin_url = untrailingslashit(plugins_url('/', __FILE__)); }
/** * Will generate the Payment Types html for iPay88 Malaysia. */ function get_my_gateway_payment_types_html() { if (!empty($this->paymenttype_available)) { ?> <p class="form-row"> <label for="ipay88_payment_type"><?php _e('Payment Type', 'wc_ipay88'); ?> <span class="required">*</span></label> </p> <?php $credit_options = array('2'); if ((bool) array_intersect($credit_options, $this->paymenttype_available)) { echo '<div class="ipay88_credit_card ipay88_opt_container" >'; if ('yes' == $this->use_css) { echo '<p class="ipay88_title_opt">' . __('Credit/Debit Card', 'wc_ipay88') . '</p>'; } foreach ($credit_options as $number) { if (in_array($number, $this->paymenttype_available)) { echo '<p style="margin-bottom:5px;">'; echo '<input type="radio" id="ipay88' . $this->types_mapping['id'][$number] . '"'; echo 'name="ipay88_payment_type" value="' . $number . '">'; echo '<label for="ipay88' . $this->types_mapping['id'][$number] . '">'; echo '<img alt="' . $this->paymenttype_options[$number] . '" src="' . WC_Compat_iPay88::force_https(WC_iPay88::plugin_url()) . '/assets/images/' . $this->types_mapping['image'][$number] . '.' . $this->image_ext . '">'; echo '</label>'; echo '</p>'; } } echo '</div>'; } $bank_transfer_options = array('6', '8', '10', '14', '15', '16', '20', '103'); if ((bool) array_intersect($bank_transfer_options, $this->paymenttype_available)) { echo '<div class="ipay88_online_bank_transfer ipay88_opt_container" >'; if ('yes' == $this->use_css) { echo '<p class="ipay88_title_opt">' . __('Online Bank Transfer', 'wc_ipay88') . '</p>'; } foreach ($bank_transfer_options as $number) { if (in_array($number, $this->paymenttype_available)) { echo '<p style="margin-bottom:5px;">'; echo '<input type="radio" id="ipay88' . $this->types_mapping['id'][$number] . '"'; echo 'name="ipay88_payment_type" value="' . $number . '">'; echo '<label for="ipay88' . $this->types_mapping['id'][$number] . '">'; echo '<img alt="' . $this->paymenttype_options[$number] . '" src="' . WC_Compat_iPay88::force_https(WC_iPay88::plugin_url()) . '/assets/images/' . $this->types_mapping['image'][$number] . '.' . $this->image_ext . '">'; echo '</label>'; echo '</p>'; } } echo '</div>'; } $other_options = array('17', '22', '23', '33'); if ((bool) array_intersect($other_options, $this->paymenttype_available)) { echo '<div class="ipay88_other_options ipay88_opt_container" >'; if ('yes' == $this->use_css) { echo '<p class="ipay88_title_opt">' . __('Other Options', 'wc_ipay88') . '</p>'; } foreach ($other_options as $number) { if (in_array($number, $this->paymenttype_available)) { echo '<p style="margin-bottom:5px;">'; echo '<input type="radio" id="ipay88' . $this->types_mapping['id'][$number] . '"'; echo 'name="ipay88_payment_type" value="' . $number . '">'; echo '<label for="ipay88' . $this->types_mapping['id'][$number] . '">'; echo '<img alt="' . $this->paymenttype_options[$number] . '" src="' . WC_Compat_iPay88::force_https(WC_iPay88::plugin_url()) . '/assets/images/' . $this->types_mapping['image'][$number] . '.' . $this->image_ext . '">'; echo '</label>'; echo '</p>'; } } echo '</div>'; } } }