Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

fast easy checkout


nana

Recommended Posts

just added the new version

seelily.com/fec for demo

please report all issues here

you can change which login and password box you want to use on top of each create account file

if you have problems please explain what problem and what page and i will help as much as i can

make sure you backup even if you are upgrading from earlier version incase there is a problem

 

i recommend everyone make the changes to the includes/form_check.js

Edited by nana
Link to comment
Share on other sites

  • Replies 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

Hi guys,

 

First off, thanks nana for the great contribution. I installed it, works fine until I tried to incorporate my site with a 3rd party processor. The payment still gets processed, but I believe the session is lost during the transfer between sites (ie. my site -> 3rd party processor -> bank (e.g. Verified by Visa site) -> my site). Therefore, after the payment has been received/rejected/cancelled I would be transferred to an empty shopping cart (probably because of entering a new session and being redirected to checkout_success.php).

 

The CC processor I use is Paydollar, and it supports OSC. Here's what I did to use their service. In checkout_process.php, I commented out this line:

 

	LINE 307 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, ??, ?SSL?));

 

Then added:

?>
<html>
<body onLoad="payForm.submit();">
<?php
//translating credit card type
$ccType = $order->info['cc_type'];
if ($ccType =="Visa")
$ccType = "VISA";
else if ($ccType =="Master Card")
$ccType = "Master";
else if ($ccType =="Diners Club")
$ccType = "Diners";
else if ($ccType =="American Express")
$ccType = "AMEX";
else if ($ccType =="JCB")
$ccType = "JCB";
//translating year
$tempYear = "2000" + substr($order->info['cc_expires'],2,4);
//translating currency
if ($order->info['currency']=="USD") // American Dollar
$currCode = 840;
else if ($order->info['currency']=="HKD") // Hong Kong Dollar
$currCode = 344;
//***You can add code for currencies other than USD and HKD
//***Here are some code for other currencies :
//****************************************
// else if ($order->info['currency']=="SGD") //Singapore Dollar
// $currCode = 702;
// else if ($order->info['currency']=="CNY(RMB)") // Chinese Renminbi Yuan
// $currCode = 156;
// else if ($order->info['currency']=="JPY") // Japanese Yen
// $currCode = 392;
// else if ($order->info['currency']=="TWD") // New Taiwan Dollar
// $currCode = 901;
//****************************************
$form_action_url ='https://www.paydollar.com/b2c2/eng/dPayment/payComp.jsp';
echo tep_draw_form('payForm', $form_action_url, 'post');
?>
<input type="hidden" name="merchantId" value= "xxxx">
<!-- merchantId here is set to 1 for testing purpose -->
<input type="hidden" name="amount" value= "<?php echo $order->info['total']?>">
<input type="hidden" name="orderRef" value= "<?php echo $insert_id?>">
<input type="hidden" name="currCode" value= "<?php echo $currCode?>">
<input type="hidden" name="pMethod" value= "<?php echo $ccType?>">
<input type="hidden" name="cardNo" value= "<?php echo $order->info['cc_number']?>">
<input type="hidden" name="cardHolder" value= "<?php echo $order->info['cc_owner']?>">
<input type="hidden" name="epMonth" value= "<?php echo
substr($order->info['cc_expires'],0,2)?>">
<input type="hidden" name="epYear" value= "<?php echo $tempYear?>">
<input type="hidden" name="payType" value= "N">
<input type="hidden" name="successUrl" value=
"http://www.lemonpets.com/checkout_success.php?result=1">
<input type="hidden" name="failUrl" value=
"http://www.lemonpets.com/checkout_success.php?result=3">
<input type="hidden" name="cancelUrl" value=
"http://www.lemonpets.com/checkout_success.php?result=2">
<input type="hidden" name="lang" value= "E">
</body>
</html>
<?php

 

 

Then, the following code is added to checkout_success.php:

 

