Forums / Addon Payment Modules / Payflow pro Module- Uk Debit Card issue with issue dates

Payflow pro Module- Uk Debit Card issue with issue dates

Locked

Started by calljj on 28 Mar 2007, 2:58 PM · Views: 11,867

Results 1 to 20 of 28
This thread is locked. New replies are disabled.
28 Mar 2007, 2:58 PM
#1
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Payflow pro Module- Uk Debit Card issue with issue dates

Installed latest payflow Module in Zen 1.3.7.

Installed no probs
I also have the latest express and patch installed and IPN also (intend just running payflow and IPN without the agro of express as too many options seem to confuse most people!), but have "switched off" the Express module for the moment.

Created SSL cert from paypal and placed in folder and placed file path in payflow module.

Did a test purchase with my own Visa card, and worked straight away.
Did a test purchase with my own Switch debitcard and it keeps coming up with the warning bar saying the expiration date is invalid?

Noticed that none of the test card numbers in the module include switch cards.

All card types are switched on in Admin.
No zoning restrictions on any payment methods.

Checked my includes/classes/cc_validation.php to see what cards are supported, and Switch/maestro e.t.c are all there.

Has anyone else found this problem?

Thanks for the module, and in advance for any help.

J

28 Mar 2007, 4:00 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Switch and Maestro are very inconsistent in the way they handle Start Date and Issue Number etc data.
There is a growing recommendation from PayPal to not pre-validate this information, and instead simply pass all the known information to PayPal so they can pass it to the actual CC company for verification instead of validating it on your site on the same screen where the customer entered the information.

