Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Fax or Phone Credit Card Details Through


64sp

Recommended Posts

Hi,

Could someone please advise how to modify the order form to display the order contents on the ccbyfax form instead of "Purchase From Store Name"

I'm not sure if this is possible.

 

Also, I am wondering if its possible to display the comments field from checkout_confirmation.php?

 

Thanks for any help! :)

 

Steve

Link to comment
Share on other sites

  • Replies 113
  • Created
  • Last Reply

Top Posters In This Topic

Hi Steve

 

The full product list can definately be bought through to the form easily and I am fairly sure the order comments can too.

 

I will write the amended code today and post it to the forum.

 

64SP

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

To replace the "Purchase from STORE_NAME" and replace it with the product details:

 

In catalog/includes/modules/payment/ccbyfax.php insert the following code:

 

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

$printfaxform_button_string .=	

tep_draw_hidden_field('productqty' . $i, $order->products[$i]['qty']) .

tep_draw_hidden_field('productname' . $i, $order->products[$i]['name']);

}

$printfaxform_button_string .=	

tep_draw_hidden_field('numprods', $n) . 

tep_draw_hidden_field('comments', $order->info['comments']);

 

at approximately line 131 between:

tep_draw_hidden_field('email', $order->customer['email_address']);

and:

return $printfaxform_button_string;

 

Then in /catalog/ccbyfax_form.php replace at approximately line 81:

 

echo $HTTP_POST_VARS['desc'];

 

with:

 

for ($i=0, $n=$HTTP_POST_VARS['numprods']; $i<$n; $i++) {

echo $HTTP_POST_VARS['productqty' . $i] . ' x ' . $HTTP_POST_VARS['productname' . $i] . '<br>';

}

 

If you also want to add the order comments somewhere, I have already sent the POST_VAR in the code at the top so just add:

 

echo $HTTP_POST_VARS['comments'];

 

In an appropriate place on the form.

 

I have only taken across the product qty and product name in the code at the top but it should be easy for you to add other product fields such as 'model' or 'price' if you follow the same logic.

 

I dont intend to add this to the next version release (unless everyone thinks I should !) because the form is not intended as a full faxable order form (obviously you get that electronically in admin) but only as a credit card submission form and hencesummary details only are needed.

 

Hope this helps.

simon (64sp)

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Thanks much Simon! Works great! :D

 

I wish I knew how to code PHP better, but this is how I learn. I somehow forgot that I get all the order info in admin as well. Doh!

 

Anyway, it is nice that i got the order comments to appear in my form. This may be asking for too much but is it possible to get line breaks to appear in the comments field?

 

Example: The customer enters comments like this:

 

Comment line 1

Comment Line 2

Comment Line 3

 

I would like it to appear as such in my form, yet it appears like:

 

Comment line 1 Comment Line 2 Comment Line 3

 

Thanks again Simon!

 

Steve

Link to comment
Share on other sites

Hi Steve

 

Just change:

 

echo $HTTP_POST_VARS['comments'];

 

to:

 

echo nl2br($HTTP_POST_VARS['comments']);

 

and heh presto !

 

Glad I could help, I have absolutely no formal training in PHP either and have learnt (what little I know) from others in the osc forums and from just experimenting !!

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Thank you sir! :D What PHP I know is self taught as well, mainly from learning from those on this board like yourself. Someday I'll have to look up what n12br really means so I have a better understanding. :roll:

 

But thanks again,

 

Steve

Link to comment
Share on other sites

i tried to install this contribution on 2.2 and i get the following eror

 

Fatal error: Cannot redeclare _sess_open() (previously declared in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php:18) in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php on line 18

 

when i go to print the order form ?any one else having this problem

Link to comment
Share on other sites

I am thinking of adding this module on my site. I have a question: Does the ENTIRE Credit Card number and other details appear on the fax form?

If so, isn't it dangerous since it would be faxed openly?

 

Any help on this is GREATLY appreciated! Thanks for the module!

Link to comment
Share on other sites

Does the ENTIRE Credit Card number and other details appear on the fax form?

 

Hi, I currently take credit card payments only through Paypal. I do not have SSL installed on my site yet, but will soon. However, I do have a merchant account so I can process cards taken by phone or fax offline. I use this mod and with only these payment options, the credit card number is left blank, which allows the customer to print it out, fill it in, sign, and fax to me. My guess is you need the credit card payment module activated for it to complete it. Even then, if you don't want it completed, it's very easy just to comment out the lines that make that happen.

 

If so, isn't it dangerous since it would be faxed openly?