<?php
$result = $HTTP_GET_VARS['result'];
if ($result == 2){ //payment is cancelled
?>
<td valign="top" class="main">
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
<div align="center" class="pageHeading">
<?php echo "Your order has been cancelled"; ?>
</div><br>
<?php echo "You are welcome to make another order."; ?><br><br>
<?php
}else if ($result == 3){ //payment is rejected
?>
<td valign="top" class="main">
<?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?>
<div align="center" class="pageHeading">
<?php echo "Your order has been rejected by the bank."; ?>
</div><br>
<?php echo "The bank has rejected your order since payment information provided is
invalid."; ?><br><br>
<?php
}else if ($result == 1){ //result is successful
?>

 

Being new to PHP and not knowing what to do, I tried to change the success and fail URL to something like:

 

tep_href_link('checkout_success.php?result=1')

 

It does the same thing, but returns with a new session ID instead of just the cart being empty. That being said what I would like to know if it's beyond my control since the payment process is redirected to several other sites. If it is possible to correct this, then I'd appreciate any help that I can get. Many thanks in advance.

 

Peter

 

P.S. Don't try to make a transaction on the site because it is LIVE. Paydollar actually charges you to have a testing server :blink: and I opted not to. However, it's the only choice I have since I needed a processor that deals with Hong Kong dollar and banks.

Link to comment
Share on other sites

peter you are on the right track you can probably add the session id to your return url but you should develop a payment module

the way you have it now the sale is fully processed in oscommerce and then the request is sent so the cart is already emptied and emails are already sent

Link to comment
Share on other sites

Hello !

First , Thank you for great work Frank.

I 'd like to ask about small problem

 

when I select payment method on checkout_shipping (combined)

and proceed to confirmation I do not see it appear on the page

 

But

 

if come from checkout_payment page - it does appear

 

where should I find the place to correct this issue ?

 

Thank you for your time !

Link to comment
Share on other sites

just added the new version

seelily.com/fec for demo

please report all issues here

 

 

Hi Frank,

 

Thanks again for your continuing efforts.

 

I have installed your new files, and just have a few minor bugs to report.

 

 

1. In the first page of your instructions (part-1.html), step #6 at the bottom directs to definitions to the wrong file. It says to point to "fec_shipping.php", however no file with that name exists. I believe those two should point to your new "checkout_shipping.php" included file.

 

2. This one is minor, but there is a graphic image missing from the new files. The name is "loading.gif" and is shown on the checkout_shipping page when you click the "get new total" button in the shipping method area.

 

3. There is some HTML table problems with "checkout_shipping.php" that cause the display to be out of line. At or around line 149, is the following code:

 

if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td>
	<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
	  <tr class="infoBoxNoticeContents">
		<td>
		<table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table>
   </td>
	  </tr>
	</table>
<?php
 }
?>
  </td>
	<td>
	<table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		   </tr>
	</table></td>
  </tr>
<?php	require('includes/fec/products_box.php');?>

 

 

It should be replaced with this code:

 

if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
		<td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td>
	<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
	  <tr class="infoBoxNoticeContents">
		<td>
		<table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td>
			<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table>
   </td>
	  </tr>
<?php
 }
?>
  <tr><td><br>
  </td></tr>
<?php	require('includes/fec/products_box.php');?>

 

 

That's it for now. I hope this helps.

 

 

Eli

Link to comment
Share on other sites

I just found 2 more small bugs I missed in my previous post.

 

1. In "checkout_shipping.php", at or around line 366 is the line:

 

<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']);

 

This line should read:

 

<td class="main" width="100%" valign="top"><?php echo tep_output_string($error['error']);

 

This change will ensure the HTML tags don't show on the credit card error messages on the "checkout_shipping.php" page.

 

 

2. There is an HTML coding syntax error in "includes/fec/total_box.php".

 

At line 2:

 

<td align-"right><table border="0" width="100%" cellspacing="1" cellpadding="2" align-"center"   class="infoBox">

 

