Jump to content
Sign in to follow this  
mhormann

cc_show() Class Support Thread

Recommended Posts

So this will be the support thread for my cc_show() class.

 

First issue: http://forums.oscommerce.com/index.php?showtopic=125468#

 

continued here...

 

I'm pondering and checking, will come back (only it's now 4.49 AM, so I ought to get some sleep).

 

Matthias


I don't want to set the world on fire—I just want to start a flame in your heart.

 

osCommerce Contributions:

Class cc_show() v1.0 – Show Credit Cards, Gateways

More Product Weight v1.0

Share this post


Link to post
Share on other sites

jrickard:

 

I've taken your code into my cc.php to check out, and everything is fine... (except you have another version, including the CVVNUMBER stuff, but the code seems alright).

 

First things that come to mind:

 

1. You DID copy 'cc_show.php' to '/catalog/includes/classes/', right?

If that's not done, it should give some PHP warnings & fatal error anyway.

But then it also dies and leaves you with an empty screen below 'Payment Modules'.

 

2. You put your cc icon files in '/catalog/modules/payment/images/cc/'.

Then again, if the directory or the files are missing, cc_show() is robust enough to handle that—it simply returns an empty string in that case (i.e., no images shown).

 

3. You did not, by chance, overlook the small little tiny 'return $selection;' statement AFTER all these title and field thingies????

THAT would indeed make the whole module NOT show up during selection phase.

 

Here is the code you had, put into my cc.php and for comparison I give you the WHOLE function selection() here:

 

    function selection() {
     global $order;

// Modified to work with cc_show() class and show credit cards accepted
// Images stored in '/catalog/includes/modules/payment/images/cc/'
     include_once(DIR_WS_CLASSES . 'cc_show.php'); // NEW
     $cc_show_cc = new cc_show(DIR_WS_MODULES .'payment/images/cc/');

     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_CC_TEXT_CREDIT_CARDS_ACCEPTED,
                                               'field' => $cc_show_cc->get_cc_images(false, '', '', '')),
                                         array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,
                                               'field' => tep_draw_input_field('cc_owner', $order->billing['firstname'] . ' ' . $order->billing['lastname'])),
                                         array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,
                                               'field' => tep_draw_input_field('cc_number')),
                                         array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
                                               'field' => tep_draw_pull_down_menu('cc_expires_month', $expires_month) . ' ' . tep_draw_pull_down_menu('cc_expires_year', $expires_year)),
                                         array('title' => MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_CVVNUMBER . ' ' .'<a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_POPUP_CVV, '', 'SSL') . '\')">' . TEXT_CVV_LINK . '</a>',
                                               'field' => tep_draw_input_field('cvvnumber'))));
// End modified code
     return $selection;
   }

 

So, now I REALLY oughta go to bed... :-)))

 

Hope it helps, let me know...

 

Regards,

Matthias


I don't want to set the world on fire—I just want to start a flame in your heart.

 

osCommerce Contributions:

Class cc_show() v1.0 – Show Credit Cards, Gateways

More Product Weight v1.0

Share this post


Link to post
Share on other sites

By the way, in the line

 

'field' => $cc_show_cc->get_cc_images(false, '', '', '')),

 

you can as well abbreviate to

 

'field' => $cc_show_cc->get_cc_images(false)),

 

This would set parenthesis OFF and leave all others at default (align middle, width & height unchanged).


I don't want to set the world on fire—I just want to start a flame in your heart.

 

osCommerce Contributions:

Class cc_show() v1.0 – Show Credit Cards, Gateways

More Product Weight v1.0

Share this post


Link to post
Share on other sites
So this will be the support thread for my cc_show() class.

 

Matthias

 

Very nice contribution Matthias!

 

BTW to anyone considering this for the osCommerce PayPal IPN V1.1 contribution, the example Matthias gave for the PayPal 2.9 version plugs straight in!

 

Certainly presents a smarter look than the plain text original :thumbsup:

 

 

Dave.

Share this post


Link to post
Share on other sites
BTW to anyone considering this for the osCommerce PayPal IPN V1.1 contribution, the example Matthias gave for the PayPal 2.9 version plugs straight in!

 

 

How did you "Plug it straight in?" the install is very un-clear and i can see no clear instructions for the 2.9 ver , only blurry images in the install text. The paypal IPN V1.1 files dont resemble these at all.

 

Can you exalin how you did it ?

 

 

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×