Jump to content

Offline Credit Card Module (new version 3.01.production)


Recommended Posts

The version mentioned in this thread is OUTDATED and has been REPLACED by version 3.01.production. Please see http://www.prestashop.com/forums/viewthread/58273/third_party_modules/module_offline_credit_card_payment_v3_dot_01_dot_production for the new module

Offline Credit Card Module
This module allows current business owners with their own means of+ credit card processing the ability to receive credit card information from their online customers and process it offline via their own system. It does not do any processing itself!

Current version is v2.0.5, it is attached to this post.

To install this module, extract it's contents to /yourPrestaDir/modules/
Then go to your Back Office -> Modules -> Offline Credit Card Module [install]

creditcard_v2.0.5.zip

  • Like 1

Share this post


Link to post
Share on other sites
  • Replies 417
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

The version mentioned in this thread is OUTDATED and has been REPLACED by version 3.01.production. Please see http://www.prestashop.com/forums/viewthread/58273/third_party_modules/module_offline_credi

Posted Images

This is actually really useful.

Some requests for the next version:
- double check to make sure the credit card number is the right # of digits and starts with the correct 2 numbers.
- ask for type of CC
- extra security?

Share this post


Link to post
Share on other sites

Ok. I redid the storage method to use a dedicated database table already, v2.0 uses it fully. The CC number is checked with mod10 check digit, but yes, I can make an option to ask for type of card. What do you mean by extra security?

Share this post


Link to post
Share on other sites

I've been trying my best. Also, CVC will be an optional field, and there will be a help-bubble for people who don't know what a CVC number is. Along with the ability to select a card issuer and a check for the first digits.

Share this post


Link to post
Share on other sites

I have just uploaded version 2.0.1 of the Offline Credit Card Module. Improvements include:


#) Dedicated Database Table for Data Storage


#) Improved Code Design / Structure


#) Comments galore


#) Ability to require / not require a CVC number



Version 2.0.2 (due out soon) will include the following:


#) CVC Explanation


#) Card Type Selection (if time allows)


#) Ability to accept specific types of cards (if time allows)

Share this post


Link to post
Share on other sites

It is offline, meaning you need some other form of CC processing to complete the transaction. This just stores the information in a database so you can charge it out later.

--Kevin

Share this post


Link to post
Share on other sites

I just uploaded version 2.0.2 of the Offline Credit Card Module.

Notable Improvements:


#) Better server-side validation


#) Client-side validation scripts


#) Easier program flow and design


#) Entry form automatically determines card type based on number


#) CVC Explanation link (popup)

 



It is available for testing on the first post of this thread.

--Kevin

Share this post


Link to post
Share on other sites

Great module! Just a couple of bugs I found so far...

1) Javascript error on keyup of entering credit card number in IE7 (see function doSetup in functions.js)
2) I downloaded and installed 2.0.2, but shop admin says version is 1.8 still. (see function __construct in creditcard.php)
3) It appears that the module install assumes that CREDIT_CARD_ID_ORDER_STATE value already exists in the configuration table. I would think that the installer should check to see if it exists and use Configuration->_addConfiguration if necessary.

Let me know if you need any help on future implementations of this module. I wouldn't mind helping dig in a bit more...

Thanks,
Matthew

Share this post


Link to post
Share on other sites

1.) Hmm, odd. I will look into this bug. I tested in IE7 and it worked for me. Basically, that image of the CC next to the text box changes to the card issuer's logo once a valid card number is entered and verified. ;)
2.)Yes, I fixed that for the next release, it was an oversight on my part.
3.) Most of the time, a Configuration object does not need to be set, most functions are used with Configuration::functionName(values);. Configuration::updateValue("CREDIT_CARD_ID_ORDER_STATE") updates an existing value, or creates a new one if one does not exist (Line 251 of ps/classes/Configuration.php).

Yes, I would love help with this module. It is pretty much finished, but there is always more that can be added. If you could do me a favor and look through the code for structural mistakes or odd implementations, that would be great. I spend a day at work restructuring the module to make it neater. Turns out, validation.php is not needed, and it only made the job harder! So, everything is in creditcard.php, functions.js and the remaining .tpl files!

Thanks for your help! I will get working on problem 1 immediately.

--Kevin

Share this post


Link to post
Share on other sites

I've installed 2.0.2 which I downloaded from the first post
Using Prestashop Version 1.0.0.8

It all ran smoothly on a test order until completion of the payment where I get the error "Hack attempt (OrderHistory -> id_order_state is empty)" on the page creditcard/payment.php

Share this post


Link to post
Share on other sites

Hello, I also downloaded the 2.0.2 version and I am running the 1.0.0.5 version of prestashop.