the line has 2 dashes (-) instead of 2 equal signs (=) for atrributes

 

The line should be:

 

<td align="right><table border="0" width="100%" cellspacing="1" cellpadding="2" align="center"   class="infoBox">

 

That's it for now.

 

Eli

Link to comment
Share on other sites

Thanks for the reply Frank.

 

I'm new to PHP so I'll have to sift through the payment modules to see if I can learn anything from them. I know it's beyond the scope of FEC, but do you have any suggestions on this? Thanks!

 

Peter

Link to comment
Share on other sites

peter this could be a little more complicated

you have to first figure out your logic

what do you want to do when the cc is declined

what do you want to do when cc is good

how do you want to handle the emails

you have to find a contribution that does something similar maybe stormpay or paypal

but it is not the easiest thing

Link to comment
Share on other sites

just added the new version

seelily.com/fec for demo

please report all issues here

you can change which login and password box you want to use on top of each create account file

if you have problems please explain what problem and what page and i will help as much as i can

make sure you backup even if you are upgrading from earlier version incase there is a problem

 

i recommend everyone make the changes to the includes/form_check.js

 

Hi

 

Have installed the new version and made the changes to form_check.js. I'm using the option with the billing and shipping address side by side but when i check the box to use the billing info as the shipping address nothing happens .. if I refresh or continue i get the standard error messages re missing shipping fields. Have checked my install and changes etc but can't spot anything obvious ... will triple check but was wondering if anybody else had this issue ... Thanks .......... and thanks for a really nice contribution

Link to comment
Share on other sites

Hi

 

Have installed the new version and made the changes to form_check.js. I'm using the option with the billing and shipping address side by side but when i check the box to use the billing info as the shipping address nothing happens .. if I refresh or continue i get the standard error messages re missing shipping fields. Have checked my install and changes etc but can't spot anything obvious ... will triple check but was wondering if anybody else had this issue ... Thanks .......... and thanks for a really nice contribution

 

Problem seems to be with the changes made to form_check.js but I can't figure it out ... the only thing I have noticed is that the insatll asks to change some code at line 61 but my file (pretty sure it's the vanilla os file) has the lines stated at line 123 .. the code at line 61 is something else entirely .. pretty sure this is just a typo in the line number in the install instructions, but the words straws and clutching come to mind .. :-"

Link to comment
Share on other sites

Problem seems to be with the changes made to form_check.js but I can't figure it out ... the only thing I have noticed is that the insatll asks to change some code at line 61 but my file (pretty sure it's the vanilla os file) has the lines stated at line 123 .. the code at line 61 is something else entirely .. pretty sure this is just a typo in the line number in the install instructions, but the words straws and clutching come to mind .. :-"

if you change the fields from the admin section for example disable states then you must comment out the javascript related to that field so there won't be an error in the javascript

if this does not solve your problem then post a link so i can look

Link to comment
Share on other sites

if you change the fields from the admin section for example disable states then you must comment out the javascript related to that field so there won't be an error in the javascript

if this does not solve your problem then post a link so i can look

 

Hi Jack

 

thanks for that ... been struggling with something else and it's now nearly midnight so it'll be tomorrow before i try this again ..will post here as appropriate

Link to comment
Share on other sites

if you change the fields from the admin section for example disable states then you must comment out the javascript related to that field so there won't be an error in the javascript

if this does not solve your problem then post a link so i can look

 

Hi again Frank ... just couldn't go to bed without having a look at this. You were right ... I had dosabled the company field in admin ... so i commented out the relevant lines and voila .. the shipping address now auto populates on demand .. cool

 

One small thing and I'm deffo not looking at this now 'cos it's probably my fault and should be easy to track and fix (just thought I'd mention it in case it's of interest) ..... when i click checkout and get the order form displayed with the invoice and shipping addresses alongside each other .... right at the top left of the page comes up //fast easy checkout end ... I know it's picking this up from the last line of the form_check.js.php mod 'cos I tried changing that line to //hey jude and sure enough that gets diaplayed in the very top left of the order form ... hey ho, I should have waited til the morning

 

Anyway the autopopulate looks good .. thanks heaps

Link to comment
Share on other sites

Hi again Frank ... just couldn't go to bed without having a look at this. You were right ... I had dosabled the company field in admin ... so i commented out the relevant lines and voila .. the shipping address now auto populates on demand .. cool

 

One small thing and I'm deffo not looking at this now 'cos it's probably my fault and should be easy to track and fix (just thought I'd mention it in case it's of interest) ..... when i click checkout and get the order form displayed with the invoice and shipping addresses alongside each other .... right at the top left of the page comes up //fast easy checkout end ... I know it's picking this up from the last line of the form_check.js.php mod 'cos I tried changing that line to //hey jude and sure enough that gets diaplayed in the very top left of the order form ... hey ho, I should have waited til the morning

 

Anyway the autopopulate looks good .. thanks heaps

 

Brian,

 

try putting the "//fast easy checkout end" in between <!-- and -->

Link to comment
Share on other sites

Brian,

 

try putting the "//fast easy checkout end" in between <!-- and -->

 

Hi

 

yep .. I figured that over brekky but thanks very much anyway .. all seems to be working now ... and a BIG thankyou to everybody who's worked on this contribution

Link to comment
Share on other sites

Hi,

 

I have installed this impressive contribution in such a way that a customer can only enter shipping details but not create an account. Now, when a customer orders the shipping details are still written in the customers table.

 

As the consequence - when the same customer wants to re-order with the same shipping details he sees the message:

 

"Your E-Mail Address already exists in our records - please log in with the e-mail address or create an account with a different address."

 

How can I prevent the E-Mail address from being matched in the customers table?

 

Thanks in advance.

 

Soeren

Link to comment
Share on other sites

my mistake should have been checkout_shipping.php

i wanted to rename it but i changed my mind

Looks like a great contribution.

I downloaded the most recent version and the file "fec_shipping.php" seems to be missing though.

Link to comment
Share on other sites

Hi,

 

I have installed this impressive contribution in such a way that a customer can only enter shipping details but not create an account. Now, when a customer orders the shipping details are still written in the customers table.

 

As the consequence - when the same customer wants to re-order with the same shipping details he sees the message:

 

"Your E-Mail Address already exists in our records - please log in with the e-mail address or create an account with a different address."

 

How can I prevent the E-Mail address from being matched in the customers table?

 

Thanks in advance.

 

Soeren

This works in the original contribution by checking to see if a noaccount was created before and would delete the original account and create a new one you must put that in

Link to comment
Share on other sites

I'd really like to get this baby working. It looks nice , but I have some worries I'm trying to work through.

 

I am working with this FEC contribution in a testing area,

and I keep getting the below error after entering the test credit card numbers in my authorize.net test account.

I'm using Authorize.net AIM.

also : just to note:

I have Simple Template System and CCGV and PWA account mods already in the code.

Here is the error message I keep getting after submitting a payment.

(note the card numbers and the authorize AIM module are working fine in another testing area without this contribution.)

 

Here is the error message: (I get after submitting payment)

---

The first four digits of the number entered are: <br>If that number is correct, we do not accept that type of credit card.<br>If it is wrong, please try again.

---

 

I saw one or two other posts regarding this error , but did not see any real fixes posted.

Anyone have any ideas on fixing this?

Or know where to point me.

I don't think its related to just the Authorize.net AIM payment module either.

 

--

Many thanks in advance for any tips.

 

--

Link to comment
Share on other sites

BounderOfAdventure

the credit card number goes from checkout_shipping.php to checkout_confirmation.php

it is in the few lines that you have to add to the top of your checkout_confirmation.php

i do not use sts but it might have something to do with that

this is not an issue with the current version as far as i know

test on my site seelily.com and see if you can see the problem

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