payment_gateways() public method

Get gateways.
public payment_gateways ( ) : array
return array
Esempio n. 1
0
        function wcpgsk_payments_form()
        {
            global $post;
            //, $woo;
            $postPayments = get_metadata('post', $post->ID, 'payment_gateways', false);
            $woogate = new WC_Payment_Gateways();
            $payments = $woogate->payment_gateways();
            //get_available_payment_gateways();
            foreach ($payments as $pay) {
                $checked = '';
                if (in_array($pay->id, $postPayments)) {
                    $checked = ' checked="yes" ';
                }
                ?>
  
				<input type="checkbox" <?php 
                echo $checked;
                ?>
 value="<?php 
                echo $pay->id;
                ?>
" name="pays[]" id="payments" />
				<label for="payment_gateway_meta_box_text"><?php 
                echo $pay->title;
                ?>
</label>  
				<br />  
			<?php 
            }
        }
                    </tr>

                    <!------------------------------------------------------------------ Payment Mapping Wc_to_Vend---------------------------------------->
                    <tr valign="top">
                        <th  class="titledesc">Payment mapping<a href="https://www.linksync.com/help/woocommerce"><img title="When syncing orders, both Vend and WooCommerce have their own payment methods - use these Payment Mapping settings to 'map' the Vend payment methods with those in your WooCommerce store." style="margin-bottom: -4px;margin-left: 4px;" src="../wp-content/plugins/linksync/img/help.png" height="16" width="16"></a> </th>
                        <td class="forminp forminp-checkbox">
                            <?php 
#Check for the Payment
if (isset($payment) && !empty($payment)) {
    if (!isset($payment['errorCode'])) {
        if (isset($payment['paymentTypes'])) {
            ?>
                                        <?php 
            $payment_wc_to_vend = get_option('wc_to_vend_payment');
            $wc_to_vend_payment = explode(',', $payment_wc_to_vend);
            $payment_gatways = $gatway->payment_gateways();
            ?>
<ul><legend style="display: inline-block;width: 20em; float: left"> <b>WooCommerce Payment Gateways</b></legend>   <legend style="display: inline-block;width: 3em; float: left">=></legend>  <legend style="display: inline-block;width: 25em; "><b>Vend Payment</b></legend><br>
                                        <?php 
            foreach ($payment_gatways as $gatways) {
                if ($gatways->enabled == 'yes') {
                    ?>
 <li> <legend style="display: inline-block;width: 20em; float: left">
                                                        <?php 
                    echo $gatways->title;
                    ?>
</legend>    <legend style="display: inline-block;width: 3em; float: left">=></legend> 
                                                    <legend style="display: inline-block;width: 25em; "><select style="margin-top: -5px" name="wc_to_vend_payment[]">
                                                            <?php 
                    foreach ($payment['paymentTypes'] as $payment_mapping) {
                        if (in_array($payment_mapping['name'] . "%%" . $payment_mapping['id'] . '|' . $gatways->title . '|' . $gatways->id, $wc_to_vend_payment)) {