What code do you have right now for sending the start and issue data ?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Just modified the Payflow Pro module with some addiditons. this is the part for sending to paypal:
Code:// ORDER INFO 'ACCT' => $order->info['cc_number'], 'CARDSTART' => $order->info['cc_starts'], 'CARDISSUE' => $order->info['cc_issue'], 'EXPDATE' => $order->info['cc_expires'], 'CVV2' => $order->info['cc_cvv'], 'AMT' => number_format($order->info['total'], 2,'.',''), 'CURRENCY'=> $my_currency, 'COMMENT1'=> "( ".$_SESSION['cart']->count_contents(). " ) ". str_replace('&','',$order->info['comments']) , 'COMMENT2'=> $order->info['shipping_method']. $order->info['shipping_cost']. ' ZenSessName:' . zen_session_name(). ' ZenSessID:' . zen_session_id(), 'INVNUM' => 'Cust:' . $_SESSION['customer_id'] . ' Order:' . $new_order_id , 'CUSTREF' => 'Order:' . $new_order_id .'_Cust:' . $_SESSION['customer_id'] . '_Time:' . microtime(),
here's the bit with additions for form fields, guess this is where it needs modifying?
Code://////////////////////////////////////////////////// // !Form fields for user input // Output any required information in form fields // Examples: ask for extra fields (credit card number), display extra information //////////////////////////////////////////////////// // Display Credit Card Information Submission Fields on the Checkout Payment Page function selection() { global $order; for ($i=1; $i<13; $i++) { $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)) . ' (' . $i . ')'); } $today = getdate(); for ($i=$today['year']; $i < $today['year']+10; $i++) { $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); } //////////////////////////////////////////////////////// ///addition of start date stuff for ($i=1; $i<13; $i++) { $starts_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)) . ' (' . $i . ')'); } $today = getdate(); for ($i=$today['year'];$i > $today['year']-10; $i--) { $starts_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i))); } ///end of addition ///////////////////////////////////////////////////////////// $selection = array( 'id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_OWNER_NAME, 'field' => zen_draw_input_field('payflowpro_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_NUMBER, 'field' => zen_draw_input_field('payflowpro_cc_number')), array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_EXPIRES, 'field' => zen_draw_pull_down_menu('payflowpro_cc_expires_month', $expires_month) . ' ' . zen_draw_pull_down_menu('payflowpro_cc_expires_year', $expires_year)), array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC . ' ' . MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_CSC_TEXT, 'field' => zen_draw_input_field('payflowpro_cc_csc','','SIZE="4" MAXLENGTH="4"')), //////////////////////////////////////////////////////// ///addition of start date stuff array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_STARTS, 'field' => zen_draw_pull_down_menu('payflowpro_cc_starts_month', $starts_month) . ' ' . zen_draw_pull_down_menu('payflowpro_cc_starts_year', $starts_year)), array('title' => MODULE_PAYMENT_PAYFLOWPRO_TEXT_CREDIT_CARD_ISSUE, 'field' => zen_draw_input_field('payflowpro_cc_issue','','SIZE="1" MAXLENGTH="1"')))); ///end of addition ///////////////////////////////////////////////////////////// return $selection; }
This is dealing with data being submitted, regardless of user input, thus the form fields have nothing to do with it.
You need to read the submitted data, sanitize it, and then submit it.
I'm not sure that it's best to dump the start and issue details into the $order array, but, keeping with what you've got, try changing this:
to:Code:$order->info['cc_starts'] = $_POST['cc_starts']; $order->info['cc_issue'] = $_POST['cc_issue'];
That says, if $_POST['cc_issue'] is blank, then set $order->info['cc_issue'] to '00'. Otherwise, set it to whatever was submitted.Code:$order->info['cc_starts'] = ($_POST['cc_starts'] == '') ? '00' : $_POST['cc_starts']; $order->info['cc_issue'] = ($_POST['cc_issue'] == '') ? '00' : $_POST['cc_issue'];;
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
By the way ... I have no idea if adding these fields is gonna bust visa and mastercard now ...
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Thanks for the code - Just tried with both Visa and Switch and it works. (just added the issue one, left the start date one as it has a value as i'm using drop downs)
I guess that when using Visa it just ignores the start and issue fields.
Now the next task (whilst waiting for Paypal to sort out the postal code problem) is to hide the Start date and Issue fields if its not a Debit card.
Would this be best accomplished by using the CC validation module, i see that it looks for the first 6 digits for queries, therefore do you think there is an easy way to add in a query using the card Type, to then display the fields when needed/ or hide when not, or does this query not take place until the continue button is pushed?
Apologies if this seems really obvious.
Thanks
Re: hiding debit card fields if not using debit card .... you can't, without another round of coding ;)
Scenario:
Take a look at the payment screen as you have it now ... tell me ... how do we ask the customer whether they're using a debit card or not ?
Exactly - it doesn't.
To do that would require adding a pulldown menu from which to select credit card type. Then, based on that, hide/display the start/issue fields using javascript. Then validate that the CC type selected matches the type determined from the CC number itself. Then submit the data if it passes validation and sanitization.
How do I know this ? Cuz I've been working on a new payflow module to handle this using a less-quirky infrastructure base. However, it's not quite ready for prime time yet...
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Your just teasing now!
Is this the module to be included in the next realease that everyone is talking about, or a seperate contribution?
Reason i ask , i'm just trying to make an informed decision as to whther to press on and give it a go myself, or sit back for a little while and wait for you to do all the hard work! Is it worth me holding off and waiting?
If you need it now, carry on.
I have no committed date for the updated code to be completed or ready for formal testing. It could be a month or two, maybe more, I don't know.
If you don't mind leaving the fields visible, you could just change the descriptive text around them to explain when/why/how they're needed, and just let the customer decide...
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.