Bank Payment Form Plugin modification

  • Trina B
    Trina B
    Newbie 76 points
    September 1, 2015 at 8:51 pm

    Hi There,

    I need to make a small modification to the Bank Payment Form Plugin, this plugin will let you add your bank details for the user to pay you manually.

    I want to erase the Listing Price next to the title. (Payment Options).

    What changes should I make in the plugin code to make this change?

    <?php
    /*
    Plugin Name: [PAYMENT GATEWAY] – Bank Payment Form
    Plugin URI: https://www.premiumpress.com
    Description: This plugin will let you add your bank details for the user to pay you manually.
    Version: 1.1
    Author: Mark Fail
    Author URI: https://www.premiumpress.com
    Updated: Feb 10th 2014
    License:
    */

    //1. HOOK INTO THE GATEWAY ARRAY
    function wlt_gateway_bank_admin($gateways){
    $nId = count($gateways)+1;
    $gateways[$nId][‘name’] = “Bank Details Form”;
    $gateways[$nId][‘logo’] = plugins_url().”/wlt_gateway_bank/img/icon.jpg”;
    $gateways[$nId][‘function’] = “wlt_gateway_bank_form”;
    $gateways[$nId][‘website’] = “https://www.premiumpress.com”;
    $gateways[$nId][‘callback’] = “yes”;
    $gateways[$nId][‘ownform’] = “yes”;
    $gateways[$nId][‘notes’] = “The bank details you enter above will be displayed to the user where payment is required. They will need to go to their bank and deposit the funds into your account manually and once you have confirmed payment you’ll need to update their listing/account manually.”;
    $gateways[$nId][‘fields’] = array(

    ‘1’ => array(‘name’ => ‘Enable Gateway’, ‘type’ => ‘listbox’,’fieldname’ => $gateways[$nId][‘function’],’list’ => array(‘yes’=>’Enable’,’no’=>’Disable’,) ),
    ‘2’ => array(‘name’ => ‘Bank Details’, ‘type’ => ‘textarea’, ‘fieldname’ => ‘bank_details’),

    );

    return $gateways;
    }
    add_action(‘hook_payments_gateways’,’wlt_gateway_bank_admin’);

    //2. BUILD THE PAYMENT FORM DATA
    function wlt_gateway_bank_form($data=””){

    global $wpdb, $CORE, $userdata;

    $gatewaycode = wpautop(stripslashes(get_option(‘bank_details’)));

    if(isset($GLOBALS[‘flag-checkout’])){
    $gatewaycode .= ‘<form style=”width:200px; float:left;” method=”post” action=”‘.$GLOBALS[‘CORE_THEME’][‘links’][‘callback’].’”>
    <input type=”hidden” name=”mc_gross” value=”‘.$GLOBALS[‘global_cart_data’][‘total’] .’” />
    <input type=”hidden” name=”custom” value=”CART-‘.$GLOBALS[‘global_cart_data’][‘session’] .’” />
    <input type=”hidden” name=”payment_status” value=”Completed” />
    <input type=”hidden” name=”c_currency” value=”‘.$GLOBALS[‘CORE_THEME’][‘currency’][‘code’].’” />
    <input type=”hidden” name=”txn_id” value=”123567′.time().’” />
    <input type=”hidden” name=”payer_email” value=”‘.$userdata->user_email.’” />’;

    if(isset($GLOBALS[‘global_cart_data’][‘items’]) && is_array($GLOBALS[‘global_cart_data’][‘items’])){
    // BUILD PAYPAL CART DATA
    $i=1;
    foreach($GLOBALS[‘global_cart_data’][‘items’] as $key=>$inneritem){
    foreach($inneritem as $item){

    $name = $item[‘name’];
    if(strlen($item[‘custom’]) > 1){ $name .= “-“.$item[‘custom’]; }
    $gatewaycode .='<input type=”hidden” name=”item_name_’.$i.’” value=”‘.trim(strip_tags($name)).’”>
    <input type=”hidden” name=”amount_’.$i.’” value=”‘.trim($item[‘amount’]).’”>
    <input type=”hidden” name=”quantity_’.$i.’” value=”‘.$item[‘qty’].’”>’;
    $i++;
    }
    }

    }else{
    $gatewaycode .= ‘<input type=”hidden” name=”item_name” value=”‘.strip_tags($GLOBALS[‘description’]).’”>’;
    }

    $gatewaycode .= ‘<button class=”btn btn-primary” type=”submit”>’.$CORE->_e(array(‘checkout’,’32’)).'</button></form>’;
    }

    return $gatewaycode;

    }

    // 3. HANDLE THE CALLBACK FROM PAYPAL PRO
    function _process_bank(){ global $CORE, $wpdb, $userdata;

    }
    add_action(‘init’,’_process_bank’);
    ?>

    Attachments:
    You must be logged in to view attached files.
  • Errol
    Errol
    Super Guru 2,708 points
    September 1, 2015 at 9:18 pm

    The available Plugins for the themes are usually developed by the PP team – opening a ticket to get a more secured answer would be best for such Q&A.

    This reply was awarded the best answer by the topic poster.
  • Errol
    Errol
    Super Guru 2,708 points
    September 1, 2015 at 9:32 pm

    🙂

Viewing 3 posts - 1 through 3 (of 3 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes