Thread: custom payment

Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Posts
    8
    Plugin Contributions
    0

    Default Re: custom payment

    okay, here is what I have so far...

    << function process_button() {

    global $_SERVER, $order;



    $sequence = rand(1, 1000);

    $process_button_string = zen_draw_hidden_field('x_Login', MODULE_PAYMENT_WTF_LOGIN) .

    zen_draw_hidden_field('x_Card_Num', $this->cc_card_number) .

    zen_draw_hidden_field('x_Exp_Date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .

    zen_draw_hidden_field('x_Amount', number_format($order->info['total'], 2)) .


    // zen_draw_hidden_field('x_currency_code', $_SESSION['currency']) .




    zen_draw_hidden_field('x_Cust_ID', $_SESSION['customer_id']) .

    zen_draw_hidden_field('x_first_name', $order->billing['firstname']) .

    zen_draw_hidden_field('x_last_name', $order->billing['lastname']) .>>


    and so on. then we have:


    << return $process_button_string;>>

    okay, so I should be able to write in something like....


    zen_draw_hidden_field('x_name', $order->products['name']) .
    zen_draw_hidden_field('x_model', $order->products['model']) .

    to get all of my happy product names/model numbers.

    except that I need a loop to get all of the products and this product array in order.php has an index number and i'm now trying to figure out the syntax I need to pull that data.

    beautiful. lovely. gorgeous.

    (sotto voce muttering)

    <officeSpaceBoss> um... yeah </officeSpaceBoss>
    Last edited by redtoad; 18 Dec 2006 at 11:14 PM. Reason: clarity

  2. #2
    Join Date
    Nov 2006
    Posts
    8
    Plugin Contributions
    0

    Default Re: custom payment

    if anyone could help me with the syntax i would greatly appreciate it. If I've been unclear, let me know.

  3. #3
    Join Date
    Nov 2006
    Posts
    8
    Plugin Contributions
    0

    Default Re: custom payment

    never mind, I figured it out, was flipping back and forth between pages and got confused, this is just a loop. I get it.

    sorry, my head is gonna explode.

  4. #4
    Join Date
    Nov 2006
    Posts
    8
    Plugin Contributions
    0

    Default Re: custom payment

    okay, here is my issue.

    apparently the cart writes this prod info to the db after I run my form handler. but it clears the session before I run my form handler.

    so I have to write this prod info to the process button string. okay. fine.

    so the product info is in an array and has a loop.

    this is where my novice php is killing me.

    how the heck to I make a loop that pulls the data from the cart session and writes it to a hidden form field?

    I've got:

    $counter=0;
    $products = $_SESSION['cart']->get_products();

    for ($i=0, $n=sizeof($products); $i<$n; $i++){

    $this->products[$counter] = array('qty' => $products[$i]['quantity'],


    'name' => $products[$i]['name'],

    'model' => $products[$i]['model'],

    'tax' => zen_get_tax_rate($products[$i]['tax_class_id'], $tax_address->fields['entry_country_id'], $tax_address->fields['entry_zone_id']));


    $prodname = $this->products[$i]['name'];
    $prodqty = $this->products[$i]['qty'];
    $prodmodel = $this->products[$i]['model'];
    //this is where the $prodname, $prodqty, and $prodmodels should be assigned to go into the process button string ?????? HELP???????

    $counter++;

    }


    $process_button_string = zen_draw_hidden_field('x_Login', MODULE_PAYMENT_WTF_LOGIN) .

    zen_draw_hidden_field('x_Card_Num', $this->cc_card_number) .

    zen_draw_hidden_field('x_Exp_Date', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .

    zen_draw_hidden_field('x_Amount', number_format($order->info['total'], 2)) .


    // zen_draw_hidden_field('x_currency_code', $_SESSION['currency']) .

    zen_draw_hidden_field('x_Cust_ID', $_SESSION['customer_id']) .

    zen_draw_hidden_field('x_first_name', $order->billing['firstname']) .

    zen_draw_hidden_field('x_last_name', $order->billing['lastname']) .

    zen_draw_hidden_field('x_address', $order->billing['street_address']) .

    zen_draw_hidden_field('x_city', $order->billing['city']) .

    zen_draw_hidden_field('x_state', $order->billing['state']) .

    zen_draw_hidden_field('x_zip', $order->billing['postcode']) .

    zen_draw_hidden_field('x_country', $order->billing['country']['title']) .

    zen_draw_hidden_field('x_phone', $order->customer['telephone']) .

    zen_draw_hidden_field('x_email', $order->customer['email_address']) .
    zen_draw_hidden_field('x_ship_to_first_name', $order->delivery['firstname']) .

    zen_draw_hidden_field('x_ship_to_last_name', $order->delivery['lastname']) .

    zen_draw_hidden_field('x_ship_to_address', $order->delivery['street_address']) .

    zen_draw_hidden_field('x_ship_to_city', $order->delivery['city']) .

    zen_draw_hidden_field('x_ship_to_state', $order->delivery['state']) .

    zen_draw_hidden_field('x_ship_to_zip', $order->delivery['postcode']) .

    zen_draw_hidden_field('x_ship_to_country', $order->delivery['country']['title']) .

    zen_draw_hidden_field('x_Customer_IP', $_SERVER['REMOTE_ADDR']) .

    $process_button_string .= zen_draw_hidden_field(zen_session_name(), zen_session_id());



    return $process_button_string;

    }

  5. #5
    Join Date
    Nov 2006
    Posts
    8
    Plugin Contributions
    0

    Default Re: custom payment

    I'm posting my solution as a courtesy for anyone who struggles with similar issues ever.

    what I ended up doing (and I know there is probably a better way to do it but hey... I've fought this long enough and arrays make me seasick) ...what I ended up doing was making a couple of loops to loop through the product array and then form one long string with the qty, model number and description that I loaded into ONE variable and then appended to my process button string. it works as I can tear the product string itself apart on the other end myself because I'm making a form handler. whee.

    eta: oh and if you ever need the extra data, you can grab it by studying order.php in the classes folder. It has it ALL there.

    cheers.

 

 

Similar Threads

  1. Custom payment option?
    By sim8729 in forum PayPal Website Payments Pro support
    Replies: 1
    Last Post: 26 Sep 2012, 04:26 PM
  2. Custom Payment Module
    By shocker in forum Addon Payment Modules
    Replies: 8
    Last Post: 21 Dec 2008, 08:31 PM
  3. Custom Payment Module
    By DiZZ in forum General Questions
    Replies: 0
    Last Post: 2 Oct 2007, 05:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg