Jump to content

MANUAL CREDIT CARD - I DID IT!!!


Guest

Recommended Posts

I have tried to implement this into one of my carts and all seems well....

BUT...

I cannot seem to get the form to pass the required data to MALS-E :

Product Quantity Price Amount 

ORDER ID : 050727-160711-6361 1 0.00 0.00 



--------------------------------------------------------------------------------

 

All prices are in British Pounds TOTAL 0.00




The details that should be passed are:


Product Code Qty Price 

Briarwood Rolled Lead 5/8" x 4'

Colour - Black Leather  BRIF2 2 £40.00 

Shipping Method: By Weight (1st Class)    Subtotal: £40.00 

Total Tax: £0.00 

Total Shipping: £2.95 

Grand Total: £42.95




The order ID is passed but not totals... here is my form, all looks OK:




<form method="post" action="http://ww9.aitsafe.com/cf/pay.cfm" target="mywindow" onsubmit="window.open('','mywindow','resizable=0,scrollbars=1,width=600,height=500')">

        <div align="center">

        <input type="hidden" name="userid" value="B******" />

        <input type="hidden" name="inv_name" value="{VAL_INVOICE_NAME}" />

        <input type="hidden" name="inv_addr1" value="{VAL_INVOICE_ADD1} {VAL_INVOICE_ADD2}" />

        <input type="hidden" name="inv_addr2" value="{VAL_INVOICE_TOWN}" />

        <input type="hidden" name="inv_state" value="{VAL_INVOICE_COUNTY}" />

        <input type="hidden" name="inv_zip" value="{VAL_INVOICE_POSTCODE}" />

        <input type="hidden" name="inv_country" value="{VAL_INVOICE_COUNTRY}" />

        <input type="hidden" name="qty1" value="1" />

        <input type="hidden" name="product1" value="ORDER ID : {VAL_CART_ORDER_ID}" />

      <INPUT TYPE="hidden" NAME="price1" VALUE="{VAL_GRAND_TOTAL}">

        <input type="submit" value="Pay by Credit Card" />

        </div>

      </form>

Any Clues people?

Cheers,

MiniMe

Link to comment
Share on other sites

Guest gpgarrettboast

omigosh. This is awesome. :mellow:

EDIT: Argh... Now I see the problem you are talking about... Maybe we're using the wrong variable? /me goes to read PHP files.... I guess I'll just use paypal for right now :o

Link to comment
Share on other sites

A big thanks to cho123456 for this!

Cho, could you please advise *exactly* where in the page code you have inserted your code?

There are a couple of places it *might* go; better to get it right first up.

My editor provides Line Numbers, so something like, "In between line x and line y" would be a great help for many of us.

Again, thanks for the great contribution.

Link to comment
Share on other sites

Copy the code from your template file and paste it into your favourite wysiwyg editor.

You can then insert the form data anywhere that looks good... I inserted mine between the pay by cheque and pay by card functions. Plus I have formatted all of the text in the form too.

I am still having problems with the data being passed correctly to Mals particularly the prices, shipping and tax, all other data transfers OK.....

Any clues!

<form method="post" action="http://ww9.aitsafe.com/cf/pay.cfm" target="mywindow" onsubmit="window.open('','mywindow','resizable=0,scrollbars=1,width=600,height=500')">

              <div align="center">

                <p>

                  <input type="hidden" name="userid" value="B******" />

      

                  <input type="hidden" name="inv_name" value="{VAL_INVOICE_NAME}" />

                  <input type="hidden" name="inv_addr1" value="{VAL_INVOICE_ADD1} <br> {VAL_INVOICE_ADD2}" />

                  <input type="hidden" name="inv_addr2" value="{VAL_INVOICE_TOWN}" />

                  <input type="hidden" name="inv_state" value="{VAL_INVOICE_STATE}" />

                  <input type="hidden" name="inv_zip" value="{VAL_INVOICE_POSTCODE}" />

                  <input type="hidden" name="inv_country" value="{VAL_INVOICE_COUNTRY}" />

      

                  <input type="hidden" name="del_name" value="{VAL_DELIVER_NAME}" />

                  <input type="hidden" name="del_addr1" value="{VAL_DELIVER_ADD1} <br> {VAL_DELIVER_ADD2}" />

                  <input type="hidden" name="del_addr2" value="{VAL_DELIVER_TOWN}" />

                  <input type="hidden" name="del_state" value="{VAL_DELIVER_STATE}" />

                  <input type="hidden" name="del_zip" value="{VAL_DELIVER_POSTCODE}" />

                  <input type="hidden" name="del_country" value="{VAL_DELIVER_COUNTRY}" />  

          

                  <input type="hidden" name="qty1" value="{VAL_PRODUCT_QUANTITY}" />

                  <input type="hidden" name="product1" value="ORDER ID : {VAL_CART_ORDER_ID}" />

                  <input type="hidden" name="total" value="{VAL_GRAND_TOTAL}" />

                  <input type="hidden" name="shipping" value="{VAL_SHIPPING}" />

                  <input type="hidden" name="subtotal" value="{VAL_SUBTOTAL}" />

                  <input type="hidden" name="tax" value="{VAL_TOTAL_TAX}" />

                  <input type="hidden" name="return" value="www.glenwooddogsupplies.co.uk" />

                  <input type="submit" value="Secure Payment by Credit Card" />

                </p>

              </div>

          </form>