Ahh credit cards and security. I guess you could say it's dangerous to fax a credit card number to any business, if you don't really know who is on the receiving end. Most cards offer some type of buyer protection these days. And on second thought, is this any more dangerous than handing your credit card to a waiter who disappears with it for 15 minutes? :shock:

 

Most merchant account providers charge lower rates for those companies who only take payments by phone or fax. Online transactions cost more - the reason - higher risk of fraud.

 

In addition, all an SSL connection does is secure the transmission of data from the customer's browser to your server. Once it is stored on your server, the data is at risk of being viewed. This is why when I get SSL, I won't store the credit card data on my server for long. Even if you have taken steps to secure your server as tight as a drum, there's no such thing as 100% security on the internet IMO - your web host provider could access it if they really wanted to. Granted he/she probably won't, but you get my point.

 

I hope that helps.

 

Steve

Link to comment
Share on other sites

Thanks Steve for your reply :)

 

I aske dif it was "dangerous" to fax the credit card info through a fax because of fear of third parties being able to view it or intercept the information.

 

I own a hosting company, so I have SSL on my server and use 2Checkout.com for my credit card transactions (will be moving to merchant account in near future). I have not used the phone/fax option yet, so I was not sure how the security worked in this case. Is there a way to SSL secure the fax machine? lol.

 

Thanks again for your thorough response!

Link to comment
Share on other sites

Your welcome Dee. I don't want to get too off topic here, but I did find an interesting read on this here:

 

http://www.connotech.com/FAXBIBL.HTM#Toc!1

 

Yes fax transmissions can be intercepted, but one needs special equipment to do so. I've been receiving credit card info by fax for years and millions of other businesses do so every day. I have not had a problem to my knowledge. The point is I think many people are still afraid to punch in their credit card while online, and believe that faxing is a safer route. My goal is not to lose those customers, thus I implemented this great mod. :)

 

Is there a way to SSL the fax machine? Yes there are secure faxing solutions out there, encryptors you can buy. But I think the sender needs to have the equipment, not just the receiver. I may be wrong, because I am no means an expert in this area. I personally don't lose sleep over someone intercepting a fax sent by a customer. What would keep me up at night however, is knowing that credit card data is stored on my server. This can open one up for liability. I would much rather have it stored here in my file cabinet.

:wink:

 

Steve

Link to comment
Share on other sites

is there any one who would be able to help me with my problem on this contribution

