Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Everything is going well (we thought) and there are no errors per se, but when link point gets the order the expiration date is improperly formated and can't be run in real time.

 

except the expiration date appears as:

2/06 instead of 02/2006

 

the year is in 2 digits, and the months are single digit

 

Link Point Requires two digit month and 4 digit year.

 

Also, on the checkout_confirmation.php the payment mode value reads: pay but should read payplus

 

Does this mean anything to anyone????

Posted

okay, so used php myadmin and changed the table orders in the field cc_expires to varchar 6 rather than a varchar 4

 

will this fix the date issue?

 

I have not tested it yet - i guess I'm afraid I'll break it if I do.....

 

 

any suggetions?

Posted

oaky, I have a feeling I have to change something around line 85 of catalog/includes/modules/payment/linkpointbasic.php

 

    function selection() {

     /* ORIGINGAL

  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)));

     }



     $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)));

     }



     $selection = array('id' => $this->code,

                        'module' => $this->title,

                        'fields' => array(array('title' => MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_OWNER,

                                                'field' => tep_draw_input_field('linkpointbasic_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),

                                          array('title' => MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_NUMBER,

                                                'field' => tep_draw_input_field('linkpointbasic_cc_number')),

                                          array('title' => MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_EXPIRES,

                                                'field' => tep_draw_pull_down_menu('linkpointbasic_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('linkpointbasic_cc_expires_year', $expires_year))));



  return $selection; EOF_ORIGINAL*/

  for ($i=1; $i < 13; $i++) {

       $expires_month[] = array('id' => sprintf('%d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000))); //removed %02

     }



     $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)));  //Y changed to y

     }



  // ADDED FOR CREDIT CARD TYPE

  //$credit_types_id = array('V'=>'Visa', 'M'=>'MasterCard' , 'A'=>'American Express' , 'D'=>'Discover');

  //$credit_types_name = array('Visa' , 'MasterCard' , 'American Express' , 'Discover');



  $credit_types_name = array(array('id' => 'V', 'text' => 'Visa'),

                             array('id' => 'M', 'text' => 'MasterCard'),

        array('id' => 'A', 'text' => 'American Express'),

        array('id' => 'D', 'text' => 'Discover'));

  // ($i=1; $i<5; $i++) {

  //	$credit_types = array('id' => sprintf(array_shift($credit_types_id), $i), 'text' => sprintf(array_shift($credit_types_name), $i));

  //}



     /*before new checkout code

  $selection_string = '<table border="0" cellspacing="0" cellpadding="0" width="100%">' . "n" .

                         '  <tr>' . "n" .

                         '    <td class="main"> ' . MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_NUMBER . ' </td>' . "n" .

                         '    <td class="main"> ' . tep_draw_input_field('linkpointbasic_cc_number') . ' </td>' . "n" .

                         '  </tr>' . "n" .

       '    <td class="main"> ' . MODULE_PAYMENT_LINKPOINTBASIC_TEXT_TYPE . ' </td>' . "n" .

                         '    <td class="main"> ' . tep_draw_pull_down_menu('linkpointbasic_cc_type', $credit_types_name) . ' </td>' . "n" .

                         '  </tr>' . "n" .

                         '  <tr>' . "n" .

                         '    <td class="main"> ' . MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_EXPIRES . ' </td>' . "n" .

                         '    <td class="main"> ' . tep_draw_pull_down_menu('linkpointbasic_cc_expires_month', $expires_month, date('m')) . ' / ' . tep_draw_pull_down_menu('linkpointbasic_cc_expires_year', $expires_year) . '</td>' . "n" .

                         '  </tr>' . "n" .

                         '</table>' . "n";

* END BEFORE NEW CHECKOUT CODE*/

 $selection = array('id' => $this->code,

                        'module' => $this->title,

                        'fields' => array(array('title' => MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_OWNER,

                                                'field' => tep_draw_input_field('linkpointbasic_cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),

                                          array('title' => MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_NUMBER,

                                                'field' => tep_draw_input_field('linkpointbasic_cc_number')),

            array('title' => MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_TYPE,

                                                'field' => tep_draw_pull_down_menu('linkpointbasic_cc_type', $credit_types_name)),

                                          array('title' => MODULE_PAYMENT_LINKPOINTBASIC_TEXT_CREDIT_CARD_EXPIRES,

                                                'field' => tep_draw_pull_down_menu('linkpointbasic_cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('linkpointbasic_cc_expires_year', $expires_year))));

     return $selection;

   }

Posted

the author pm'd me and gave me the fix for the exp date:

 

Go to about line 105 where it reads:

$expires_month[] = array('id' => sprintf('%d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000))); //removed %02

 

Where is says

array('id' => sprintf('%d', $i)

change to

array('id' => sprintf('%02d', $i)

 

 

needless to say - it works beautifully now :)

  • 2 weeks later...
Posted
okay, so used php myadmin and changed the table orders in the field cc_expires to varchar 6 rather than a varchar 4

 

 

 

 

You said you used php myadmin to change the table order in the field cc_expires. What was the file name for that change?

 

Was it checkout_process.php? Or which page.

 

I am having the same problem.

 

Thanks!

Posted

I guess that wasn't made in a php page. I need to edit my database. Right?

 

Okay, okay.....I am learning...slowly.

Posted

So your saying change the table, orders in the field cc_expires to varchar 6 rather than a varchar 4.

 

I don't see where in the following file,

catalogincludesmodulespaymentlinkpointbasic.php, to change varchar to 6 rather than 4.

 

I changed the orders table in my db in the field cc_expires to 6 from 4.

 

Thanks!

Posted

no, changing the table cars did nothing to fix it, instead in the link point contribution, on the page: catalog/includes/modules/payment/linkpointbasic.php

 

Go to about line 105 where it reads:

 

$expires_month[] = array('id' => sprintf('%d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000))); //removed %02

 

Where is says:

array('id' => sprintf('%d', $i)

 

change it to :

array('id' => sprintf('%02d', $i)

 

that should do it, it did for me.

Posted

Thanks WebMistress. That worked for me too.

 

It is now sending the proper expiration number with 4 digits.

 

Thanks!!

 

Jen

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...