I'm sorry orry to tell you more of the same, but I also ran a test purchase, where all went fine until the end. I recieved the following errors;

Notice: Undefined variable: errName in C:\Inetpub\wwwroot\cart\modules\creditcard\creditcard.php on line 146
Notice: Undefined variable: errNumber in C:\Inetpub\wwwroot\cart\modules\creditcard\creditcard.php on line 146
Notice: Undefined variable: errCVC in C:\Inetpub\wwwroot\cart\modules\creditcard\creditcard.php on line 146
Hack attempt (OrderHistory -> id_order_state is empty)

I'm not good enough with php to understand how to fix the problem. I hope you can help?

Share this post


Link to post
Share on other sites

Great model. But problems:

I installed 2.0.2 version but in the admin panel it says 1.8. and I am running the 1.0.0.8 version of prestashop.

I also get "Hack attempt" error.

Anyway to fix this?

Thank you
Bijan

Share this post


Link to post
Share on other sites
Great model. But problems:
I installed 2.0.2 version but in the admin panel it says 1.8. and I am running the 1.0.0.8 version of prestashop.
Bijan


It is because this module is still in development so the version number hasn't been changed in the file. The version number is also a "module" version number not a Prestashop version number
It's no biggy for now.

Ox40, I tried to install 2.0.3 and also received the Hack Attempt error
I am able to install 2.0.2 with no error

When I last got a Hack Attempt with Prestashop it was because I had deleted the default country or language or currency or one of those.

I don't actually require this module anymore but thought I'd just test for fun :)

Thanks for your efforts

Share this post


Link to post
Share on other sites

Installe final version and received the hack attempt 1 time.. refreshed the page and hit configure again and worked great.. already tested on a transaction.. THING is.. how do I recover the credit card info to do the charge process..
Thanks

Charlton

Share this post


Link to post
Share on other sites
Installe final version and received the hack attempt 1 time..


I have downloaded the Offline Credit Card Module v2.0.3 and experienced the same as above, however unfortunately I am still having errors:

Hack attempt (OrderHistory -> id_order_state is empty)

when I try to submit the CC payment.

I have changed a zone from US to North America, included Canada in that zone and added the provinces/territories into the 'states' list.

I really don't know how to fix this? Please help.

Share this post


Link to post
Share on other sites

ERROR

Hack attempt (OrderHistory -> id_order_state is empty)
I get also..


Its such a shame as it is such a great shopping cart system and I was really looking forward to using the offline CC option. I have tried to fix it myself but it is over my programming skillset!

Has anyone else got any idea how to fix this error?

Cheers
Mike

Share this post


Link to post
Share on other sites

I ended up going with www.e-path.com.au
e-Path is an Australian payment gateway that enables us to collect credit card details securely online to later process them offline.
It costs $A 242 a year but it saves me worrying about people hacking into my database. It's also cheaper than a "real time" payment gateway.

Share this post


Link to post
Share on other sites

I have setup a GoogleShop buy button which is good and very cheap at 1.5% but I still wanted teh option to rec CC details and check stock etc before charging the customer. This Offline Credit Card payment module looks perfect and get so close but then fails - its such a shame.

Does any body know who made it so I can contact them?

Share this post


Link to post
Share on other sites

Version 1.8 aka 2.02 works great.. the 2.0.3 seems more buggy than the past one..

Luck to all and Thanks for these modules.. they are great.

Charlton

Share this post


Link to post
Share on other sites

Great.. I dont know if it was yours, but I remember a couple days ago I I tested a 0.58 module and has encryption wich would be great.. it didnt work but it was a really good idea.
since it is sensitive information

Charlton

Share this post


Link to post
Share on other sites

Yes, this module is completely and totally my creation - version .58 is VERY VERY old, and many parts of it are not as functional as I wanted them to be. ALL versions of this module include an encryption method, the newest versions dropped the cryptN method for the built in Blowfish method, and it works pretty well. Let me know how it works.

--Kevin

Share this post


Link to post
Share on other sites

you mean the 2.0.2 has the data encrypted already.. or the one you are making will drop the crypt.. I'm wondering since The 2.0.2 is working for me now and would update it only if the new one is safer.. it you had the encryption invisible to the user and not so error possible would be great..

Charlton

Share this post


Link to post
Share on other sites

All versions have encryption.... 2.0.2 is not much different that .4, just some minor changes, so if it works for you, I would stick with it until I release a 2.1.x version, that's when a big change takes place.

--Kevin

Share this post


Link to post
Share on other sites

Hi Kevin,
thanks for having another try at fixing your cool module. I gave it a try tonight and this is what happened.
ps. using ver 1.0.0.8 and your 2.0.4