I have tried different variables for the grand total..... but nothing works!

ta

M

Link to comment
Share on other sites

BROOK

I've changed my code so much and added so much stuff, if I tell you the number, it would be completely different than what you would have in yours.

So let me be a bit more helpful in regards to where I put the code....

I put it right above the CHECK OPTION. You will find the check option right where it says:

"""MY CODE CAME HERE"""

<table .....................>

<!-- BEGIN: check_true -->

so it was BELOW the Receipt of Products and right above the CHECK OPTION.

Hope that helps!!!

Link to comment
Share on other sites

MINI ME

Hey I think I know what's wrong..........

I forgot to let you guys something else on regards to the TOTAL!!!!!!

Check this out....... in the same folder where you find the ORDERFORM.TPL you will find another file "orderform.php"

in approx line # 124 you will find the VARIABLE MAKER that makes the GRAND TOTAL!!!

$print_order_form->assign("VAL_GRAND_TOTAL",priceFormat($result[0]['prod_total']));

Well, you see that variable is writting this : $00.00

The problem is that MALS-E doesn't accept the value with the DOLLAR SIGN ($).

So that's why underneath that line I created my own variable:

$print_order_form->assign("VAL_TOTAL_TOTAL",($result[0]['prod_total']));

which writes the total as: 00.00 (without the dollar sign).

So in your form..... in the total price, pass the variable TOTAL TOTAL instead of the GRAND TOTAL but make sure you add that variable in the orderform.php first too!

That should fix it!!!

Same if you want to pass the shipping rates and all other type of rates since it is writting all of them with a "$" right before the number, and MALS-E doesn't accept the DOLLAR SIGN..... just numbers.

Link to comment
Share on other sites

cho123456

I followed your instructions and...... it did not work. I used the code as detailled:

$print_order_form->assign("VAL_TOTAL_TOTAL",($result[0]['prod_total']));

it did not work so I changed the VAL_TOTAL_TOTAL to VAL_GRAND_TOTAL and it worked... it actually passed on the Gross amount, so I think I know where I am going with this.

This worked for me!!!

$print_order_form->assign("VAL_GRAND_TOTAL",($result[0]['prod_total']));

Cheers

MiniMe

Link to comment
Share on other sites

Just an update on this...

All variables are now being passed over correctly to MALS Ecommerce.

Thanks very much for your support cho123456

If anyone needs help too I seem to know where I am going on this.

M

Link to comment
Share on other sites

Guest GunnarGeir

I get the grand total now. Special thanks to you cho123456 :errm: - The line 124 in order_form.php; $print_order_form->assign("VAL_GRAND_TOTAL",($result[0]['prod_total'])); worked for me.

Link to comment
Share on other sites

One more update:

DO NOT set the variable "qty1" to:

<input type="hidden" name="qty1" value="{VAL_PRODUCT_QUANTITY}">

this will multiply the value by the quantity and you will end up with multiples of the gross total.

Set it to:

<input type="hidden" name="qty1" value="1">

this will ensure that if someone purchase 2, 3 , 4 or more of any item, their totals will always add up correctly.

Cheers.

Link to comment
Share on other sites

  • 3 months later...

is anyone using this?

It would be a nice mod if it worked... I think everyone went to the Mal's Mod. Mal's is nice, but it's using a 3rd party ssl, which dosent' make me feel all warm and fuzzy...

Link to comment
Share on other sites

This is an interesting discussion and if it works would make a nice addition to future releases. Problem as I see it is there are too many little line additions here and there that it's confusing. If someone could write this up as a complete Mod, it could be included in Downloads.

Link to comment
Share on other sites

I was playing with this earlier and it was working fine but tonight I get some errors - that may not even be related to this - I also installed a shipping mod, maybe that's the problem. Any ideas?

Warning: Invalid argument supplied for foreach() in /home/content/r/a/i/xxxxxxxx/html/onlinestore/includes/content/cart.inc.php on line 346

this is the line it refers to:

foreach($basket['conts'] as $key => $value){

When I purchase an item the quantity shows in the cart preview area at the top of the page but no dollar amount shows and the product doesn't' show up in the view cart area.

Terri

Link to comment
Share on other sites

I have tried this & it all seems to be working except for emptying the basket when you return to store & the fact that it only passes the order id & not the products.

Any ideas anyone?

Link to comment
Share on other sites

I've been proposing that for weeks ;)

Anyhoo, this may be a good stop gap, small problem though, I can't seem to wrap my head around how athe templating system work (v2 was easy include header include footer etc). I'm trying to make the print order form look like the rest of the site as it's not being used as a printable form now. Anyone know how this would be done

My eyes hurt :w00t:

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