Fatal error: Cannot redeclare _sess_open() (previously declared in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php:1 in C:wwwmajesticsoundsstorecatalogincludesfunctionssessions.php on line 18
Link to comment
Share on other sites

Your welcome Dee. I don't want to get too off topic here, but I did find an interesting read on this here:

 

http://www.connotech.com/FAXBIBL.HTM#Toc!1

 

Yes fax transmissions can be intercepted, but one needs special equipment to do so. I've been receiving credit card info by fax for years and millions of other businesses do so every day. I have not had a problem to my knowledge. The point is I think many people are still afraid to punch in their credit card while online, and believe that faxing is a safer route. My goal is not to lose those customers, thus I implemented this great mod. :)

 

Is there a way to SSL the fax machine? Yes there are secure faxing solutions out there, encryptors you can buy. But I think the sender needs to have the equipment, not just the receiver. I may be wrong, because I am no means an expert in this area. I personally don't lose sleep over someone intercepting a fax sent by a customer. What would keep me up at night however, is knowing that credit card data is stored on my server. This can open one up for liability. I would much rather have it stored here in my file cabinet.

:wink:

 

Steve

 

Thanks so much Steve for your wonderful posts! I've learned so much from you already :) Thank you! :D

Link to comment
Share on other sites

Hi Adrian,

 

Sorry wasn't ignoring your post...just been away a few days.

 

Could I just confirm are you using 2.2ms1 or a later snapshot of 2.2 ?

 

This contribution was only really written and tested on ms1 although I believe via this forum that others have it working on snapshots ?

 

I think the problem is caused by the fact that in the ccbyfax_form.php I have included application_top.php so that I had access to all of the file names, table names, languages etc that are defined in it. application_top.php itself includes the sessions.php file which starts the session.

 

So it would appear that when you got to open the fax form page to print, the session tries to re-open (via application_top.php) and causes an error.

 

I dont understand though why it works on some installs and not on others...maybe later snapshots have changed the session logic ?? Any comments anyone ?...or maybe different versions of PHP handle things differently ?

 

Can someone with better session knowledge than me help ?

 

I suppose a work around would be to not include application_top.php in ccbyfax_form.php but to manually "include" the relevant code from it yourself.....but ommit the session bits and any other irrelevant bits, because actually the ccbyfax_form.php page gets most of its information through the POST_VARS and needs little information (mainly just the language files) via application_top.php from the rest of osc.

 

Unless anyone has any better ideas or suggestions or solutions maybe I should look at doing that in the next version.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

I'm not sure if this will solve your problem or has anything to do with it, but one thing I've noticed in newer snapshots is that filenames are no longer defined in application_top.php. There is a separate file now called filenames.php.

 

Steve

Link to comment
Share on other sites

I have just uploaded a new version.

 

v1.2 adds the ability to produce a printable fax form from the account_history_info page for

orders where ccbyfax was the chosen payment method.

 

Note: My claim "where ccbyfax was the chosen payment method" is not bomb proof - When an order has been completed, OSC only records the text title of the payment method in the orders table as previously defined in the constant MODULE_PAYMENT_CCBYFAX_TEXT_TITLE in /catalog/includes/languages/english/modules/payment/ccbyfax.php. Therefore when deciding for each order in account_history_info.php whether to create a "produce fax form" button I could not use "if ($order->info['payment_method'] == MODULE_PAYMENT_CCBYFAX_TEXT_TITLE)" because if you were

to change the definition of that constant at a later date the buttons would no longer get produced for previous orders (because they would no longer be equal). I have therefore defined a search substring of "Fax" (or language equivalent) and used that to test if the payment_method contains the search substring before outputting a button. This assumes that even if you change the title constant you would always keep the word fax in it, seeing as faxing is the whole point of the module ! - Please advise if my solution doesn't work for you or if you have any better ideas !

 

I have also made some minor changes to the other files:

 

- Some minor cosmetics on the fax form.

- Changed the titles of the module to fit inside the 32 character max of the payment_type field of the order table

- Added to the email footer to let them know they can print a form from account history.

 

This module is still only written for and tested on ms1.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Sorry...very rude of me :oops: not to say.....

 

Thanks to all in this forum for comments and suggestions that have led to this latest (improved :?: ) version. Keep them coming and it'll keep improving !

 

:D :D

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

I use your fax contribution the first time, I downloaded it (MS 1).

 

Everything seems to work only if I press the button Generate form I get this failure

 

Fatal error: Call to undefined function: tep_href_link() in /homepages/23/d22152063/htdocs/webshop/catalog/ccbyfax_form.php on line 34

 

Can you please help me???

 

 

Stefan Fritsche

Link to comment
Share on other sites

I deleted

 

in

 

http://www.klosterbrauerei.net/webshop/cat...cbyfax_form.php

 

</style>

<script language="javascript" type="text/javascript">

window.resizeTo(600, 550);

</script>

 

and it worked,

 

one more thing

 

it shows now in the formular

for the fax Number:

 

Fax Nummer: MODULE_PAYMENT_CCBYFAX_FAXTO

 

instead of the number which I used???

 

HTH Stefan Fritsche

Link to comment
Share on other sites

OK, this one works now:

Fax Nummer: MODULE_PAYMENT_CCBYFAX_FAXTO

 

this was my mistake, but I still had to delete this

 

http://www.klosterbrauerei.net/webshop/cat...cbyfax_form.php

 

</style>

<script language="javascript" type="text/javascript">

window.resizeTo(600, 550);

</script>

 

or I get the failure :?:

 

Fatal error: Call to undefined function: tep_href_link() in /homepages/23/d22152063/htdocs/webshop/catalog/ccbyfax_form.php on line 34
Link to comment
Share on other sites

</style>  

<script language="javascript" type="text/javascript">  

window.resizeTo(600, 550);  

</script>

 

This block of code (as you probably know) just resizes the new browser window to fit the size of the cc form (and so that the new window does not overlay completely the window the shop is in, so that it is obvious to the customer that a new window has been opened for the form).

 

I dont know enough about javascript to know why this code should cause a problem with the tep_href_link() function which is used to produce the link to the privacy page. For this function to be undefined would indicate that application_top.php is not being included, but why would a self contained javascript effect the php code that has already been executed above it ? Is my javascript wrong does anyone know ? Maybe the problem is browser specific or effected by browser security settings ?

 

Any suggestions anyone ?

 

In the meantime kooyan, you will have to leave this code out or find an alternative way to resize the window.

 

Sorry I cant be of more help just now :(

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

  • 2 weeks later...

Adrian

 

If you look a few pages back on this thread you will see the code additions needed to add the customers product information to the form. Also you will find an explanation of why the invoicec/order number cannot be added to the form...because the form is produced before the order is added to the database and an invoice number allocated.

 

Thanks

Simon

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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