On install I got
Hack attempt
...Hit refresh and went back to modules and it had installed.
Configured Creduit Card Module and set CVC to TRUE.
Everything seemed find.

Did an order and got
Hack attempt (OrderHistory -> id_order_state is empty)
DOH!
I checked in the Admin area ORDERS and could not see the order, yet it IS showing in the customer account - also no email was sent.
Also (OF note) I did a PDF invoice date search again in the admin area and DID find the order!! Great... almost.

So close. I hope you crack it soon.

best wishes
Mike

Share this post


Link to post
Share on other sites

I'm gonna try it tonight.. What noticeable difference would I see fro 2.0.2 to .4..
if 2.0.2 is working for me, would you recommend me to upgrade.. or you worked on the other people bugs?

Charlton

Share this post


Link to post
Share on other sites

Kevin,

Thank you so much for creating this off-line CC module.

I just downloaded and installed v2.0.4. I still get this message;

Hack attempt (OrderHistory -> id_order_state is empty)

I am VERY interested in getting this module working. If I can supply any info to help you do that, please don't hesitate to ask.

Currently I am running Prestashop on a local server, while I tweak it, and ready it to go live sometime around October 1 or October 15.

I'm running WinXP pro, IIS ISAPI, PHP 5.02, and MySQL Server 5.0, and I am using IE6 as my interface. I am editing with Dreamweaver CS3.

On this module,

I have the CCV required set to true.

Thank you again,
Angie

Share this post


Link to post
Share on other sites

Kevin,

A few more notes on what's happening when I use the CC module.

The order history shows the credit card purchase, but does not show the .pdf icon on the main order history page. In the order detail page, no items are listed in the drop down details, but the amount of the order is listed.

Earlier, when I highlighted "Hack attempt (OrderHistory -> id_order_state is empty)" to post it here to the forum, my clipboard also copied all of the product categories. I didn't think it relevant at the time, but since then I have uninstalled and re-installed the module, and it doesn't do that anymore. I wonder if that wasn't a clue of some sort, so I mention it now.

Also, just now when I uninstalled and re-installed the module, I got a "Hack Attempt" message at install. Yet, when I went back to the main Modules page, it was listed there as installed, and I was able to open the "configure" page.

I don't know if any of this is really relevant to what's making it malfunction, but I thought if you know more, it may help.

Thanks,
Angie

Share this post


Link to post
Share on other sites

Is there supoposed to be an entry in config.inc.php for the Credit Card? I notice there isn't anything for credit card or awaiting payment under "Order states". I thought I saw it mentioned that there would be an order state called Awaiting Payment" if someone used the CC transaction.

Is it possible that when I get the hack attempt message on install of the module, that even though it shows as installed in Modules that it hasn't configured config.inc.php properly and install is in fact incomplete?

I wish I knew more about this. :long:

Also, I'm not using SSL, and the CC module calls it up on line 227 with 'this_path_ssl'. Could this keep my module from working?

Share this post


Link to post
Share on other sites

Yeah maybe LOL

He's maybe on vacation, or taking a break from this module. I can't say as I blame him... I'm only trying to use it and it's driving me insane... he actually knows (and understands) the smarty stuff! That has to be exhausting in and of itself Hahahah :lol:

Share this post


Link to post
Share on other sites

To make v.2.0.4 work I had to add CREDIT_CARD_ID_ORDER_STATE (with the value 11) to ps_configuration and make the table ps_order_credit_data by hand (look inside creditcard.php for more information). Then then module worked fine except for a error message in the backoffice "Notice: Undefined index: remData in /.../modules/creditcard/creditcard.php on line 242"

Share this post


Link to post
Share on other sites

Sorry I have been away from this thread for a while, busy week... The problem seems to be with the install method, I will take a look at it.

Edit:
Man, I feel stupid. The problem was in my function _makeOrderState(), the line should have read

if(!(Configuration::get("CREDIT_CARD_ID_ORDER_STATE") > 0))


but was instead

if(!(Configuration::get("CREDIT_CARD_ID_ORDER_STATE" > 0)))


Whoopsie!

I will release v2.0.5 once this post is finished.

--Kevin

Share this post


Link to post
Share on other sites

Hi welcome
Go to page 1 and on the first post download latest version, unzip and copy folder (credit card) into to your modules folder online. Then go to your back office modules and click install and configure. That should work.


Regards mike

Share this post


Link to post
Share on other sites

I also noticed that bug, I am not sure, I think it stems from the Blowfish encryption module. I have tried to troubleshoot it before, but I got nowhere. If someone could look through the source and find the issue, it would be great.