In that light, you could simply bypass the date-validations in cc_validation.php, by adding two lines, like this:```
if ($expiry_y == $current_year) {
if ($expiry_m < date('n')) {
return -4;
}
}
[B]/*[/B]
// check the issue month & year but only for Switch/Solo cards
if (($start_m || $start_y) && in_array($this->cc_type, array('Switch', 'Solo'))) {
if (!(is_numeric($start_m) && ($start_m > 0) && ($start_m < 13))) {
return -2;
}

  if (strlen($start_y) == 2) {
    if ($start_y > 80) {
      $start_y = '19' . $start_y;
    } else {
      $start_y = '20' . $start_y;
    }
  }

  if (!is_numeric($start_y) || ($start_y > $current_year)) {
    return -3;
  }
  if (!($start_y >= ($current_year - 10))) {
    return -3;
  }
}

[B]*/[/B]
return $this->is_valid();
}

.
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.

28 Mar 2007, 5:13 PM
#3
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Wow, thanks for the speedy reply. I'll try that and get back!

Also, should the payflow module realise its a Switch card by the first 6 digits and then automatically show the extra fields for issue number/start date that are usually required for these cards?

Thanks

J

28 Mar 2007, 5:32 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Calljj:

Also, should the payflow module realise its a Switch card by the first 6 digits and then automatically show the extra fields for issue number/start date that are usually required for these cards?
No, that's not a built-in feature. You will have to custom-code that if you wish to have that behaviour.

.
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.

28 Mar 2007, 5:45 PM
#5
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Looks like I'll have to start work on that code to add the extra fields ( this should be a laugh:shocking: from somene never playing with php!)

The module now accepts the switch data, but seems paypal is asking for more, as when hitting the confirmation button I get a yellow band at the top warning:

Result code: 7: Field format error: CARDSTART or CARDISSUE must be present
There has been an error processing your credit card, please try again.

28 Mar 2007, 8:04 PM
#6
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Well, if anyone interested I have had a play with the great Payflow Module, and added the fields of start date and issue number in order to accept UK debit cards.

All works fine, passing the details across, however, problem is i've now got another issue, that funnily enough happens EXACTLY the same as when using my Switch card through paypal's virtual terminal...it comes back with the error

Result code: 112: Failed AVS Check: 10505-This transaction cannot be processed.
There has been an error processing your credit card, please try again.

Which is related to the address check for the card.

I wrote to paypal yesterday, using an email address from their site, only to have it bounce back...great!

I've logged a support ticket so we'll see what they come back with.

29 Mar 2007, 8:13 PM
#7
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Anyone Know whether its possible to log the request that gets sent to paypal from this module...i've actually got someone from paypal actively looking at this...incredible!:yes:

30 Mar 2007, 8:51 AM
#8
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Well, no-one is replying, but i'll keep adding my findings in case this if of help to others who are having problems.

In the payflowpro.php under includes/modules/payment there is an option to set debug = on.

If you get a failure this will email you (the store owner address) with the details of the failure, i.e failure code from merchant, details that were sent to merchant e.t.c

I sent a copy of this output to paypal, who reported that they had noticed there was an extra zero in the postcode. huh? Many UK post codes are of the format, SO30 3JT.

So I tried again using my details, but left off the 0, i.e used format SO3 3JT and sure enough, it works!

So there we have it folks, there's another bug in paypal for UK users!

Of note this bug is also apparent when using the Paypal virtual terminal within paypal manager.

I've reported all above to Payapl and will let you know their response.

J

30 Mar 2007, 9:23 AM
#9
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

And there's more!

I've worked out that Paypal doesn't like it when there is a zero in the postcode format i.e SO30 3JT (a valid uk postcode), it will only accept the above postcode in this format SO3 3JT (an invalid uk postcode).

However this bug is only happening on UK debit cards, i.e switch/maestro e.t.c NOT credit cards i.e VISA,/Mastercard

But there's more! It does work when using a value greater than 0, I.e using the postcode format SO31 3JT is fine (tried friend's switch cards with different postal codes!)

Also found another bug, within paypal virtual terminal and Paypal payflow pro, that if the switch card has an issue number, but no start date, it keeps asking for a start date. If you then select a start date (any start date!) it will then work. This is a similar bug to the "got a start date, but no issue number" bug, but in reverse!

30 Mar 2007, 9:28 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Calljj:

Also found another bug, within paypal virtual terminal and Paypal payflow pro, that if the switch card has an issue number, but no start date, it keeps asking for a start date. If you then select a start date (any start date!) it will then work. This is a similar bug to the "got a start date, but no issue number" bug, but in reverse!

Yes, this one's a known issue -- the switch/maestro standards are not strictly enforced when the Credit Cards are manufactured. As such, the gateways have a hard time pre-validating the data. Best to not validate the issue number or start date fields ... just submit them raw, and if no value is supplied by the customer, enter 00 as a default. The credit card issuing bank will have to be the final authority on the validity of the card ... which is an issue PayPal will handle for you.

.
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.

30 Mar 2007, 9:53 AM
#11
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

DrByte:

enter 00 as a default.

Could you supply an example of code of how to insert a default number in a field please, i'm struggling to find a way to do this

30 Mar 2007, 10:06 AM
#12
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

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.

30 Mar 2007, 10:26 AM
#13
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Just modified the Payflow Pro module with some addiditons. this is the part for sending to paypal:

 // 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(),
30 Mar 2007, 10:28 AM
#14
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

here's the bit with additions for form fields, guess this is where it needs modifying?

    ////////////////////////////////////////////////////
    // !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;
    }
30 Mar 2007, 10:37 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

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:

$order->info['cc_starts'] = $_POST['cc_starts'];
$order->info['cc_issue'] = $_POST['cc_issue'];

to:

$order->info['cc_starts'] = ($_POST['cc_starts'] == '') ? '00' : $_POST['cc_starts'];
$order->info['cc_issue'] = ($_POST['cc_issue'] == '') ? '00' : $_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.

.
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.

30 Mar 2007, 10:37 AM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

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.

30 Mar 2007, 11:16 AM
#17
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

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

30 Mar 2007, 11:27 AM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

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.

30 Mar 2007, 12:05 PM
#19
calljj avatar

calljj

Zen Follower

Join Date:
Mar 2007
Posts:
253
Plugin Contributions:
2

Re: Payflow pro Module- Uk Debit Card issue with issue dates

Your just teasing now!:D
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?

30 Mar 2007, 12:09 PM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payflow pro Module- Uk Debit Card issue with issue dates

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.