--Kevin Klika

Share this post


Link to post
Share on other sites

Looks like it could be related to the encoding? utf8 versus iso-8859-1 etc. That's when I've usually had such things.

I'll need to download this, and see how it's put together, it having been written by a fellow payment module "nut" :cheese:

Paul

Share this post


Link to post
Share on other sites

SSL problem?

I have tested the new 2.0.5 vesrion and not everything is send with encrytion. The problem is when you Submit Order the browser (firefox, safari) notifies you that not everything is encrypted. Also you get sent to a non SSL page in the next step (http).

At least in my version the base href is <base href="http://www.sitename.com/" /> instead of <base href="https://www.sitename.com/" />


This problem can be corrected by adding

/* SSL Management */
$useSSL = true;

in payment.php

The next thing is to make the user go back to regular http after that...

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Turning off CVC breaks the checkout process, after submitting the CC details, the customer sees the CC details page again with the exp date reset. THey can't go any further.

Turning on CVC, the module functions as normal for me.

Share this post


Link to post
Share on other sites

Hello Guys.

Do you know where in Europe i can sign up for a virtual terminal (E-Terminal) without having to wait too long. The verification process of the ones i checked is terrible.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Hi!

I just downloaded the Offline Module v2.0.5 an tested it.

I have an SSL installed and when the checkout process starts the cart goes into SSL mode but if I select Credit Card the page: /modules/creditcard/payment.php shows with `Connection Partially Encrypted'.

Also the `padlock' has an exclaimation mark and the address bar reverts back as though it's unsecured although the URL still shows https://

Any ideas as to what's causing it to no longer be encrypted -if I choose another payment method (eg: Cheque) it remains encrypted.

Thanks
Ernie

Share this post


Link to post
Share on other sites
I am not sure of... the problem, it should not be happening. Try Back Office -> Modules -> Offline Credit Card Module [uninstall] then reinstall.


That fixed the problem by my side =) .

Share this post


Link to post
Share on other sites

Hi
Great module, working very well,
we just have some problem with the encoding on the payment page, the month in the box are not corect.
like say bellow, maybe some problem with UTF-8 and ISO 8859-1, anyway to fix that !?

Regards

Share this post


Link to post
Share on other sites

I have Swedish as default language, installed the module (2.05), and the swedish languagefile, but when clicking "Pay order" I get “Hack attempt (OrderState->name is empty for default language)”

I tried to Uninstall/Install, but no difference...

What to do?

Share this post


Link to post
Share on other sites
Question no 2.

Where to change the language for card exp. (month)? I searched the code, but i couldn´t find it :(


Did you look in the languages files?. Maybe you need to add the new language line for that sentence. :roll:

Share this post


Link to post
Share on other sites

Bug? :

When selecting multiple 'Currencies authorized' , the costumer can only pay in the first currency selected.
(I don't get the select/option from payment_execeution.tpl)

Looks like it doesn't properly create or loop $currencies_used...

Share this post


Link to post
Share on other sites

look in module translations

Question no 2.

Where to change the language for card exp. (month)? I searched the code, but i couldn´t find it :(


and in order -> orderstatus for your other issue.

Share this post


Link to post
Share on other sites

Bug? :
Looks like it doesn't properly create or loop $currencies_used...


Bug, no. Oversight, yes. I did not develop this module to accept different currencies, it was designed for use in a USD-only environment. I will look into changing it tho.

Share this post


Link to post
Share on other sites

I get this error: "Hack attempt (OrderHistory -> id_order_state is empty)"

I have tried uninstalling and reinstalling the module, but the error is the same.

When I install the module I get this error: "Hack attempt (OrderState->name is empty for default language)"

I'm using version 2.0.5.

Share this post


Link to post
Share on other sites
  • 3 weeks later...
Hi,

I'm using 1.1 B2 of Prestashop and 2.05 of the card module and, like
aravot (above), can't find where the Card number is displayed in the admin section. Can anyone help?


You find the cardnumbers under "orders" and then you just press a specifik order that has been payed with card. If I may ask, how/where do you transfer your payment using those cardnumbers?

Share this post


Link to post
Share on other sites

Thanks for the reply Olaf - it's my client who does all the processing. I'm not sure what they use I'm afraid.

In the end I replaced the 1.1b2 AdminOrders.php file with the 1.0 file and it now works. The number is showing.

Edit:

You can use the 1.1b2 AdminOrders.php but you need to place this code in it just above: /* Display customer information */

// display card module
       $hook = Module::hookExec('invoice', array('id_order' => $order->id));
       if ($hook !== false)
       {
           echo '
'.$hook;
       }

Share this post


Link to post
Share on other sites